6 ms·
It's not that we can't implement it like that, the real challenge is in minimizing breakage from v2. We decided it's better to not completely alter how props ar
by EvanYou 6y ago
It's not that we can't implement it like that, the real challenge is in minimizing breakage from v2. We decided it's better to not completely alter how props are declared because that would be too much breakage.
Instead, there's the compiler-based approach with `<script setup lang="ts">`: https://docs.google.com/presentation/d/1VjBM6ae-fuawK1TltYLXtcXGaxJw1y8ncT6wnbjaBGo/edit#slide=id.g86a2c92822_0_168 https://docs.google.com/presentation/d/1VjBM6ae-fuawK1TltYLX... (runtime props definitions auto-generated from TS interface)
- mthoms 6y agoFYI Evan, that doc is currently private.
- solarmist 6y agoThe google doc is restricted.
- IshKebab 6y agoBut if the prop definitions are generated at runtime that means Typescript can't check them at compile time surely? Better than Vue 2 I guess but still not as good as React. Fair enough on not wanting to break things, but I still feel like it is Vue's second biggest flaw and worth breaking to fix.
- dbfa 6y agoMore detailed info: https://github.com/vuejs/rfcs/blob/sfc-improvements/active-rfcs/0000-sfc-script-setup.md https://github.com/vuejs/rfcs/blob/sfc-improvements/active-r...