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)
Thu, May 16, 8:44 AM
Unknown Object (File)
Tue, May 14, 10:08 AM
Unknown Object (File)
Tue, May 14, 9:09 AM
Unknown Object (File)
Mon, May 13, 6:30 PM
Unknown Object (File)
Sun, May 12, 11:07 PM
Unknown Object (File)
Sun, May 12, 12:59 AM
Unknown Object (File)
Sat, May 11, 8:14 PM
Unknown Object (File)
Fri, May 10, 1:09 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
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