Conversation
❌ Deploy Preview for vuejs-coverage failed.
|
|
Looks like dts tests run before building, trying to fix it. |
|
Notes: If we land this, to avoid disruption in userland we need to:
This is still technically a breaking change, especially for TSX users. To minimize the disruption, I think we should first start shipping this with auto registration by default in a minor, to allow Volar and existing projects to start using explicit global registration in advance. Then we remove auto global registration in a future release. |
| @@ -0,0 +1,69 @@ | |||
| /** @jsx h */ | |||
| import { h } from '../packages/jsx' | |||
There was a problem hiding this comment.
@vue/jsx instead of ../packages/jsx does not work, don't know why.
|
|
||
| // suppress ts:2669 | ||
| export {} | ||
| import '@vue/jsx/register' |
There was a problem hiding this comment.
This produces a warning that ./dist/jsx does not exist. Since we are building in parallel, it is eventually created.
| @@ -0,0 +1,35 @@ | |||
| { | |||
| "name": "@vue/jsx", | |||
There was a problem hiding this comment.
I hope it's okay to use @vue/jsx as package name.
There was a problem hiding this comment.
It's more like @vue/tsx though 😂
Unless we are planning to add more functionalities to this package later.
| } | ||
| export interface IntrinsicAttributes extends ReservedProps {} | ||
| export interface ElementChildrenAttribute { | ||
| $slots: {} |
There was a problem hiding this comment.
Does this count as breaking change?
ElementChildrenAttribute sets the name of children within props. https://www.typescriptlang.org/docs/handbook/jsx.html#children-type-checking
There was a problem hiding this comment.
Vuetify uses $children. Volar uses $slots but it isn't inside $props so doesn't count.
|
Also, can we use something like /** @jsxImportSource @vue/jsx */See jsxImportSource example: |
This works. I think users should be required to explicitly specify it in tsconfig compilerOptions instead of implicitly adding it automatically in virtual code. The PR seems to have issues with // packages/jsx/jsx-runtime.d.ts
import { h } from './dist/jsx'
export namespace JSX {
interface Element extends h.JSX.Element { }
interface ElementClass extends h.JSX.ElementClass { }
interface ElementAttributesProperty
extends h.JSX.ElementAttributesProperty { }
interface IntrinsicElements extends h.JSX.IntrinsicElements { }
interface IntrinsicAttributes extends h.JSX.IntrinsicAttributes { }
interface ElementChildrenAttribute extends h.JSX.ElementChildrenAttribute { }
} |
|
Closing in favor of #7958 - restructured to |
@vue/jsx@jsxpragma@vue/jsx/registerRelated #1033 #1034