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

[bugfix] De-dup <script> tags. #5883 #5890

Merged
merged 3 commits into from
Sep 19, 2018

Conversation

kristw
Copy link
Contributor

@kristw kristw commented Sep 13, 2018

This fixes #5883

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.xxx.chunk.js

@john-bodley @mistercrunch @graceguo-supercat @michellethomas

@kristw kristw changed the title Fix adding duplicate script tags. #5883 De-dup <script> tags. #5883 Sep 13, 2018
@kristw kristw changed the title De-dup <script> tags. #5883 [bugfix] De-dup <script> tags. #5883 Sep 13, 2018
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.

thanks for addressing this, looks like a nice solution for the issue 👍

@kristw
Copy link
Contributor Author

kristw commented Sep 18, 2018

I have tested and it does what I expected. However, I am less familiar with Flask App Builder, so would be great to have some Python eye on to verify if I didn't mess anything up.

A few questions:

  • Is it OK to define a variable loaded_chunks for each page this way?
  • I expect the template to be compiled from top to bottom so the set loaded_chunks is updated in correct order. Is this a correct assumption?

@@ -69,12 +69,21 @@ def get_css_manifest_files(filename):
return entry_files.get('css', [])


def filter_loaded_chunks(files, loaded_chunks):
Copy link
Member

Choose a reason for hiding this comment

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

I find the name a little confusing, i.e., you’re returning the unloaded chunks, maybe something like get_unloaded_chunks makes more sense.

@kristw
Copy link
Contributor Author

kristw commented Sep 18, 2018

Addressed @john-bodley 's comment. Now wait for dear CI. 😃

@codecov-io
Copy link

Codecov Report

Merging #5890 into master will increase coverage by 0.04%.
The diff coverage is 80%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5890      +/-   ##
==========================================
+ Coverage   63.66%   63.71%   +0.04%     
==========================================
  Files         386      386              
  Lines       23538    23543       +5     
  Branches     2628     2628              
==========================================
+ Hits        14986    15000      +14     
+ Misses       8539     8530       -9     
  Partials       13       13
Impacted Files Coverage Δ
superset/__init__.py 73.38% <80%> (+0.27%) ⬆️
superset/connectors/sqla/models.py 81.13% <0%> (+0.75%) ⬆️
superset/db_engine_specs.py 55.45% <0%> (+0.87%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 19a3319...c27621f. Read the comment docs.

@kristw
Copy link
Contributor Author

kristw commented Sep 18, 2018

Ready to merge 🚀

@mistercrunch
Copy link
Member

Jinja templates are executed top-to-bottom, yes, though python set() are unordered.

@williaster williaster merged commit 325e7c0 into apache:master Sep 19, 2018
@kristw kristw deleted the kristw-duplicate-script branch September 19, 2018 15:45
mistercrunch pushed a commit to lyft/incubator-superset that referenced this pull request 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 pull request 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 pull request 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 pull request 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 pull request 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 pull request 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 pull request 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 pull request 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 pull request 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 pull request 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 pull request 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 pull request 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 pull request 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 pull request 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 pull request 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 pull request 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 pull request 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 pull request 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 pull request Nov 2, 2018
* Fix adding duplicate script tags.

* add more empty lines

* rename function

(cherry picked from commit 325e7c0)
(cherry picked from commit 4faee7b)
@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 🚢 0.28.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicate <script> tags for the shared chunks
5 participants