ionic-framework
ionic-framework copied to clipboard
fix(core): add an export map to import individual components
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
nodetobundlerin 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
- [x] 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
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 |
Thanks @sean-perkins for the feedback, I applied suggested improvements.
@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.
~~Will this also fix the described code-splitting issue here https://github.com/ionic-team/ionic-framework/issues/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.
@christian-bromann what's the status of this PR?