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)
Fri, Nov 22, 5:27 PM
Unknown Object (File)
Fri, Nov 22, 4:29 PM
Unknown Object (File)
Fri, Nov 22, 4:28 PM
Unknown Object (File)
Fri, Nov 22, 4:07 PM
Unknown Object (File)
Fri, Nov 22, 11:31 AM
Unknown Object (File)
Sun, Nov 10, 10:40 PM
Unknown Object (File)
Tue, Nov 5, 7:17 AM
Unknown Object (File)
Sun, Nov 3, 1:19 PM

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
Branch
master
Lint
No Lint Coverage
Unit
No Test Coverage

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