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

Support for inline style attributes and inline scripts in SVG #6797

Merged
merged 3 commits into from Sep 2, 2021

Conversation

devongovett
Copy link
Member

This adds support for inline style attributes in SVG, along with inline <script> tags. It also inserts sibling styles and scripts when a JS file references CSS, or a shared bundle is produced. It works pretty much the same way as for HTML, but tweaked for SVG including handling XML escaping.

@height
Copy link

height bot commented Aug 28, 2021

Link Height tasks by mentioning a task ID in the pull request title or description, commit messages, or comments.

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

@devongovett devongovett changed the title Support for inline style attributes and scripts in SVG Support for inline style attributes and inline scripts in SVG Aug 28, 2021
@parcel-benchmark
Copy link

parcel-benchmark commented Aug 28, 2021

Benchmark Results

Kitchen Sink ✅

Timings

Description Time Difference
Cold 2.15s +4.00ms
Cached 333.00ms +4.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

Bundle Size Difference Time Difference
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 93.00ms -544.00ms 🚀
dist/legacy/parcel.7cdb0fad.webp 102.94kb +0.00b 94.00ms -544.00ms 🚀
dist/modern/parcel.7cdb0fad.webp 102.94kb +0.00b 93.00ms -544.00ms 🚀

React HackerNews ✅

Timings

Description Time Difference
Cold 10.87s +53.00ms
Cached 509.00ms +6.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

AtlasKit Editor ✅

Timings

Description Time Difference
Cold 1.23m +946.00ms
Cached 1.79s -4.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/index.1e2ec906.js 1.77mb -2.00b 🚀 21.08s +177.00ms
dist/index.122d27ac.js 694.59kb +15.00b ⚠️ 57.00s +1.14s

Cached Bundles

Bundle Size Difference Time Difference
dist/index.44db039e.js 1.77mb +4.00b ⚠️ 21.33s -163.00ms
dist/heading4.62b9719b.js 1.25kb +0.00b 23.06s -12.43s 🚀

Three.js ✅

Timings

Description Time Difference
Cold 7.60s -103.00ms
Cached 394.00ms -30.00ms 🚀

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

Click here to view a detailed benchmark overview.

