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

Add support to esm blueprints. #16991

Merged
merged 4 commits into from
Nov 15, 2021
Merged

Conversation

mshima
Copy link
Member

@mshima mshima commented Nov 12, 2021

Node community is adopting esm and commonjs packages cannot depend on esm packages.
By allowing blueprints to switch to esm, will make easier esm adoption on generator-jhipster probably for v8.

Why this is needed?
require() doesn't exist on an esm module. It was replaced by the async import().
So every operation that depend on dynamically loading a module (like a blueprint), need to be converted to async.
A constructor is always sync, as workaround, an async _postConstruct needs to be used to wait for the blueprint to be instantiated.


Please make sure the below checklist is followed for Pull Requests.

When you are still working on the PR, consider converting it to Draft (below reviewers) and adding skip-ci label, you can still see CI build result at your branch.

@mshima mshima marked this pull request as ready for review November 12, 2021 14:05
@mshima mshima merged commit 4825c2c into jhipster:main Nov 15, 2021
@mshima mshima deleted the skip_ci-esm_blueprints branch November 15, 2021 20:56
@pascalgrimaud pascalgrimaud added this to the 7.4.0 milestone Nov 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants