Remove default type="text/javascript" from script tag wrapper#14838
Closed
RamiNoodle733 wants to merge 1 commit intobokeh:branch-3.9from
Closed
Remove default type="text/javascript" from script tag wrapper#14838RamiNoodle733 wants to merge 1 commit intobokeh:branch-3.9from
RamiNoodle733 wants to merge 1 commit intobokeh:branch-3.9from
Conversation
In HTML5, the type="text/javascript" attribute is redundant since JavaScript is the default scripting language. This change removes the default type attribute from the script tag template and makes it conditional - only rendering when explicitly specified. Changes: - Changed default type parameter from "text/javascript" to empty string - Updated template to only render type attribute when non-empty
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## branch-3.9 #14838 +/- ##
=============================================
Coverage ? 91.28%
=============================================
Files ? 291
Lines ? 20997
Branches ? 0
=============================================
Hits ? 19167
Misses ? 1830
Partials ? 0 🚀 New features to boost your workflow:
|
Contributor
|
Before submitting a PR, please create an issue, so that we can discuss the validity of an idea. Given you already submitted a PR, you need to associate an issue with it regardless. |
Contributor
|
There are a lot more cases of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Removes the default
type="text/javascript"attribute from script tag wrapper to follow HTML5 best practices.Problem
In HTML5, the
type="text/javascript"attribute is unnecessary since JavaScript is the default scripting language. Including it adds extra bytes to the HTML output without providing any benefit.Changes
src/bokeh/embed/wrappers.py: Changed defaulttypeparameter from"text/javascript"to empty stringsrc/bokeh/core/_templates/script_tag.html.jinja: Updated template to only render thetypeattribute when it is non-emptyBenefits