-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
WIP: refactor: migrate to ESM #130
base: master
Are you sure you want to change the base?
Conversation
a6d78c5
to
97e0a4d
Compare
We could change typescript settings to generate ESM now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although some of Node.js community members stated that the cost of transition is minimum, but unfortunately this isn't true for Hexo. We can (and we should) experimenting with ESM, but I will block this PR from being merged, since ESM is still not ready yet. Here are why:
- Import Map does not work as expected for most of Node.js versions.
- Inconsistent default import/export behavior across runtime/bundler.
- We can't replace dynamic require with dynamic import. Hexo uses dynamic require for lazy-loading modules in order to improve cold boot performance and reduce the memory usage. While dynamic require is synchronous, dynamic import is asynchronous and we will have to make huge change to our existing code bases (mostly plugin loading, themes' scripts loading, extensions loading, etc.), and eventually we will have to introduce breaking changes that will break most of existing themes and plugins.
I think this PR can be closed |
WIP