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

perf: Apply static parts optimization to dynamic style #4084

Merged
merged 9 commits into from
Mar 20, 2024

Conversation

jmsjtu
Copy link
Member

@jmsjtu jmsjtu commented Mar 20, 2024

Details

This PR expands the static content optimization to include dynamic styles as part of #3624.

The PR is broken into parts to more easily review:

  1. 42ec679 - code changes
  2. 83502a8 - template compiler fixtures
  3. b9428d1 - engine-server tests
  4. bea43ea - karma tests
  5. 6b7f9c1 - hydration tests

Does this pull request introduce a breaking change?

  • 😮‍💨 No, it does not introduce a breaking change.

Does this pull request introduce an observable change?

  • 🤞 No, it does not introduce an observable change.

GUS work item

Select Row Checkbox
W-14560941

@jmsjtu jmsjtu requested a review from a team as a code owner March 20, 2024 05:11
Comment on lines 151 to +152
);
if (data.style && !isString(data.style)) {
logError(
`Invalid 'style' attribute passed to <${sel}> is ignored. This attribute must be a string value.`,
vmBeingRendered
);
}

Copy link
Member Author

@jmsjtu jmsjtu Mar 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ended up moving this check into the patchStyleAttribute routine instead because there isn't a straight-forward way to retrieve the tag name inside the st function.

I've added a test to ensure it provides the same results.

Copy link
Collaborator

@nolanlawson nolanlawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jmsjtu jmsjtu merged commit 675655f into master Mar 20, 2024
9 checks passed
@jmsjtu jmsjtu deleted the jtu/static-content-optimization-style branch March 20, 2024 21:17
@jmsjtu jmsjtu mentioned this pull request Mar 27, 2024
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