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

Improve componentOnReady suggestion note for non-lazy builds #1437

Open
jcfranco opened this issue Jun 4, 2024 · 2 comments
Open

Improve componentOnReady suggestion note for non-lazy builds #1437

jcfranco opened this issue Jun 4, 2024 · 2 comments

Comments

@jcfranco
Copy link
Contributor

jcfranco commented Jun 4, 2024

The doc for componentOnReady recommends Ionic's similarly-named util for consistent behavior between lazy and non-lazy-loaded builds:

If you want to simulate the behavior of componentOnReady() for non-lazy builds, you can implement a helper method to wrap the functionality similar to what the Ionic Framework does here.

A note should be added this being similar in functionality in the non-lazy-loaded builds only if none of the component lifecycle methods return a promise. Otherwise, the callback will resolve after a requestAnimationFrame, but possibly before async component lifecycle methods resolve.

@christian-bromann
Copy link
Member

@jcfranco thanks for raising an issue for this. Would you be interested making such a change in the docs as you have most context about it? Happy to support where help is needed.

jcfranco added a commit to Esri/calcite-design-system that referenced this issue Jun 8, 2024
…LoadableComponent`) (#9515)

**Related Issue:** N/A

## Summary

#9362 introduced a utility that aimed to simplify how components wait to
be loaded/ready before certain logic. Unfortunately, the behavior
differs between `dist` and `components` output targets. This is because
the utility assumes components from the `components` output target are
not returning promises in lifecycle hooks that would delay initial
rendering.

See ionic-team/stencil-site#1437 for more
info.
@jcfranco
Copy link
Contributor Author

I'd be glad to help, but I'm not clear on what to suggest as an alternative to the Ionic util for these cases.

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

No branches or pull requests

2 participants