Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(core): add an export map to import individual components #29717

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

Open
christian-bromann wants to merge 3 commits into main
base: main
Choose a base branch
Loading
from cb/module-resolution

Conversation

@christian-bromann
Copy link
Contributor

@christian-bromann christian-bromann commented Jul 16, 2024
edited
Loading

What is the current behavior?

The core package doesn't provide an export map, which prevents modern code bases to import specific components.

fixes #29716

What is the new behavior?

This patch contains:

  • a switch from node to bundler in the `moduleResolution field, both resolutions are very similar - changing this has no impact on the user as it is only for internal development
  • adding export entries for individual components to allow packages using modern module resolutions to import individual components

Does this introduce a breaking change?

  • Yes
  • No

This should not impact users at all but enable them to use a different module resolution. However, I may not be too familiar how Ionic components are imported, therefor it would be good to do some thorough testing.

Other information

n/a

Copy link

vercel bot commented Jul 16, 2024
edited
Loading

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ionic-framework ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 17, 2024 6:16pm

@github-actions github-actions bot added the package: vue @ionic/vue package label Jul 16, 2024
Copy link
Contributor Author

Thanks @sean-perkins for the feedback, I applied suggested improvements.

Copy link
Contributor

@christian-bromann it looks like the docs.json still needs to be added to the package.json exports to resolve the Vue related build issues.

For the angular build issues/test issues, you should see this error:

Error: Module not found: Error: Package path ./loader

we should export the loader path as well for the lazy loaded distribution.

christian-bromann reacted with thumbs up emoji

Copy link
Contributor

@sean-perkins sean-perkins left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

We should definitely get someone from the Ionic Framework team to look at this for visibility to the change/impacts.

There is some risk that we are missing exporting an obscure build file that is not leveraged in Ionic Framework's packages/test apps, but a developer is making use of. I still think we could publish this as a patch or minor and if those cases are reported, we add the missing exports paths/evaluate what files are being consumed.

christian-bromann reacted with thumbs up emoji
@sean-perkins sean-perkins requested review from brandyscarney and thetaPC and removed request for joselrio July 19, 2024 13:58
"import": "./components/ion-accordion.js",
"types": "./components/ion-accordion.d.ts"
},
"./ion-avatar": {
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the reason for not including ion-action-sheet, ion-alert, and others that are missing?

Copy link

muuvmuuv commented Sep 26, 2024
edited
Loading

(削除) Will this also fix the described code-splitting issue here #28574 ? Sounds like with that change I am able to just use a component from one exported path instead of just @ionic/angular/standalone, right? (削除ここまで)
ok nvm I just tested removing fesm and export datetime explictly it does not change the build outcome or put datetime in a separate chunk file, guess its up to the bundlers... looking at you rspack.

Copy link
Contributor

thetaPC commented May 23, 2025

@christian-bromann what's the status of this PR?

@brandyscarney brandyscarney requested review from OS-jacobbell and removed request for brandyscarney October 22, 2025 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@thetaPC thetaPC thetaPC left review comments

@OS-jacobbell OS-jacobbell Awaiting requested review from OS-jacobbell

+1 more reviewer

@sean-perkins sean-perkins sean-perkins approved these changes

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

package: core @ionic/core package package: vue @ionic/vue package

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

feat: update moduleResolution from node to node16 or bundler

AltStyle によって変換されたページ (->オリジナル) /