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

Duplicate <script> tags for the shared chunks #5883

Closed
3 tasks done
kristw opened this issue Sep 13, 2018 · 0 comments · Fixed by #5890
Closed
3 tasks done

Duplicate <script> tags for the shared chunks #5883

kristw opened this issue Sep 13, 2018 · 0 comments · Fixed by #5890

Comments

@kristw
Copy link
Contributor

kristw commented Sep 13, 2018

Make sure these boxes are checked before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if any
  • I have reproduced the issue with at least the latest released version of superset
  • I have checked the issue tracker for the same issue and I haven't found one similar

Superset version

Master

Expected results

One <script> tag for each chunk.

Actual results

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 on the top of the page.

<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 times.

Steps to reproduce

Open Superset, view source.

@kristw kristw changed the title Duplicate <script> tags for the shared chunks Duplicate <script> tags for the shared chunks Sep 13, 2018
williaster pushed a commit that referenced this issue Sep 19, 2018
* Fix adding duplicate script tags.

* add more empty lines

* rename function
mistercrunch pushed a commit to lyft/incubator-superset that referenced this issue Sep 21, 2018
* Fix adding duplicate script tags.

* add more empty lines

* rename function

(cherry picked from commit 325e7c0)
(cherry picked from commit 4faee7b)
mistercrunch pushed a commit to lyft/incubator-superset that referenced this issue Sep 21, 2018
* Fix adding duplicate script tags.

* add more empty lines

* rename function

(cherry picked from commit 325e7c0)
mistercrunch pushed a commit to lyft/incubator-superset that referenced this issue Sep 21, 2018
* Fix adding duplicate script tags.

* add more empty lines

* rename function

(cherry picked from commit 325e7c0)
(cherry picked from commit 4faee7b)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this issue Oct 11, 2018
* Fix adding duplicate script tags.

* add more empty lines

* rename function

(cherry picked from commit 325e7c0)
(cherry picked from commit 4faee7b)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this issue Oct 12, 2018
* Fix adding duplicate script tags.

* add more empty lines

* rename function
betodealmeida pushed a commit to lyft/incubator-superset that referenced this issue Oct 12, 2018
* Fix adding duplicate script tags.

* add more empty lines

* rename function

(cherry picked from commit 325e7c0)
(cherry picked from commit 4faee7b)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this issue Oct 12, 2018
* Fix adding duplicate script tags.

* add more empty lines

* rename function

(cherry picked from commit 325e7c0)
(cherry picked from commit 4faee7b)
youngyjd pushed a commit to lyft/incubator-superset that referenced this issue Oct 17, 2018
* Fix adding duplicate script tags.

* add more empty lines

* rename function

(cherry picked from commit 325e7c0)
(cherry picked from commit 4faee7b)
youngyjd pushed a commit to lyft/incubator-superset that referenced this issue Oct 17, 2018
* Fix adding duplicate script tags.

* add more empty lines

* rename function

(cherry picked from commit 325e7c0)
(cherry picked from commit 4faee7b)
youngyjd pushed a commit to lyft/incubator-superset that referenced this issue Oct 17, 2018
* Fix adding duplicate script tags.

* add more empty lines

* rename function

(cherry picked from commit 325e7c0)
(cherry picked from commit 4faee7b)
youngyjd pushed a commit to lyft/incubator-superset that referenced this issue Oct 17, 2018
* Fix adding duplicate script tags.

* add more empty lines

* rename function

(cherry picked from commit 325e7c0)
(cherry picked from commit 4faee7b)
mistercrunch pushed a commit to lyft/incubator-superset that referenced this issue Oct 29, 2018
* Fix adding duplicate script tags.

* add more empty lines

* rename function

(cherry picked from commit 325e7c0)
(cherry picked from commit 4faee7b)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this issue Oct 30, 2018
* Fix adding duplicate script tags.

* add more empty lines

* rename function

(cherry picked from commit 325e7c0)
(cherry picked from commit 4faee7b)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this issue Oct 30, 2018
* Fix adding duplicate script tags.

* add more empty lines

* rename function

(cherry picked from commit 325e7c0)
(cherry picked from commit 4faee7b)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this issue Oct 30, 2018
* Fix adding duplicate script tags.

* add more empty lines

* rename function

(cherry picked from commit 325e7c0)
(cherry picked from commit 4faee7b)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this issue Oct 30, 2018
* Fix adding duplicate script tags.

* add more empty lines

* rename function

(cherry picked from commit 325e7c0)
(cherry picked from commit 4faee7b)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this issue Oct 30, 2018
* Fix adding duplicate script tags.

* add more empty lines

* rename function

(cherry picked from commit 325e7c0)
(cherry picked from commit 4faee7b)
youngyjd pushed a commit to lyft/incubator-superset that referenced this issue Nov 2, 2018
* Fix adding duplicate script tags.

* add more empty lines

* rename function

(cherry picked from commit 325e7c0)
(cherry picked from commit 4faee7b)
youngyjd pushed a commit to lyft/incubator-superset that referenced this issue Nov 2, 2018
* Fix adding duplicate script tags.

* add more empty lines

* rename function

(cherry picked from commit 325e7c0)
(cherry picked from commit 4faee7b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant