Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CSS theme flickering on FAB pages #5880

Merged
merged 1 commit into from Sep 13, 2018

Conversation

mistercrunch
Copy link
Member

Since the recent PRs around webpack 4 and reloading, FAB pages have been
flickering on load, where a themeless Superset is shown for a fraction
of a second until the bootstrap theme gets loaded up.

This addresses it by moving the theme JS to the head section of the html
page.

related to #5813

@williaster @kristw @betodealmeida

Since the recent PRs around webpack 4 and reloading, FAB pages have been
flickering on load, where a themeless Superset is shown for a fraction
of a second until the bootstrap theme gets loaded up.

This addresses it by moving the theme JS to the head section of the html
page.
Copy link
Contributor

@williaster williaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! I just started noticing this.

lgtm

@kristw
Copy link
Contributor

kristw commented Sep 12, 2018

Since you are at this. There is another issue about the entry point. Right now there are duplicate <script> tags for the shared chunks. If you view page source, there will be multiple vendors-addSlice-common-dashboard-explore-profile-sqllab-theme-welcome.0fe210d7.chunk.js

For example in the head_js

<script src="/static/assets/dist/vendors-addSlice-common-dashboard-explore-profile-sqllab-theme-welcome.0fe210d7.chunk.js"></script>
<script src="/static/assets/dist/vendors-dashboard-explore-profile-sqllab-theme-welcome.0fe210d7.chunk.js"></script>
<script src="/static/assets/dist/theme.0fe210d7.entry.js"></script>

<script src="/static/assets/dist/vendors-addSlice-common-dashboard-explore-profile-sqllab-theme-welcome.0fe210d7.chunk.js"></script>
<script src="/static/assets/dist/vendors-addSlice-common-dashboard-explore-profile-sqllab-welcome.0fe210d7.chunk.js"></script>
<script src="/static/assets/dist/addSlice-common-dashboard-explore-profile-sqllab-welcome.0fe210d7.chunk.js"></script>
<script src="/static/assets/dist/common.0fe210d7.entry.js"></script>

Because each entry in the js manifest lists an array of chunks each entry point needs, independent of other entry points. When we render this directly to FAB template, it does not de-dup.

XHR Performance-wise not too bad as browser only fetches and parses once, but for correctness, if the chunk executes something, it executes multiple time.

I can open a separate issue if you think this is too big.

@mistercrunch mistercrunch added the !deprecated-label:bug Deprecated label - Use #bug instead label Sep 12, 2018
@mistercrunch
Copy link
Member Author

I'll just land this for now as my goal was just to get rid of the flickering.

@mistercrunch mistercrunch merged commit 80faa8d into apache:master Sep 13, 2018
@mistercrunch mistercrunch deleted the fix_theme_css branch September 13, 2018 00:21
kristw pushed a commit to kristw/incubator-superset that referenced this pull request Sep 18, 2018
Since the recent PRs around webpack 4 and reloading, FAB pages have been
flickering on load, where a themeless Superset is shown for a fraction
of a second until the bootstrap theme gets loaded up.

This addresses it by moving the theme JS to the head section of the html
page.

(cherry picked from commit 80faa8d)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 12, 2018
Since the recent PRs around webpack 4 and reloading, FAB pages have been
flickering on load, where a themeless Superset is shown for a fraction
of a second until the bootstrap theme gets loaded up.

This addresses it by moving the theme JS to the head section of the html
page.
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
Since the recent PRs around webpack 4 and reloading, FAB pages have been
flickering on load, where a themeless Superset is shown for a fraction
of a second until the bootstrap theme gets loaded up.

This addresses it by moving the theme JS to the head section of the html
page.
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.28.0 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels !deprecated-label:bug Deprecated label - Use #bug instead 🚢 0.28.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants