Hi, I am trying to use Embroider to perform lazy loading of my ember app(v3.28). Currently we have a lot of instances where we have used the {{component}} helper to render dynamic components. I have few queries related to this:
-
I came across two options in Embroider - splitAtRoutes and staticComponents. Since, I am looking to just lazy load the ember app, is it fine if I only use splitAtRoutes without enabling staticComponents. Will I be able to use the {{component}} helper to render dynamic components if I don’t enable it? What will be the difference if I enable or don’t enable the staticComponents mode? Also is staticComponents dependent on allowUnsafeDynamicComponents?
-
Consider my app to be structured as such:
route1 -> Uses parentComp -> Uses subComp1 -> Uses subComp2
route2 -> Uses parentComp -> Uses subComp1 -> Uses subComp2
And subComp2 uses {{component}} to render a dynamic component. Both route1 and route2 would know the possible set of components (both routes may have separate set of components that could be passed and each route would have no knowledge of the other route’s set of components)that could be passed to the dynamic component helper. Is this sufficient?
As per my knowledge of Embroider, since parentComp is used in two routes, it would be extracted to a common chunk(which will be loaded along with route1 or route2’s chunk based on whichever is loaded first), so should parentComp know regarding the set of all possible components, or is it sufficient for just the route to have that knowledge?
8 posts - 3 participants