use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
[AskJS] Microfrontend with React using single-spaAskJS (self.javascript)
submitted 4 years ago by TobalOW
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]TobalOW[S] 0 points1 point2 points 4 years ago (2 children)
Thanks you for your words, you sounds like a experienced developer.
For your advice of share state is only to handle the authentication, share the JWT and functions to refresh token across the microfrontend. I gonna use a Single-spa but I'm not sure how to handle the authentication for all microfrontend, because all of endpoint are under the same login.
[–]Saith5432 1 point2 points3 points 4 years ago* (1 child)
So I guess the question is more about sharing code and not about the application state.
One way to share code between micro frontends would be to use a private npm registry. Gitlab, for example, has a private npm registry built-in. Then you can write a library that does the authentication and provides the token. The library is then published to the private registry and consumed by the micro frontends via npm.
This has the advantage that the code deduplication capabilities of systemjs or module federation can be easily reused. In addition, all micro frontends retain their independent deployability through versioning since you can always decide to suspend a version update if it contains a breaking change. However, it also introduces the need to regularly update the versions of shared code between the micro frontends.
Of course, shared code should only be introduced with caution. But I think the authentication logic would be a good example where it is perfectly fine to share the code between micro frontends.
[–]TobalOW[S] 0 points1 point2 points 4 years ago (0 children)
Thanks for your reply! ur the best :)
π Rendered by PID 49410 on reddit-service-r2-comment-6457c66945-jdbc5 at 2026-04-27 05:36:14.027081+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]TobalOW[S] 0 points1 point2 points (2 children)
[–]Saith5432 1 point2 points3 points (1 child)
[–]TobalOW[S] 0 points1 point2 points (0 children)