-
Notifications
You must be signed in to change notification settings - Fork 21
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
Various small fixes #128
Various small fixes #128
Conversation
Example: (self.webpackChunk_N_E=self.webpackChunk_N_E || []).push([[888],{2189: (e,t,n) => {...} }
If a module re-exports values from another module, Webpack5 would export them as var r = n(645); n.d(t, { foo: () => r.foo }) so this adds member-expressions to the expected possible values
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Can you help to update the test cases accordingly? |
Will do! I was apparently wrong in my assumption regarding the |
I want to know more about the "buggy" part of |
wakaru throwing error. More specifically it was when running I believe it's a bug in the |
These are the lines that the crash originated from: As you can see it assumes that one of |
Do you have a short reproduction? We can also patch |
1e27197
to
aaac27b
Compare
I unfortunately haven't extracted a short reproduction yet, but I have found a simple fix. Constructing a new identifier and using it for both arguments does produce the desired behavior. I'll see if I can make a short reproduction as well. |
I also removed another change that caused test failures. Sorry for not running the tests before sending a PR |
Don't worry. I also updated another iife matching that should be corrected. |
one more thing. Please help to update the commit message from "Fix" to fix. The Changelog tool will be mad about it 🤣 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #128 +/- ##
==========================================
- Coverage 89.33% 89.31% -0.02%
==========================================
Files 100 100
Lines 12308 12316 +8
Branches 1632 1635 +3
==========================================
+ Hits 10995 11000 +5
Misses 1259 1259
- Partials 54 57 +3 ☔ View full report in Codecov by Sentry. |
4ea3c36
to
c4f7ae1
Compare
Haha, done! I also restored the isIIFE fix now that your commit fixed the test failure. |
Here's a minimal reproduction of the bug. It's a combination of the first test case for import { foo as a, bar as b, code } from '_';
console.log(a, b, code);
var _a;
(_a = a) === null || _a === void 0 ? void 0 : _a.b; edit: I would add it as a test, but I don't know how to add tests that requires multiple different transforms |
You can inline combined rules if there is only one test case, or declare it as a variable. wakaru/packages/unminify/src/transformations/__tests__/un-default-parameter.spec.ts Line 5 in e099371
wakaru/packages/unminify/src/transformations/__tests__/un-nullish-coalescing.spec.ts Lines 122 to 125 in e099371
I would recommend you put it at the test of |
bf6c79f
to
cc4a10a
Compare
The scope module crashes when an import dosn't have a local name
More specifically !function(){...}() wasn't matched, only !function(){...} which isn't an IIFE
cc4a10a
to
14c4377
Compare
Thanks for fixing some many issues. 👍 |
Three fixes that prevented code I was working on from being unpacked
fix: Make isIIFE match what it claims to match
More specifically:
wasn't matched, only
which isn't an IIFE
Fix: Remove buggy and redundant transform
No need to remove import
foo as foo
. The desired behaviour happens automatically and other code expects thelocal
field (as foo
) to exist to not crash.will automatically be printed as
without this transform
feat: Allow re-exports from modules in Webpack5
If a module re-exports values from another module,
Webpack5 would export them as
so this adds member-expressions to the expected possible values
feat: Allow Arrow functions in module definitions
Example: