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(vue): import JSX from default component library export #574

Merged
merged 3 commits into from
Dec 19, 2024

Conversation

christian-bromann
Copy link
Member

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Build (npm run build) was run locally for affected output targets
  • Tests (npm test) were run locally and passed
  • Prettier (npm run prettier) was run locally and passed

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

In Vue the output target would generate a file importing the JSX namespace from /components, e.g.

import type { JSX } from 'component-library/components';

This works when using the old Node classic import resolution but fails with ESM and Node16 and up.

What is the new behavior?

Since the the default export just re-exports what's in /components, e.g. export * from './components'; we can just adjust the import path.

Does this introduce a breaking change?

  • Yes
  • No

Other information

Copy link
Contributor

@tanner-reits tanner-reits left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only thing I can think that might have an impact on this is needing the single-export-module export type on the CE build, but we have that called out as a requirement in the docs when using includeImportCustomElements

@christian-bromann christian-bromann merged commit 2526b82 into main Dec 19, 2024
3 checks passed
@christian-bromann christian-bromann deleted the cb/import-jsx branch December 19, 2024 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants