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

Rework handling of non-root <script> and <style> #1163

Merged
merged 5 commits into from
Feb 9, 2018
Merged

Conversation

Conduitry
Copy link
Member

In practical terms, this fixes hydration of non-root <script> and <style>, and also fixes tag interpolation in non-root <style> (#1147). This supersedes other previous PRs I'd opened.

This switches non-root <script> and <style> back to being parsed as regular elements containing one child Text node (in the case of <script>) and one or more Text or Tag nodes (in the case of <style>). There are also some other changes to make sure we don't escape HTML special characters in DOM or SSR mode for the Text nodes inside non-root <script> and <style> elements.

@codecov-io
Copy link

codecov-io commented Feb 8, 2018

Codecov Report

Merging #1163 into master will increase coverage by 0.19%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1163      +/-   ##
==========================================
+ Coverage   91.51%   91.71%   +0.19%     
==========================================
  Files         126      126              
  Lines        4526     4536      +10     
  Branches     1462     1465       +3     
==========================================
+ Hits         4142     4160      +18     
+ Misses        163      158       -5     
+ Partials      221      218       -3
Impacted Files Coverage Δ
...nerators/server-side-rendering/visitors/Element.ts 91.42% <ø> (+4.94%) ⬆️
src/parse/state/tag.ts 96.36% <100%> (+2.73%) ⬆️
src/generators/nodes/Element.ts 95.09% <100%> (+0.65%) ⬆️
.../generators/server-side-rendering/visitors/Text.ts 100% <100%> (ø) ⬆️

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 0ef8229...7d51484. Read the comment docs.

@Rich-Harris Rich-Harris merged commit 90f6f66 into master Feb 9, 2018
@Rich-Harris Rich-Harris deleted the non-root-rework branch February 9, 2018 13:22
@Rich-Harris
Copy link
Member

awesome 👍

@Conduitry
Copy link
Member Author

Heh I pushed one more fix to this branch riiiiight after you merged it, so I just went ahead and committed it right to master.

@Rich-Harris
Copy link
Member

Cool — looks like I'd already pulled it before I cut the new release

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.

3 participants