Draft
Conversation
a6d78c5 to
97e0a4d
Compare
Member
|
We could change typescript settings to generate ESM now. |
SukkaW
requested changes
Apr 5, 2023
Member
There was a problem hiding this comment.
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.
Member
|
I think this PR can be closed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WIP