Comments (4)
Hi,
- There are several ways to describe the layout, depending on application complexity. You can define a layout in the layout file, construct the layout programmatically, or not even use a layout and use lower level constructs such as parcels.
- Microfrontend does not need to know anything about how/where it is mounted, as that would create coupling
- You can use one root-config
- Microfrontends by default do not function in standalone mode (as they are more akin to library, rather than a web applcation). However, this can be achieved by using a "transparent" root-config. For example, when user accesses example.com/standalone/my-microfrontend, you can detect the route and display only that single microfrontend inside the root-config. I've typically used parcels for this.
from single-spa.
Thanks for the answer! For item 3, do you mean to use the same root-config and deploy individually to each subdomain? Maybe have an HTML file entry point different for each? How would we distinguish this in the microfrontends-layout.html
? Any direction here is welcome. The doc doesn't seem to cover the case of subdomains, and I'm hoping it won't require heavy lift to handle this kind of scenario.
from single-spa.
It depends on the complexity of your application.
single-spa-layout offers several options:
- A static layout definition
- Programmatically constructed layout (from HTML string, file, etc)
With the second option, you can maintain different layout files — each for one subdomain; you can have a single layout that you programmatically adapt after detecting the subdomain, etc.
Your choices mainly depend on how complex, and different layouts on each subdomain are.
single-spa-layout offers a lot of customization, but if that is not enough, you can build your own stitching layer and render applications / parcels manually, without having a predefined layout. This is useful in cases where you have very complex views — for example, a view where user can customize a grid of microfrontends (think Grafana, and similar).
If you can add more information about what differs between subdomain, I would be able to explain it in more detail.
from single-spa.
Related Issues (20)
- Continue Question with tailwind css + single-spa HOT 19
- Angular needs JIT compiler and throws error trying to share Angular between microfrontends HOT 2
- Shared react HOT 13
- Angular Lazy Loading is not working with single spa root application HOT 2
- add unload lifecycle to parcel HOT 1
- nodeLoader is undefined - global.nodeLoader.setImportMapPromise(Promise.resolve(nodeImportMap)) HOT 1
- Can not switch App when useing navigateToUrl, can anyone help me?Please.
- Single-spa patches $nuxt
- V6 Update HOT 1
- Change all `new Error` to a specific error like `new SingleSpaError`
- The call to the assets of microfrontend fails because its a different port HOT 2
- If an action tries to unmount a parcel while its already unmounting, the parent application gets set to SKIP_BECAUSE_BROKEN HOT 3
- Drop IE11 support
- Question: Is it possible to consume via single-spa webpack5 based federated micro frontends and vice versa?
- TypeError in Safari: createElementVNode is not a function HOT 5
- Is this a solution for Vite ESM? HOT 4
- Rework navigation cancelation
- How to merge large application with single spa HOT 1
- Single-spa is always appending index.html to the URL HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from single-spa.