Is it possible for an Ember App that has nested ember apps inside? - ember.js

I am working on a project that needs to load separate widgets/apps at a later time than at the initial parent ember application kickoff. I want the separate apps to function as standalone ember application while also being able to loaded into the main application. Since I am unable to nest ember applications, I decided to use a subset of the ember functionality and eval the models, views, controllers, and templates when I request them. However these widgets (also functioning as a standalone ember app) have their own routes and data adapters that load controllers and associate them to views. What would be the best way to put the embedded routes into the main application's router and use a separate data adapter for them?
Alternatively if I don't use a separate data adapter and keep the widget to only using the ApplicationRoute to setup controllers can I have these widgets working correctly inside my ember app?
Has anyone attempted something similar?

Related

Issue is while integrating single SPA - having parent app as ember and multiple children (combination of ember engine + React)

Looking for some help/suggestion to integrate SPA.
Our parent app is an ember app, which is having multiple child routes (i.e. combination of ember engines + React ).
How can we support this using micro front end/SPA?
Currently these are deployed to VSI’s however we plan to deploy them to cloud soon.
Thanks in advance,
we tried using SPA framework with our app, however since we have parent app as ember and few child too as ember. I am trying to use ember as one of the child application with single spa, however I am unable to bring child app up.
we are configuring ember app as single-spa micro frontend and updated app Root UI to launch on specific route pattern. Ember App uses global variables, currently our app UI is the main application which is already in memory so when launching another ember app using single spa lib overwrites existing Global variables like Ember, requires which breaks both the applications. According to Single SPA we need use – Single SPA Leaked Globals module https://github.com/single-spa/single-spa-leaked-globals ,which is of no use for us since we already loaded landing ui App (mounted).

Embed ember-cli app into another one

I want to share an application between to other container apps, both done in Ember. So the app have to communicate with the parent container and should be compiled just one time.
What is the correct way to do this? Use an iframe and communicate with App.__container__.lookup('controller:application')?
I don't think an iframe is going to do the trick. Check out Ember Engines: http://ember-engines.com

Use Ember components with Require.js

Is it possible to use Ember Components without ember-cli, and load them dynamically with require.js?
We have to use require.js for legacy reasons and would eventually migrate from it, but we need some time. Currently we use Ember Views with require.js just fine, can't I can't figure out how to switch them to controllers.

Multiple ember js apps?

I'm currently adding ember.js to an existing rails app. Is it common to serve different ember apps based on route if the functionality is substantially different? Or is it better to keep it as one ember app?
The way that Ember intends you to use it is that you have one Ember application, and all the back-end stuff such as database interactions are handled by Ruby. Ember just communicates with the back-end to get what it needs.
However, if you feel comfortable having separate Ember applications on different pages, then that's absolutely fine, but it's not how Ember would like you to use it, since it's an ambitious framework.

Emberjs develop a component in isolation with its own routing/states, which can be integrated to main app

I need to develop a component in ember.
The component logic is somewhat isolated from main application and can be created as a seperate isolated application, with states and routes within the component.
Presently I have root controller of component as 'ApplicationController' to enable routing, the name 'applicationController' looks like hard coded.
Now I have the main application with its 'ApplicationController' + related routing,
and my component with its 'ApplicationController' + related routing. It looks hard to integrate them.
Is there any way to have multiple components like this seperated my namespaces? See comments here
So the main concern is a method to develop an ember component with routin/states in isolation, that is easy to integrate back with main application which also has routing/states.
EDIT
I have two values in component that is bound to main application that is the only integration.
Also component routes must come as part of application route once integrated.
Eg: #/approuteforcomponent/componentroute/componentroute2/
While developing I should be able to do just
#/approuteforcomponent -- shows a page saying component under construction
#/componentroute/componentroute2/
That being said, the main issue I have now is about both main application and component using 'ApplicationControler
UPDATE
Similar Question
Does ember.js encourage too many controllers?
What is the degree of integration you wish to achieve, back with main application? I mean: is the wanted isolation only related to code structure? or aims to factorized components reuse?
Are main app & component routing really unrelated?
You have at least two possible approaches:
You could setup several ember applications, with possible weak relations between them, but the routing relies on browser's base state, so it does not sounds like it makes sense to have several routers instanciated simultaneously with concurrent location management...
You also could develop your app with an addons architecture, having addons reopening the main app's routes, and stronger relations between app & addons (that's what we are doing here where I am working...)