-
-
Notifications
You must be signed in to change notification settings - Fork 593
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
feat(commonjs)!: default strictRequires to true #1639
feat(commonjs)!: default strictRequires to true #1639
Conversation
@bluwy checking in on this one |
There's not much left on my end, I'm waiting for feedback on this:
|
I will have a look. So far, I already identified one issue with handling moduleSideEffects: In a wrapped module, it does not have any effect due to the wrapping. Instead, we need to precede every call to the require function with a pure comment if it would be false. I will see if I can make it work. |
2c9254b
to
62bdd49
Compare
7aa06b2
to
dc6a4d8
Compare
While the error message has a different variable name, the point of the test is that we get an error.
Unfortunately, I did not find a way to detect this case from the plugin and show a warning.
…om wrapped CommonJS
Hi @bluwy. I looked at all test problems and there were indeed a few things I found. I hope I sufficiently addressed all of them:
|
…ed wrapped modules
4f89682
to
3d78403
Compare
Thanks! I'm not too familiar with the commonjs plugin internals, so I appreciate your help taking a look 🙏 The commit messages were helpful and the changes make sense to me. I don't have any more changes from my end, so with your changes in I think the PR should be good to go now. |
@bluwy would you be up for correcting the conflict with that test snapshot? |
I updated the branch which updates |
No problem 👍 Just updated it again. About #1618, I think we discussed that it's technically a bug fix but could be breaking enough that it would be safer in a major, but I noticed it's already automatically released as a patch. Just flagging, not sure if it's something we need to concern about. |
Damn. This is why we have several indicators. I missed that part of the conversation. |
fwiw I reverted that, and then cherry-picked the commit onto master, and then merged this. I'll manually update the changelog after this is released. |
Thanks for handling it! |
No worries. Appreciate the patience around these PRs. |
Rollup Plugin Name:
commonjs
This PR contains:
Are tests included?
Breaking Changes?
If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking. (NOTE: I've forgot to do this in my first commit)
List any relevant issue numbers: #1425
resolves #1425
additional discussion: #1618 (review)
Description
Changes the
strictRequires
option default from"auto"
totrue
, based on the suggestion at #1425 (comment). This helps resolve race conditions that causes circular import detection to fail, and helps ensure the build hash is consistent.Commit explanation:
I've committed 3rd and 4th separately to view what 4th had fixed. I'd like an eye on the fails in the 3rd commit because I think it revealed some issues with defaulting to
true
now.IMO the fact that
true
and"auto"
have different exported outputs makes me a bit worried of this change. Or maybe I'm missing something.