erikras / erikras/react-redux-universal-hot-example

Styles are loaded after JS, causing annoying visual glitches.

Open
#818 6 comments 0 reactions 0 assignees View on GitHub
needs info
Dominant language
JavaScript
Stars
12.1k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

Hey,

It seems like JS is loaded before CSS files, so the flow ends as:

1) Some html is rendered in server side.
2) Html is displayed to user.
3) JS is loaded (this may take a while)
4) CSS generated form 'scss imports' gets downloaded and applied.

The delay between 3-4 causes a small UI glitch until styles are applied to the server side generated html,

Is there a way to load CSS files before JS to avoid this?

Thanks.

Contributor guide

Open the contributing guide

Research direction

Inspect the server-rendered HTML and the webpack asset-loading configuration described in the issue, then trace how the SCSS imports and JavaScript bundles are emitted. Confirm the browser receives and applies CSS before the relevant JavaScript runs, and verify that the initial page no longer shows an unstyled interval.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react, redux, scss, webpack
Domain
build-system, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.