Skip to content

fix(compiler): default asyncLoading build conditional to true#5941

Merged
tanner-reits merged 2 commits intomainfrom
tr/custom-elements-lifecycle-hierarchy
Aug 15, 2024
Merged

fix(compiler): default asyncLoading build conditional to true#5941
tanner-reits merged 2 commits intomainfrom
tr/custom-elements-lifecycle-hierarchy

Conversation

@tanner-reits
Copy link
Copy Markdown
Contributor

What is the current behavior?

Currently, the dist-custom-elements build does not respect the behavior of certain lifecycle methods executing for child components, prior to parent components (as mentioned in the Stencil documentation).

Fixes: #3580

What is the new behavior?

This commit updates the default behavior for BUILD.asyncLoading to true. This change is necessary because the custom elements build does not customize the build conditionals like the lazy build. So, this value was never being set to true even in applicable scenarios.

This does have a slight impact on treeshaking (since any if statement testing this condition will now always be true) and runtime performance.

Documentation

N/A

Does this introduce a breaking change?

  • Yes
  • No

Testing

Tested in the reproduction case from #3580 and added a e2e test to ensure the methods are called in the appropriate order.

Other information

@tanner-reits tanner-reits marked this pull request as ready for review August 14, 2024 13:46
@tanner-reits tanner-reits requested a review from a team as a code owner August 14, 2024 13:46
@tanner-reits tanner-reits added this pull request to the merge queue Aug 15, 2024
Merged via the queue into main with commit 0e261d6 Aug 15, 2024
@tanner-reits tanner-reits deleted the tr/custom-elements-lifecycle-hierarchy branch August 15, 2024 18:43
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.

bug: componentDidLoad is called in parent before children have loaded

2 participants