Replies: 1 comment
-
In the early days, we had plenty of budget, so the rule was, "no duplication." As things have evolved, I would pivot to: "If it's not needed to get to LCP, it doesn't go in utils.js" Even things like the deferred function, some of the random utils at the bottom (intersection observer, etc.) should be kicked out. I would even argue that none of our typical LCP blocks use Nexter (Milo, but for Experience Cloud apps) follows this model if you want to pull inspiration from it. If I was in your shoes, I would find budget to include those functions in setConfig by removing some stuff that should not be in utils. Low hanging fruit:
|
Beta Was this translation helpful? Give feedback.
-
have we thought about a rule for some code to go to utils?
is it "no duplication"?
is it "no duplication in code that is loaded a lot"?
something else?
use case as an example:
i'm staring at that moment at those two simple methods from gnav:
that i would love to have for a promotion use case (in promo-utils). That's 84 bytes (i didn't count) i could just copy and paste, but it feels wrong somehow. At the same time amending gnav, utils, importing it feels a bit scary too.
wdyt?
Beta Was this translation helpful? Give feedback.
All reactions