Skip to content

Make runtime Props validation optional #548

@rdhelms

Description

@rdhelms

What problem does this feature solve?

Now that Vue is embracing TS, I think there’s much less value in validating component props via JS prototypes at runtime. It can still be a useful feature for a pure JS setup, but if someone has a TS setup where Volar is able to see the types without a runtime definition, they really don’t need the type to be validated at runtime.

Validating component props at runtime feels like trying to validate function params at runtime. It seems better to just let TS handle it.

What does the proposed API look like?

The goal would be for the app not to throw a runtime error for a setup such as in vuejs/core#7832, and instead allow the prop to pass through to the child component.

Perhaps this could be controlled with a validateRuntimeProps boolean option in vite.config.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions