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

Implement {{lazy-mount}} component #887

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Implement {{lazy-mount}} component #887

wants to merge 3 commits into from

Conversation

SergeAstapov
Copy link
Contributor

Extracted from https://github.com/buschtoens/ember-lazy-mount and slightly modernized.

Credit to @buschtoens for great work.

@SergeAstapov SergeAstapov marked this pull request as draft April 14, 2024 02:39
@SergeAstapov
Copy link
Contributor Author

SergeAstapov commented Apr 14, 2024

WIP because needs tests.

@gossi
Copy link

gossi commented Apr 25, 2024

I have a bit more modern code lying around from my migration. I will share it next week.

@SergeAstapov
Copy link
Contributor Author

discussed this yesterday with @void-mAlex and this is not future proof and won't work under Embroider.
This solution would work only under classic Ember CLI build.

We should think about what this would look like under Embroider so we have path forward.

@villander
Copy link
Member

@SergeAstapov @void-mAlex can we have a meeting to discuss it further? I'd love to release it given it's part of the original RFC and I can help making it work with Embroider + adding tests

@gossi
Copy link

gossi commented Apr 30, 2024

I am sending my changes in #892 with the idea of them being merged into this PR and then this will become one PR.

The main part of my PR is the loader, that is working under embroider :)

I made the discovery of what API design this could land on (component vs. helper), but I don't have an opinion and as I saw @villander comment, I don't even have the reference to the RFC - but please make it either a helper or a component but not that weird hybrid thingy 🙈. Please make a decision, take the parts that are relevant and feel free to close my PR afterwards 👍

@void-mAlex
Copy link
Collaborator

brought this up during the embroider team meeting and will attempt to summarize the discussion

there currently isn't a clear way on how to get this to work with optimized emberoider scenarios
this sort of feature would fall out naturally out of the v2 app format, but the pre-reqs for that are still being worked on
the recommendation would be to get involved with v2 app rfc

as an alternative if services isolation is not an issue, the lazy loading aspect can be achieved in the form of converting the engine to a strict template v2 addon format and use existing lazy loading component techniques to achieve part of the benefits from this component/helper

that's it for the summary, left a comment on the linked pr as well regarding dynamic imports

if people want to invest time into something that is going to work only on classic builds or some non-optimised embroider scenarios (little benefit to be had from those) they are free to pursue this feature

please note this work would need to land after ember source v5 compatibility lands together with the full ember try scenarios for it as well as embroider and would require all of those to pass in order to ensure users that are on those versions/setups would continue to work with the new release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants