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 attributes #4055

Merged
merged 12 commits into from Mar 19, 2024

Conversation

jmsjtu
Copy link
Member

@jmsjtu jmsjtu commented Mar 13, 2024

Details

This is part 1 of 2 to apply static parts optimization to dynamic attributes as part of #3624.

This first PR handles a few minor refactors that modifies several test fixture in the template compiler.

I'm splitting this PR in 2 to make it easier to review.

There main changes in this PR:

  1. Move the parseFragment invocation to happen inside the st function (api_static_fragment).

Does this pull request introduce a breaking change?

  • Yes, CLWR will need a version bump as well since we changed the compiled output for handling fragments.

Does this pull request introduce an observable change?

  • 🔬 Yes, it does include an observable change.

The follow-up PR introduces an observable change in SSR.

GUS work item

W-15174789

@jmsjtu jmsjtu requested a review from a team as a code owner March 13, 2024 19:01
@@ -84,8 +84,9 @@ function ssf(slotName: unknown, factory: (value: any, key: any) => VFragment): V
}

// [st]atic node
function st(fragment: Element, key: Key, parts?: VStaticPart[]): VStatic {
function st(fragmentFactory: () => Element, key: Key, parts?: VStaticPart[]): VStatic {
Copy link
Member Author

Choose a reason for hiding this comment

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

This change is needed in the second PR but causes several changes to the template compiler fixtures, see the test fixtures for details.

@@ -15,7 +15,7 @@ const stc3 = {
function tmpl($api, $cmp, $slotset, $ctx) {
const { sp: api_static_part, st: api_static_fragment } = $api;
return [
api_static_fragment($fragment1(), 0, [
api_static_fragment($fragment1, 0, [
Copy link
Member Author

Choose a reason for hiding this comment

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

This is mainly the change to all the template compiler fixtures, the invocation happens in the st function now so all the fixtures are updated like this.

@jmsjtu
Copy link
Member Author

jmsjtu commented Mar 13, 2024

@nolanlawson looks like I'm running into the LWC v5 vs v6 issue identified in #3974, do you know how long we intended to support the two versions?

Should I create a patch for similar to #3973 for this?

@nolanlawson
Copy link
Contributor

@jmsjtu It should be safe to remove now. I can do that in a separate PR.

@jmsjtu
Copy link
Member Author

jmsjtu commented Mar 19, 2024

Going through the nucleus logs, it appears there may be a bug with static content and <iframe> events.

See #4081 for details.

@jmsjtu jmsjtu merged commit c49478f into master Mar 19, 2024
9 checks passed
@jmsjtu jmsjtu deleted the jtu/static-content-optimization branch March 19, 2024 23:03
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

2 participants