Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: move JSX DOM types back to @vue/runtime-dom #7979

Merged
merged 12 commits into from Mar 29, 2023

Commits on Mar 28, 2023

  1. fix: copy-paste jsx-runtime types for global JSX namespace registration

    Otherwise TypeScript will raise TS2322 errors. I have no idea why and
    how does the fix work. But it does.
    
    Even importing the `ReservedProps` and `NativeElements` types from
    `jsx-runtime` instead of declaring them in the module would fail the
    tests. I have no idea why, either.
    
    The failing tests are at https://github.com/vuejs/ecosystem-ci/actions/runs/4538928668/jobs/7998297656#step:7:3
    sodatea committed Mar 28, 2023
    Copy the full SHA
    e54dde1 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    5d36547 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    bd45800 View commit details
    Browse the repository at this point in the history

Commits on Mar 29, 2023

  1. fix: augment JSX types from @vue/runtime-dom should work

    Fixes use cases such as https://github.com/vuetifyjs/vuetify/blob/29777628ac8839c0548e869d3d350ed9fdcbb149/packages/vuetify/src/shims.d.ts#L18-L25
    
    Adds a new `./jsx.d.ts` entry in `@vue/runtime-dom` to avoid duplication
    in `vue`. It should be removed in 3.4 when we stop registering global
    JSX namespace by default.
    sodatea committed Mar 29, 2023
    Copy the full SHA
    5088bd4 View commit details
    Browse the repository at this point in the history
  2. fix: add jsx.d.ts to files

    sodatea committed Mar 29, 2023
    Copy the full SHA
    0dc1894 View commit details
    Browse the repository at this point in the history
  3. fix(wip): move JSX DOM types back to @vue/runtime-dom

    Drops `vue/jsx-runtime/dom`.
    The previous commits didn't work because imported (and re-exported)
    types cannot be augmented.
    So I give up on the idea of moving the DOM types to `vue/jsx-runtime`.
    They don't pollute the global namespace anyway.
    
    There's still one caveat that I have to import the
    `IntrinsicElementAttributes` type from
    `@vue/runtime-dom/dist/runtime-dom` rather than using the package name
    as entry. Seems because in this monorepo, TypeScript always picks up
    the source file (`index.ts`) over the built file
    (`dist/runtime-dom.d.ts` as specified in the `types` field in
    `package.json`)
    sodatea committed Mar 29, 2023
    Copy the full SHA
    241d222 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    5566fc0 View commit details
    Browse the repository at this point in the history
  5. wip: save

    yyx990803 committed Mar 29, 2023
    Copy the full SHA
    429717f View commit details
    Browse the repository at this point in the history
  6. refactor: move shared types

    yyx990803 committed Mar 29, 2023
    Copy the full SHA
    042e9d7 View commit details
    Browse the repository at this point in the history
  7. fix: VNodeRef

    yyx990803 committed Mar 29, 2023
    Copy the full SHA
    1e04aae View commit details
    Browse the repository at this point in the history
  8. Copy the full SHA
    ba9a2d5 View commit details
    Browse the repository at this point in the history
  9. Copy the full SHA
    08fd197 View commit details
    Browse the repository at this point in the history