-
Notifications
You must be signed in to change notification settings - Fork 47.3k
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
Bug: react-dom-webpack-server
bundles are currently broken on main
#26443
Comments
Do we actually know that it should show up? Is there an observable difference in behavior, or does Rollup correctly eliminate unused code? |
I haven't tried to trace the usage of that code in the If I look at what seems to be an equivalent section of one of the prod bundles, I see: "allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(
function(a){new y(a,3,!1,a.toLowerCase(),null,!1,!1)
})
;["checked","multiple","muted","selected"].forEach(
function(a){new y(a,3,!0,a,null,!1,!1)
}); Which looks like it is that same code, with no assignment statement (ie, the |
Yeah but the question is whether that |
Here's a copy of the "fixed" dev bundle from one of my local builds: react-server-dom-webpack-server.browser.development-fixed.zip Looking at it, the
and I don't see any other references to So, it does seem like all of the Given that, this may not actually be a true bug in terms of behavior. Not sure what the right answer here is, then. I guess adding an extra plugin just to fix the output isn't necessary if it's not going to result in a difference in behavior, but it also seems odd to have seemingly-incorrect bundle output and leave that extra dead logic in the bundles 🤷♂️ |
Is the output incorrect or insufficiently optimized? If it's not being stripped out, that's something that would be good to fix, but it's not the same as it being broken. The problematic part here might be convoluted metaprogramming we do in |
Yeah, after inspecting the bundles, I would say that it's just that they're "insufficiently optimized". It does seem like there's a Rollup bug in that it should either leave in all of |
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment! |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you! |
React version: N/A (Build tooling issue on
main
as of commit0131d0c
)Steps To Reproduce
yarn build
build/oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js
var reservedProps =
. Compare withreact-dom-bindings/src/shared/DOMProperty.js
. Note that:properties
object in the build outputproperties[name] = new PropertyInfoRecord(....)
are missing the assignment, and only saynew PropertyInfoRecord()
const RESERVED = 0
are also missingThis appears to be a bug in Rollup's tree-shaking behavior. If the Rollup config in
build.js
is modified to saymoduleSideEffects: 'safest'
, the missing content appears in these bundles.Per experimentation, this can be addressed by adding a custom Rollup plugin that specifically tells Rollup "this code has side effects, don't tree-shake it" (based on rollup/rollup#4090 (comment) ):
Link to code example:
The current behavior
The full code from
DOMProperty.js
does not show up in thosereact-dom-webpack-server
bundlesThe expected behavior
The
DOMProperty
output should show up.The text was updated successfully, but these errors were encountered: