Skip to content

Conversation

eirslett
Copy link
Contributor

@eirslett eirslett commented May 1, 2021

The code, written in AMD module syntax, lives in the "ui"
folder.
A new Grunt task is added ("esmify") that will process every
JavaScript source file in the "ui" folder and convert the AMD
imports into ESM imports.
The transpiled code will be stored in the "esm" folder.

This means that consumers of jquery-ui can choose whether they
want to use the ESM version or the AMD version.

The code, written in AMD module syntax, lives in the "ui" folder. A new Grunt task is added ("esmify") that will process every JavaScript source file in the "ui" folder and convert the AMD imports into ESM imports. The transpiled code will be stored in the "esm" folder. This means that consumers of jquery-ui can choose whether they want to use the ESM version or the AMD version.
Copy link
Member

@mgol mgol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! This looks quite cool but my main worry is the maintenance cost. We have very few resources for jQuery UI these days so as long as code is authored in AMD, I'd rather not add another module system to the repo as there will always be edge cases.

If we were to migrate to ESM and generate AMD, that would be something to think about but even then I'm not sure if we'd do it due to the above.

If you want an ESM version of jQuery UI, can't you publish it as your own package under your npm scope? You can set up some Git hooks to catch new UI releases & re-generate their ESM versions if you want; however, I don't suspect lots of versions being released in a short time range so this shouldn't be such a big issue.

@mgol
Copy link
Member

mgol commented May 7, 2021

@fnagel what do you think?

@eirslett
Copy link
Contributor Author

eirslett commented May 8, 2021

Thanks for the reply! I think I will go ahead and just publish it as something like @eirslett/jquery-ui-esm.

If we were to migrate to ESM and generate AMD, that would be something to think about but even then I'm not sure if we'd do it due to the above.

I tried doing that as well, what you could do is run the script I put in this PR and commit the results - it's jQuery-formatted and only affects the first couple of lines. Converting ESM to AMD is much simpler, so the gode generation script would be more manageable.

@eirslett eirslett closed this May 8, 2021
@eirslett eirslett deleted the esm branch May 8, 2021 23:24
@fnagel
Copy link
Member

fnagel commented May 10, 2021

@mgol I agree we have very limited resources and should rather not add a new module system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants