threepointone/glamor

How does glamor work with SPA?

Closed this issue · 2 comments

Continuing discussion from:
https://twitter.com/threepointone/status/865900719261364225

I have few question regarding glamor with respect to SPAs (some of them may sound stupid)

  1. As far as I understand, while navigating from PageA to PageB (using something like react-router), the styles from PapeB would get appended and so on so forth. Would this impact performance?
  2. Is there a chance for FOUT between page transitions (specifically first time) while using code-splitting based on routes?
  1. Nope, you should be fine. Glamor handles deduping, fast style insertion via insertRule in prod, etc.
  2. Nope, should be fine. Glamor operates syncly, so the rules are available before the dom nodes are on the page. The exception is SSR stuff, for which you'll need to insert rules in head via https://github.com/threepointone/glamor/blob/master/docs/server.md

Closing, feel free to continue conversation