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

feat: ES module builds (ESM Support) #2665

Draft
wants to merge 37 commits into
base: dove
Choose a base branch
from

Conversation

fratzinger
Copy link
Member

@fratzinger fratzinger commented Jun 12, 2022

This pull request adds ES module builds to all package distributables. It is backwards compatible by still providing the CommonJS version as well but will use ES modules in applications with "type": "module" (like the generated app) and with client side bundlers so it can use features like tree shaking.

Closes #2748
Closes #2001

fratzinger and others added 21 commits October 15, 2021 22:14
[pull] dove from feathersjs:dove
- add module.exports for default export
@daffl
Copy link
Member

daffl commented Jun 13, 2022

This looks like a good step, thank you. I am seeing the same error locally you can see in CI:

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib' is not defined by "exports" in /home/runner/work/feathers/feathers/packages/transport-commons/node_modules/@feathersjs/errors/package.json

I'm not sure what that means since all those packages have an identical configuration.

@netlify
Copy link

netlify bot commented Oct 29, 2022

Deploy Preview for feathers-dove canceled.

Name Link
🔨 Latest commit 820743d
🔍 Latest deploy log https://app.netlify.com/sites/feathers-dove/deploys/63a1fa7fabc93400090a0d76

@fratzinger fratzinger changed the title fix: esm build esm build Oct 29, 2022
@fratzinger fratzinger changed the base branch from esm-build to dove October 29, 2022 17:57
@daffl daffl changed the title esm build feat: ES module builds Dec 20, 2022
@FossPrime FossPrime changed the title feat: ES module builds feat: ES module builds (ESM Support) Jun 5, 2023
@fratzinger fratzinger marked this pull request as draft June 7, 2023 20:50
@fratzinger
Copy link
Member Author

@daffl, @FossPrime

I don't know what the error in the generator is about:
image

Builds are passing. I think we could try it out.

I don't know what the best strategy is though. Install from github is not possible because of lerna workspace packages, right? Maybe we need pre-versions.

@daffl
Copy link
Member

daffl commented Dec 20, 2023

Making a note here that the thing that may be missing is that the ESM and CJS folders each need a package.json that declares the module type like

{ "type": "module|commonjs" }

Now that TypeScript seems to support it properly it might also make sense to use full imports with .js extensions.

@daffl daffl mentioned this pull request Dec 22, 2023
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.

Optimization warnings in Angular 10 [Dove] Drop reliance on legacy runtime compatibility settings
4 participants