User tests: Successful: Unsuccessful:
Pull Request for Issue # .
import Cropper from 'cropper-module';
in the crop scriptrpm ci
Cropper is a Global Object
Cropper is ONLY available in the scope of the crop.js!
There 2 parts: the import statement in the file that wants to import another script (ESM module) and the exposure of the module to the WAM (check the files in this PR). In the client side what happens is:
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
Category | ⇒ | Repository JavaScript NPM Change Front End Plugins |
Status | New | ⇒ | Pending |
Labels |
Added:
NPM Resource Changed
PR-5.0-dev
|
is it good to name it -module instead of -esm ?
this was my take, it was picked randomly, could change to whatever you decide. That said there is an interesting change that could be done in the source files: instead of the suffix .es6 you could use directly the extension mjs (the official extension for the esm modules). I’m not proposing to have those extensions for the transpiled modules because if the server doesn’t have the infra in place (mime.types) it he file could be send as text and everything will be broken. Fwiw I already did that on the Joomla-tools (they are essentially the tools on this repo written on pure esm)
I think use of .esm.js
is fine.
It often can find recomendations to use .jsm
instead of .js
for ES modules.
But it a bit cryptic to me and require more changes in core.
Anyways I’ve changed the name of the asset to cropper.esm
Well, I think "cropper-module" was also fine :)
"cropper-module" => cropper.esm.js
im talking about the SOURCE files not the transpiled
I am about file in general ;)
About a source file I not care very much how it will be called, I am fine with any.
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-06-26 07:49:55 |
Closed_By | ⇒ | HLeithner | |
Labels |
Added:
Feature
|
Thanks, I'm merging this for now to have a reference using esm in core
is it good to name it -module instead of -esm ?