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

Node Native ESM Support #31

Closed
Silic0nS0ldier opened this issue Jan 3, 2020 · 5 comments · Fixed by #80
Closed

Node Native ESM Support #31

Silic0nS0ldier opened this issue Jan 3, 2020 · 5 comments · Fixed by #80
Labels
enhancement Issue enhances existing functionality or development processes.
Milestone

Comments

@Silic0nS0ldier
Copy link
Member

As of NodeJS 13, ES Modules are now stable. Furthermore, there are strategies for backward compatible adoption.

At this stage, there are upstream dependencies (e.g. AVA avajs/ava#2293) and likely corner cases to consider (mainly around CJS and ESM boundaries). Regardless, it is worth putting some thought into native ESM support can be achieved. Particularly as quicker adoption means less transpilation is needed (meaning more predictable issues in the wild).

@Silic0nS0ldier Silic0nS0ldier added enhancement Issue enhances existing functionality or development processes. blocked Issue resolution is blocked by either a task dependency or assignee needs help. labels Jan 3, 2020
@Silic0nS0ldier Silic0nS0ldier added this to the major milestone Jan 3, 2020
@Silic0nS0ldier
Copy link
Member Author

AVA v3 has arrived, but only with the groundwork for ES modules support. At the time of writing I'm unaware of any work arounds to have AVA continue with the esm package anyway.

Given this, as much of the groundwork (import paths, bulk of package config) will be done in the meantime to permit a speedier implementation later on.

@Silic0nS0ldier Silic0nS0ldier changed the title Native ESM Support Node Native ESM Support Feb 21, 2020
@Silic0nS0ldier
Copy link
Member Author

AVA v3.3 added support for loading ES module tests. Some creativity may be needed to ensure both entrypoints are tested, and that they can be properly consumed.

@Silic0nS0ldier
Copy link
Member Author

ESM code can now be imported in Node 12 and above without the experimental flag.

@Silic0nS0ldier
Copy link
Member Author

Native ESM is working (yay!) but we'll need to purge esm from the sibling packages for this to work correctly.

Pausing this until userfrosting/merge-package-dependencies#15 is resolved, after which the migration can begin.

@Silic0nS0ldier Silic0nS0ldier added the blocked Issue resolution is blocked by either a task dependency or assignee needs help. label May 29, 2020
@Silic0nS0ldier
Copy link
Member Author

userfrosting/merge-package-dependencies#15 is a significant refactor which demands a lot of attention. I've got time back on my side (so it'll get done) however with NodeJS 10 soon to leave maintenance level support, I need to get the esm adapter out of everything ASAP to avoid major breakages.

This is now unblocked.

@Silic0nS0ldier Silic0nS0ldier removed the blocked Issue resolution is blocked by either a task dependency or assignee needs help. label Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issue enhances existing functionality or development processes.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant