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

Add ability to require explicit load of ReactiveHTML extension #3254

Merged
merged 2 commits into from Mar 23, 2022

Conversation

philippjfr
Copy link
Member

@philippjfr philippjfr commented Mar 23, 2022

Currently any ReactiveHTML component that is imported when the panel extension is run or a server app is served for the first time will be loaded and all its JS/CSS dependencies will be embedded in the page. This isn't really a nice way to handle this problem because it creates a tension between offering helpful namespaces that include all components and reducing the number of external JS/CSS that are included in the page. To get around this we introduce the concept of a ReactiveHTML._extension_name. This, if declared, tells Panel not to load the dependencies for this component unless it has been explicitly loaded with pn.extension(<extension_name>). This replicates the behavior we have long implemented for regular Bokeh models with dependencies we do not want to include by default and which have to be loaded using the panel extension.

@codecov
Copy link

codecov bot commented Mar 23, 2022

Codecov Report

Merging #3254 (2dc98ff) into master (32dc94f) will increase coverage by 0.10%.
The diff coverage is 61.53%.

@@            Coverage Diff             @@
##           master    #3254      +/-   ##
==========================================
+ Coverage   83.03%   83.14%   +0.10%     
==========================================
  Files         195      195              
  Lines       25986    26006      +20     
==========================================
+ Hits        21578    21623      +45     
+ Misses       4408     4383      -25     
Impacted Files Coverage Δ
panel/config.py 60.23% <0.00%> (-0.71%) ⬇️
panel/io/resources.py 82.95% <75.00%> (ø)
panel/reactive.py 77.37% <78.57%> (+0.01%) ⬆️
panel/layout/__init__.py 100.00% <100.00%> (ø)
panel/layout/gridstack.py 52.54% <100.00%> (+52.54%) ⬆️
panel/models/reactive_html.py 80.28% <0.00%> (+0.70%) ⬆️
panel/io/datamodel.py 48.95% <0.00%> (+1.04%) ⬆️

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 32dc94f...2dc98ff. Read the comment docs.

@philippjfr philippjfr merged commit 2819a83 into master Mar 23, 2022
@philippjfr philippjfr deleted the reactive_loading branch March 23, 2022 12:44
@philippjfr philippjfr added this to the v0.13.0 milestone Mar 23, 2022
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 this pull request may close these issues.

None yet

1 participant