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 esm resolver for bundlers #5070

Merged
merged 6 commits into from
Mar 1, 2023
Merged

Add esm resolver for bundlers #5070

merged 6 commits into from
Mar 1, 2023

Conversation

mkslanc
Copy link
Contributor

@mkslanc mkslanc commented Feb 23, 2023

Issue #, if available:

Description of changes:

  • Add setModuleLoader for ace config to allow ace.config.setModuleLoader('ace/ext/beautify', () => import('./src-noconflict/ext-beautify.js')); dynamic imports for all extensions for bundlers (tested in Webpack 5, Parcel, Vite).
  • Add ESM resolver generator to be called on prepack for ace-code package (respecting paths)
  • Add ESM resolver generator for ace-builds (respecting paths)

I left webpack-resolver generator as it could be used for webpack 4 or less.

Example builds could be found here

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov
Copy link

codecov bot commented Feb 23, 2023

Codecov Report

Base: 86.20% // Head: 86.21% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (00fed1e) compared to base (16a13ce).
Patch coverage: 85.71% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5070   +/-   ##
=======================================
  Coverage   86.20%   86.21%           
=======================================
  Files         548      548           
  Lines       41704    41716   +12     
  Branches     6564     6565    +1     
=======================================
+ Hits        35953    35965   +12     
  Misses       5751     5751           
Flag Coverage Δ
unittests 86.21% <85.71%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/config.js 81.11% <82.14%> (+1.34%) ⬆️
src/config_test.js 98.48% <100.00%> (+0.15%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@nightwing nightwing marked this pull request as ready for review February 25, 2023 11:34
src/config_test.js Show resolved Hide resolved
tool/esm_resolver_generator.js Outdated Show resolved Hide resolved
@@ -0,0 +1,65 @@
var fs = require("fs");

function buildResolver() {
Copy link
Member

Choose a reason for hiding this comment

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

can you import these functions from Makefile.dryice.js?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed code to import, hope that would work

src/config.js Outdated Show resolved Hide resolved
ace.d.ts Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants