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
Fix Github Actions #196
Fix Github Actions #196
Conversation
4195d0b
to
72e95f1
Compare
@@ -7,4 +7,4 @@ var index = _ => { | |||
|
|||
return index; | |||
|
|||
}()); | |||
})(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All IIFEs are now )()
instead of ())
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting, I wonder why (but don't have the heart to research it now)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found the PR that introduced the change: rollup/rollup#4215
You can see it in the blame view here: https://github.com/rollup/rollup/blame/master/test/form/samples/mjs/_expected/iife.js
I don't really see a reason why though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What this PR introduces is the output.generatedCode
option which you can use to configure what JS syntax should be used for code generated by rollup (not the code you wrote yourself, but the code around it).
If I add the following to lib/bundle/config.js
:
cfg.output = {
generatedCode: "es2015"
}
Then, the resulting code of test_bundle_customization
for IIFE will for example look like this:
--- a/./expected_iife.js
+++ b/./dist/bundle_iife.js
@@ -1,10 +1,5 @@
-var MYLIB = (function () {
-'use strict';
-
-var index = _ => {
+const index = _ => {
console.log("lipsum");
};
-return index;
-
-})();
+export { index as default };
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, good find - I'd been wondering about modern syntax there for a while; we should keep that in mind for v3.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think we should look at it for 3.0 👍 Not sure if we need an additional option there, or if we determine it from the browserslist. But definitely worth consideration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this, your comments were very helpful too. Looking good so far!
I might look into the remaining issues myself (plugin-node-resolve, exclude
), but don't hold your breath...
@@ -7,4 +7,4 @@ var index = _ => { | |||
|
|||
return index; | |||
|
|||
}()); | |||
})(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting, I wonder why (but don't have the heart to research it now)
@@ -93,22 +93,11 @@ console.log("[\\u2026] ".concat(util)); // eslint-disable-line no-console | |||
filepath: path.resolve(FIXTURES_DIR, "./dist/bundle.js"), | |||
/* eslint-disable max-len */ | |||
content: makeBundle(` | |||
function createCommonjsModule(fn, basedir, module) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So for me this looks like they simplified the generation of CommonJS Modules. Instead of injecting the code to generate the module, instead, they generate the module at built time.
When updating
When updating to 13.1.3 (the latest at point of writing), we get this error instead:
|
Okay, summing up:
As we say in German, right now "bin ich mit meinem Latein am Ende". I don't know enough about both the diskless as well as the node-resolve Plugin. My vote would be: What do you think, @FND? |
d140ff5
to
0fb9a6a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added minor tweaks to CI files (file extensions, aesthetics, actions' versions) - ran out of time for now, so will do an explanatory squash commit and release some other time
squashed as f3230c7 and released as v2.1.8 - thank you very much! |
You're welcome 🙇 |
Updated the Github Actions, because they were using ancient Node versions. After that, I noticed that some tests are still failing. Some dependencies have changed their output. To decrease duplicated work, I updated all dependencies before doing adjustments. Everything is up to date now except
@rollup/plugin-node-resolve
, which breaks everything in a non-obvious and non-documented way. So I moved that to "later".