Page MenuHomePhabricator

[landing] added sideEffects to solve node_module CSS (rainbowkit) not being added in production
ClosedPublic

Authored by derek on Sep 23 2022, 11:11 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 14, 11:48 PM
Unknown Object (File)
Thu, Dec 12, 1:06 AM
Unknown Object (File)
Wed, Dec 11, 11:41 AM
Unknown Object (File)
Tue, Dec 10, 10:28 PM
Unknown Object (File)
Wed, Dec 4, 9:37 PM
Unknown Object (File)
Wed, Dec 4, 12:30 PM
Unknown Object (File)
Fri, Nov 29, 10:36 AM
Unknown Object (File)
Tue, Nov 26, 7:01 AM

Details

Summary

RainbowKit's CSS doesn't get bundled in production, because the way they're exposing it is with a sideEffect. Webpack's side effects are basically an infinite black hole, as denoted by this issue that's been open for 4.5 years. more context/explanation on this stack overflow answer

Test Plan

run yarn prod in landing with this diff and RainbowKit experience found on localhost/commlanding/siwe now has more than 0 styles

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Sep 23 2022, 11:13 AM
Harbormaster failed remote builds in B12415: Diff 17035!
derek edited the summary of this revision. (Show Details)
derek edited the summary of this revision. (Show Details)

moved sideEffects to where it belongs

Harbormaster returned this revision to the author for changes because remote builds failed.Sep 23 2022, 11:34 AM
Harbormaster failed remote builds in B12417: Diff 17044!

cleaned up some accidental additions

ashoat requested changes to this revision.Sep 23 2022, 11:50 AM
ashoat added inline comments.
lib/webpack/shared.cjs
138 ↗(On Diff #17045)

I initially added it here. My thinking was that we're scoping the change to apply to just the case where it matters – CSS files being imported from node_modules on prod.

What are the pros / cons of placing it here vs. where you placed it?

This revision now requires changes to proceed.Sep 23 2022, 11:50 AM

final resting place of sideEffects: true

derek added inline comments.
lib/webpack/shared.cjs
138 ↗(On Diff #17045)

i moved it back there, i think scoping to where it matters makes more sense

This revision is now accepted and ready to land.Sep 23 2022, 12:54 PM