Hacker News new | ask | show | jobs
by EvanYou 2098 days 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-fuawK1TltYLX... (runtime props definitions auto-generated from TS interface)

4 comments

But 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.

FYI Evan, that doc is currently private.
The google doc is restricted.