🚀 [Story performance] Rewrite styles only on desktop one-panel or bot rendering#36692
Merged
mszylkowski merged 9 commits intoampproject:mainfrom Nov 3, 2021
Merged
Conversation
|
Hey @gmajoulet, @newmuis! These files were changed: |
gmajoulet
approved these changes
Nov 1, 2021
Contributor
gmajoulet
left a comment
There was a problem hiding this comment.
can you revert the package-lock changes before submitting?
…lacementOnDektopOnly
…lacementOnDektopOnly
rileyajones
pushed a commit
to rileyajones/amphtml
that referenced
this pull request
Nov 4, 2021
… rendering (ampproject#36692) * rewrite styles only on desktop * Updated package-lock * Change naming of variable * Reverted package lock * Reverted package lock for real * Added newline to package json
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.
Closes #36660
The
vw/vh/vmin/vmaxvalues in mobile match thestory-page-vw/vh/vmin/vmaxvalues on mobile, so we don't need to replace them (on mobile or full-bleed desktop). We will replace then only on one-panel and on vertical-rendering (because the height of the page is not 100vh).Note that the regex function now runs about 30-40% faster (
/(-?[\d.]+)v(w|h|min|max)/gim) due to the condensed group matching instead of the chained replaces, and makes the JS bundle a bit smaller.