Add ability to require explicit load of ReactiveHTML extension #3254
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 withpn.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.