Closed tungurlakachakcak closed 4 years ago
Hi Vallerious, good question. You are right that by default single-spa does not ensure a consistent dom order of applications. Recently the single-spa core team has been working on a project called single-spa-layout, which provides an easier API for ensuring dom order. The first beta of the project was released in https://github.com/single-spa/single-spa-layout/releases/tag/v1.0.0-beta.0 and the preliminary documentation for it is at https://single-spa.js.org/docs/layout-overview. I view that project as the proper solution to this issue.
The alternative to single-spa-layout is to do what you've described by using domElementGetters. That approach is also a good one, and is perhaps just a bit more complex/roundabout than single-spa-layout. But both approaches work well.
If you'd like to update this example repo to use single-spa-layout, please feel free to do so.
I am closing this issue because I think I've answered the question. Feel free to comment further / reopen.
I would gladly contribute, but in the documentation I see that the javascript code uses "import" and is supposed to be put in the Githubissues.
Hi, all! Sorry for structuring this issue badly, perhaps a template for issues would be useful. :)
Steps to reproduce:
/app1
This may not happen every time.
Solution: As a solution, locally, I defined placeholders for the apps in the root-html-file -> index.html and then using domElementGetter, configured each application to load in those placeholders.
I would love to contribute for this issue, but am not sure if the index.html file is the correct place for defining the layout.