@devongovett devongovett merged commit 22da4b1 into v2 Sep 2, 2021
@devongovett devongovett deleted the svg-inline-script branch September 2, 2021 04:02
lettertwo added a commit that referenced this pull request Sep 10, 2021
* v2: (69 commits)
  Use yarnpkg registry for all the things (#6908)
  Fix issue about loading configs from tsconfig.json (#6881)
  Add `@section` to Compressor type (#6885)
  Parcel API improvements (#6866)
  Use stream-browserify for polyfilling instead (#6863)
  Add support for compressor plugins (#6776)
  Support for inline style attributes and inline scripts in SVG (#6797)
  Bump less (#6852)
  Make sure (non-React) SVGs are in separate bundles (#6757)
  Add support for injecting manifest into service workers (#6798)
  Fix 'does not export default' error with scope hoisting and url/worklet pipeline (#6803)
  Remaining cargo clippy fixes (#6829)
  Lazily install sharp only when needed (#6816)
  More cargo clippy suggestions (#6811)
  Don't emit runtime manifest for inline child bundles (#6807)
  Apply suggestions from rust-clippy (#6256)
  Fix add directoryExists function to matchFiles call. (#6784)
  Upgrade to Flow 158 (#6763)
  Revert "added cio headers (#6404)" (#6789)
  Process CSS in SVGs (#6743)
  ...
lettertwo added a commit that referenced this pull request Sep 10, 2021
* v2: (38 commits)
  Use yarnpkg registry for all the things (#6908)
  Fix issue about loading configs from tsconfig.json (#6881)
  Add `@section` to Compressor type (#6885)
  Parcel API improvements (#6866)
  Use stream-browserify for polyfilling instead (#6863)
  Add support for compressor plugins (#6776)
  Support for inline style attributes and inline scripts in SVG (#6797)
  Bump less (#6852)
  Make sure (non-React) SVGs are in separate bundles (#6757)
  Add support for injecting manifest into service workers (#6798)
  Fix 'does not export default' error with scope hoisting and url/worklet pipeline (#6803)
  Remaining cargo clippy fixes (#6829)
  Lazily install sharp only when needed (#6816)
  More cargo clippy suggestions (#6811)
  Don't emit runtime manifest for inline child bundles (#6807)
  Apply suggestions from rust-clippy (#6256)
  Fix add directoryExists function to matchFiles call. (#6784)
  Upgrade to Flow 158 (#6763)
  Revert "added cio headers (#6404)" (#6789)
  Process CSS in SVGs (#6743)
  ...
lettertwo added a commit that referenced this pull request Sep 11, 2021
* bdo/number-edgetypes: (70 commits)
  Use yarnpkg registry for all the things (#6908)
  Fix issue about loading configs from tsconfig.json (#6881)
  Add `@section` to Compressor type (#6885)
  Parcel API improvements (#6866)
  Use stream-browserify for polyfilling instead (#6863)
  Add support for compressor plugins (#6776)
  Support for inline style attributes and inline scripts in SVG (#6797)
  Bump less (#6852)
  Make sure (non-React) SVGs are in separate bundles (#6757)
  Add support for injecting manifest into service workers (#6798)
  Fix 'does not export default' error with scope hoisting and url/worklet pipeline (#6803)
  Remaining cargo clippy fixes (#6829)
  Lazily install sharp only when needed (#6816)
  More cargo clippy suggestions (#6811)
  Don't emit runtime manifest for inline child bundles (#6807)
  Apply suggestions from rust-clippy (#6256)
  Fix add directoryExists function to matchFiles call. (#6784)
  Upgrade to Flow 158 (#6763)
  Revert "added cio headers (#6404)" (#6789)
  Process CSS in SVGs (#6743)
  ...
lettertwo added a commit that referenced this pull request Sep 13, 2021
* v2: (38 commits)
  Use yarnpkg registry for all the things (#6908)
  Fix issue about loading configs from tsconfig.json (#6881)
  Add `@section` to Compressor type (#6885)
  Parcel API improvements (#6866)
  Use stream-browserify for polyfilling instead (#6863)
  Add support for compressor plugins (#6776)
  Support for inline style attributes and inline scripts in SVG (#6797)
  Bump less (#6852)
  Make sure (non-React) SVGs are in separate bundles (#6757)
  Add support for injecting manifest into service workers (#6798)
  Fix 'does not export default' error with scope hoisting and url/worklet pipeline (#6803)
  Remaining cargo clippy fixes (#6829)
  Lazily install sharp only when needed (#6816)
  More cargo clippy suggestions (#6811)
  Don't emit runtime manifest for inline child bundles (#6807)
  Apply suggestions from rust-clippy (#6256)
  Fix add directoryExists function to matchFiles call. (#6784)
  Upgrade to Flow 158 (#6763)
  Revert "added cio headers (#6404)" (#6789)
  Process CSS in SVGs (#6743)
  ...
lettertwo added a commit that referenced this pull request Sep 13, 2021
* bdo/number-edgetypes: (70 commits)
  Use yarnpkg registry for all the things (#6908)
  Fix issue about loading configs from tsconfig.json (#6881)
  Add `@section` to Compressor type (#6885)
  Parcel API improvements (#6866)
  Use stream-browserify for polyfilling instead (#6863)
  Add support for compressor plugins (#6776)
  Support for inline style attributes and inline scripts in SVG (#6797)
  Bump less (#6852)
  Make sure (non-React) SVGs are in separate bundles (#6757)
  Add support for injecting manifest into service workers (#6798)
  Fix 'does not export default' error with scope hoisting and url/worklet pipeline (#6803)
  Remaining cargo clippy fixes (#6829)
  Lazily install sharp only when needed (#6816)
  More cargo clippy suggestions (#6811)
  Don't emit runtime manifest for inline child bundles (#6807)
  Apply suggestions from rust-clippy (#6256)
  Fix add directoryExists function to matchFiles call. (#6784)
  Upgrade to Flow 158 (#6763)
  Revert "added cio headers (#6404)" (#6789)
  Process CSS in SVGs (#6743)
  ...
lettertwo added a commit that referenced this pull request Sep 13, 2021
* v2: (42 commits)
  Remove dead link to docs in diagnostic (#6913)
  Fix engines.parcel in SVG packager (#6911)
  Use imported Readable flow type instead of global (#6910)
  Use non-deprecated SVGO options in HTMLNanoOptimizer (#6785)
  Use yarnpkg registry for all the things (#6908)
  Fix issue about loading configs from tsconfig.json (#6881)
  Add `@section` to Compressor type (#6885)
  Parcel API improvements (#6866)
  Use stream-browserify for polyfilling instead (#6863)
  Add support for compressor plugins (#6776)
  Support for inline style attributes and inline scripts in SVG (#6797)
  Bump less (#6852)
  Make sure (non-React) SVGs are in separate bundles (#6757)
  Add support for injecting manifest into service workers (#6798)
  Fix 'does not export default' error with scope hoisting and url/worklet pipeline (#6803)
  Remaining cargo clippy fixes (#6829)
  Lazily install sharp only when needed (#6816)
  More cargo clippy suggestions (#6811)
  Don't emit runtime manifest for inline child bundles (#6807)
  Apply suggestions from rust-clippy (#6256)
  ...
lettertwo added a commit that referenced this pull request Sep 13, 2021
* v2: (42 commits)
  Remove dead link to docs in diagnostic (#6913)
  Fix engines.parcel in SVG packager (#6911)
  Use imported Readable flow type instead of global (#6910)
  Use non-deprecated SVGO options in HTMLNanoOptimizer (#6785)
  Use yarnpkg registry for all the things (#6908)
  Fix issue about loading configs from tsconfig.json (#6881)
  Add `@section` to Compressor type (#6885)
  Parcel API improvements (#6866)
  Use stream-browserify for polyfilling instead (#6863)
  Add support for compressor plugins (#6776)
  Support for inline style attributes and inline scripts in SVG (#6797)
  Bump less (#6852)
  Make sure (non-React) SVGs are in separate bundles (#6757)
  Add support for injecting manifest into service workers (#6798)
  Fix 'does not export default' error with scope hoisting and url/worklet pipeline (#6803)
  Remaining cargo clippy fixes (#6829)
  Lazily install sharp only when needed (#6816)
  More cargo clippy suggestions (#6811)
  Don't emit runtime manifest for inline child bundles (#6807)
  Apply suggestions from rust-clippy (#6256)
  ...
lettertwo added a commit that referenced this pull request Sep 13, 2021
* bdo/number-edgetypes: (74 commits)
  Remove dead link to docs in diagnostic (#6913)
  Fix engines.parcel in SVG packager (#6911)
  Use imported Readable flow type instead of global (#6910)
  Use non-deprecated SVGO options in HTMLNanoOptimizer (#6785)
  Use yarnpkg registry for all the things (#6908)
  Fix issue about loading configs from tsconfig.json (#6881)
  Add `@section` to Compressor type (#6885)
  Parcel API improvements (#6866)
  Use stream-browserify for polyfilling instead (#6863)
  Add support for compressor plugins (#6776)
  Support for inline style attributes and inline scripts in SVG (#6797)
  Bump less (#6852)
  Make sure (non-React) SVGs are in separate bundles (#6757)
  Add support for injecting manifest into service workers (#6798)
  Fix 'does not export default' error with scope hoisting and url/worklet pipeline (#6803)
  Remaining cargo clippy fixes (#6829)
  Lazily install sharp only when needed (#6816)
  More cargo clippy suggestions (#6811)
  Don't emit runtime manifest for inline child bundles (#6807)
  Apply suggestions from rust-clippy (#6256)
  ...
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

3 participants