Open petermuessig opened 2 months ago
@idoprz @tomer-epstein @rimasirich @alex-gilin - maybe one of you can have a look into this issue and we can discuss this? I'm still unsure what to do? Transpiling the code back to CJS is also an option but this would also mean to downport dependencies as dynamic imports can't be used as well. I need to understand the way you run the template a bit more in detail to judge what the best option would be for Easy UI5 to run again with the Template Wizard. THX.
Cc: @nicoschoenteich
@petermuessig It seems that adding support for ESM is high effort task. I suggest we have a meeting with @rimasirich , @alex-gilin & Avital the PO to discuss the options
@idoprz - I'm open to meet and discuss the options. 👍
When trying to use the Template Wizard in VSCode or BAS for the Easy UI5 generator it immediately crashes with the following error message:
This states that ESM-based generators are not supported by Yeoman UI. Are there any plans to change that? As more and more NPM packages are ESM-based a change to ES modules helped to simplify the code a lot.
I tried to create a proxy generator which dynamically requires the ESM-based Easy UI5 generator. Unfortunately, without success as the dynamic import statement leads to the following error:
To verify the issue a bit more in depth, I made a very basic ESM-based generator:
in this case it now fails with the following error message:
So, basically the environment in which the generators are executed seem to assume CJS modules and not ESM and ESMs are not supported there as
import
or dynamic importimport(...)
statements are not supported there. Are there any intentions to support ESM-based generators by the Template Wizard in the future? I would assume that more and more generators will adopt to ESM as it is now also in general supported by Node.js.