-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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(remix-react): Remove nullish coalescing operator #4561
Conversation
🦋 Changeset detectedLatest commit: 08c8848 The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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 don't think we should make this change like this tbh.
We're supporting Node v14+, so nullish coalescing should be possible to write without any problems.
In case of the older browser being broken, this is a matter of broken transpiling, most likely not taking these versions into account in browserslist
Will happily update the PR if there's a better way to do it. Could you set me on the right track to fix the transpilling part? |
@machour I think I once saw a discussion about supporting a |
Gotcha. Leaving this as it is for the meantime. It was working, it's not anymore, so we may want to fix this first, then look at changing the way we do things. |
If this only changed recently, this can be a bug introduced when @pcattori extracted browser+server compiler out of the massive compiler we had before. 🤔 Could be a totally different thing as well, I just know that we had some work done there 🤷♂️ |
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.
Until browserlist is supported I think this one line change it’s simpler and can help a lot of people support older browsers with ESM support
I'm going to merge this for now, but we'll prioritize a strategy for dealing with this to prevent regressions over the next week. |
The compiler code never makes it into the browser, so nullish coalescing is fine in compiler / server-only code. I agree that we should allow Node v14 features like nullish coalescing in our codebase and just transpile them away for the browser build. |
🤖 Hello there, We just published version Thanks! |
Closes: #
Testing Strategy:
I was testing my app with an iPhone 6, and found out the client side was totally broken.
We had a discussion with @sergiodxa a few days ago where we uncovered that we re-introduced a nullish coalescing operator
??
in #3697 that could be problematic for old browsers.I can now confirm that it is indeed problematic. 🙃
This PR gets rid of it.