micro-frontend | 微前端框架 之 single-spa 从入门到精通 | Single Page Application library

 by   liyongning JavaScript Version: Current License: No License

kandi X-RAY | micro-frontend Summary

kandi X-RAY | micro-frontend Summary

micro-frontend is a JavaScript library typically used in Architecture, Single Page Application applications. micro-frontend has no bugs, it has no vulnerabilities and it has low support. You can download it from GitHub.

微前端框架 之 single-spa 从入门到精通
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              micro-frontend has a low active ecosystem.
              It has 18 star(s) with 11 fork(s). There are 1 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              micro-frontend has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of micro-frontend is current.

            kandi-Quality Quality

              micro-frontend has 0 bugs and 0 code smells.

            kandi-Security Security

              micro-frontend has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              micro-frontend code analysis shows 0 unresolved vulnerabilities.
              There are 4 security hotspots that need review.

            kandi-License License

              micro-frontend does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              micro-frontend releases are not available. You will need to build from source code and install.
              It has 104 lines of code, 0 functions and 154 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed micro-frontend and discovered the below as its top functions. This is intended to give you an instant insight into micro-frontend implemented functionality, and help decide if they suit your requirements.
            • React to route changes
            • Rebuild the parcel .
            • Load an app app .
            • Perform single app changes
            • Validates a config object
            • Main mount method .
            • Build a production build
            • Resolve time .
            • Registers an app
            • Unload an app
            Get all kandi verified functions for this library.

            micro-frontend Key Features

            No Key Features are available at this moment for micro-frontend.

            micro-frontend Examples and Code Snippets

            No Code Snippets are available at this moment for micro-frontend.

            Community Discussions

            QUESTION

            Using Blazor Wasm as an app shell in piral
            Asked 2022-Mar-12 at 14:53

            I chanced on Piral Framework for implementing micro-frontends and I wanted to implement it in my project.

            However, my application comes as a Blazor wasm project and my aim is to use this current project as my app shell.

            Is there any example on how I could implement that?

            I can't really find my way around the documentation too.

            Kindly note that I am a beginner. Thanks in advance.

            ...

            ANSWER

            Answered 2022-Jan-21 at 11:06

            For the app shell you cannot use Blazor.WASM. You can, however, make your app shell really lightweight (i.e., don't put almost anything in there) and have all the necessary layout parts defined in Blazor.

            The idea boils down to the sample given at: https://github.com/piral-samples/piral-distributed-layout

            Now instead of having pilet(s) in React / Angular / ... you use Blazor.

            For Blazor pilets (and extensions using Blazor) you can check out the documentation at the README of Piral.Blazor: https://github.com/smapiot/Piral.Blazor/

            Make sure to follow the instructions closely and use the right branch (named after the version of Blazor you are targeting).

            Source https://stackoverflow.com/questions/70094181

            QUESTION

            Module Federation, React, and Apollo 3 warnings
            Asked 2022-Feb-25 at 13:38

            I'm building an app with micro-frontends using webpack 5's module federation plugin. Everything was fine until I started adding react hooks into my remote app. At that point I received errors about "invalid usage of hooks", i.e. I discovered I had TWO versions of react loaded, one from the remote and one from the app consuming the remote.

            That problem was solved by adding a shared key to the ModuleFederationPlugin section of my webpack config that marked React as a singleton. Now everything compiles and seems to run just fine.

            However, the webpack compiler is throwing some annoying warnings at me now. Its saying:

            ...

            ANSWER

            Answered 2022-Feb-25 at 13:38

            Fixed my own problem by changing the key version to requiredVersion

            Source https://stackoverflow.com/questions/71197822

            QUESTION

            Nginx reverse proxy with docker-compose doesn't forward requests
            Asked 2021-Dec-08 at 21:09

            I've been creating a micro-frontend project and the glue (nginx) isn't working as expected.

            My projects are structured as such:

            ...

            ANSWER

            Answered 2021-Dec-08 at 21:09

            The primary issue is that localhost: is not accessible between containers. The containers should reference the service names defined in docker-compose.

            nginx.conf becomes:

            Source https://stackoverflow.com/questions/70172632

            QUESTION

            Frontend security - Is it possible to limit access scope?
            Asked 2021-Oct-26 at 03:17

            Given the growing size of frontend code, the concept of micro-frontend and module federation provided by Webpack 5 is a possible solution. However, considering the possibility that you are integrating code from other teams / 3rd parties, the foreign code could potentially try to access information it's not meant to by simply accessing the window object and iterating through its children.

            This doesn't have to be critical information like passwords and credit cards, which are often isolated using an iframe. Less sensitive information like user emails, or tracking data could be collected and misused.

            In this case, is there any technical set up that doesn't involve iframes that could limit the access scope of scripts? Is this something that could technically be implemented inside a WebAssembly program?

            Edit: Yes, the conservative rule is to simply not run untrusted code. The question posed however is if it's technically possible to sandbox frontend code without using iframe to limit its access to information.

            ...

            ANSWER

            Answered 2021-Oct-26 at 03:17

            Javascript is inherently "public", so at some point stuff you put in or get out will eventually be exposed, either through the network fetch/XHR, or through function execution.

            There is a "private" pattern in javascript, which prevents snooping around inside an object -- where you explicitely define the methods/properties that are exposed:

            Source https://stackoverflow.com/questions/69713988

            QUESTION

            Can't federate components in production mode
            Asked 2021-Oct-18 at 14:51

            I'm using Angular with Webpack 5 Module Federation for micro-frontends. I have 2 apps (let's call them app1 and app2) and my main app, app1, is federating components of app2.

            In app2, my exposed components are exported by my main module, so when I try to federate some component, I can get it from the export section of my module. Everything works fine in dev mode, I can get my exposed module, retrieve my exported components and then use the component factory resolver to create it where I want in app1.

            But when I build in production (I used ng serve --prod to reproduce the prod environment and test it) my exported components are gone but not the imports and providers. This is the module I get:

            ...

            ANSWER

            Answered 2021-Oct-18 at 14:51

            Fixed it by using a static field in my module as suggested here.

            Source https://stackoverflow.com/questions/69552125

            QUESTION

            Vue 3 + Module Federation
            Asked 2021-Aug-31 at 15:12

            I am trying to build a simple micro-frontend example using Vue3 and Module Federation but I have a collision problem.

            I have the code here: https://github.com/ghalex/mf-example

            There are only two mf:

            • container (Vue3)
            • auth (Vue3)

            The problem I have is that when I import the App.vue component:

            ...

            ANSWER

            Answered 2021-Aug-31 at 15:12

            I found the problem, it is a webpack-dev-server v4 bug. I downgraded to v3 and everything works fine.

            Source https://stackoverflow.com/questions/68922691

            QUESTION

            Unit testing for micro-frontend react application
            Asked 2021-Aug-09 at 01:39

            I'm trying to write unit tests for a react spa web application that uses micro-frontend architecture. My first step is to write unit tests for the application container.

            The application container react component uses a react-router containing a switch with subsequent routes to render the components in the main content area.

            Each application is mounted to the application container using JavaScript runtime integration.

            I'm using React-Testing-Library and Jest as part of my testing toolset.

            I've searched high and low across the Internet and haven't found any useful articles on the issues I'm having. Most of them show a demo of testing a web application that doesn't relate to my scenario.

            I have 3 problems that I would like some guidance on.

            1. Since Micro Frontends are composed of multiple layers of components chained together with authentication and other business logic. Should I be testing the "page components" only? Or should I be testing the entire application container starting from the App component? If neither is true, how should I be testing this application?

            2. I tried to test on the page component level to avoid authentication issues and for simplicity sake, but the component contains a component from React Router library, and Jest is complaining that I should not be using component that isn't enclosed within a component. However, the component is present at the parent component level when executed in runtime. How can I tell Jest to "ignore" this problem?

              I could not find a configuration that allows me to ignore this error.

            3. Due to issue #2, I tried to write unit tests by rendering the component, but this component is passed into a Higher Order Component that performs authentication validation. How can I focus on testing the end result instead of the functionality of the authentication HOC just so I can get the component to render and for my tests to execute?

            ...

            ANSWER

            Answered 2021-Aug-09 at 01:39

            In general, you should test each component and you should make assertions only about the logic contained within that component.

            For instance, let's pretend your App component looks like this:

            Source https://stackoverflow.com/questions/68705755

            QUESTION

            How to avoid external setting of some projects under same scope with webpack (and single-spa)
            Asked 2021-Aug-05 at 15:14

            The question:

            How (is it possible) to configure webpack (with single-spa), to take make some packages (projects) under a scope (@orginazation) externals and other internals (not external) ?

            Project information:

            We are building a single-spa application using webpack an uses Github npm registrer (and github actions). All the micro front-ends are projects in Github, and some of them are util/helper/provider projects, that is compiled as externals with webpack.

            But some of them are meant to be compiled with the micro-frontend (must not be external)

            It seems that when webpack sees one of the project under the organization scope as external, it set all package under that scope to external!

            As we can see from the log the "CompilingTool" will also be compiled as external, event thought it should not.

            The packages are set in the files as:

            ...

            ANSWER

            Answered 2021-Aug-05 at 15:14

            This is possible by passing in orgPackagesAsExternal: false to the single-spa webpack config, in your case named singleSpaDefaults. Per the create-single-spa documentation,

            This changes whether package names that start with @your-org-name are treated as webpack externals or not. Defaults to true.

            You will then need to either:

            • Enumerate which packages to mark as external
            • Provide a function that does this (which you've noted in your question)

            and then merge that with single-spa's config as usual. Because this can become verbose and annoying to do for every microfrontend, consider doing this in a base config that you publish that is specific for your company and which each mfe will then need to consume.

            Source https://stackoverflow.com/questions/68663829

            QUESTION

            How would somebody reduce the amount of Nuxt pages?
            Asked 2021-Jul-27 at 16:21

            Imagine you are developing a big-scale nuxt app that has 100 routes. what is the best solution for managing routes (not micro-frontend) in this app?

            ...

            ANSWER

            Answered 2021-Jul-27 at 15:47

            What do you mean by this?

            or should add all of them in pages directory?`

            Here, we're talking about pages only, right? So /user/id, /post/id and so on?
            If it's the case, you could have a /_entity/id or even a /_entity/_slug for more flexibility (with _entity being either user or post etc...).
            If you have a lot of various pages like /about, /our-team, /careers and so on, I guess that those will need their own SEO, content and are totally legit.

            I don't really see why this would be an issue at all. It will be properly organized, scalable and will not have too much abstraction neither (which is important IMO).

            You could also export some of those pages into .md files thanks to nuxt/content and import them into the pages. Like the Nuxt documentation is doing.

            If you really need to simplify those, yeah you could make the whole templates dynamic and generate the markup on fly. This could introduce some huge complexity that may not be needed IMO.
            Also, layouts, slots and render functions can be a solution too I guess.

            I'm not sure if micro-frontends (sounds like a buzz word for me) are actually several instances on Nuxt one next to another (sounds like a terrible idea if hosted under the same domain) or just "component-ization" of your non monolithic fullstack app (pretty much how we build websites for few years already).
            But for me, if a project do have 100 pages, it is totally fine.

            Of course, having some hardcoded /blog/post/1, /blog/post/2 is bad (lol) but a large app could be totally fine. It may create some issues regarding the build time and so on, but this is another subject and relies more of the way you do generate the project.

            So yeah, if your interviewer wanted to go deeper than those approaches, you would need more details from him to exactly know what are the challenges and what could be used.

            TLDR: as far as I know, no frameworks aim to reduce the number of pages because this is not an issue by itself. 10k Nuxt pages will not make your /about one slower by any means (if it does, the issue is elsewhere).

            Source https://stackoverflow.com/questions/68545804

            QUESTION

            No provider for dynamically created component after migration to micro-fronts structure
            Asked 2021-Jun-03 at 22:14

            The stack is way too complicated to recreate it, so forgive me in advance and ask me for further information.

            The Angular app has the following structure:

            ...

            ANSWER

            Answered 2021-Jun-03 at 22:14

            The issue was the way I did the bootstrap for the Angular application

            Wrong approach:

            Source https://stackoverflow.com/questions/67718938

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install micro-frontend

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/liyongning/micro-frontend.git

          • CLI

            gh repo clone liyongning/micro-frontend

          • sshUrl

            git@github.com:liyongning/micro-frontend.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Consider Popular Single Page Application Libraries

            single-spa

            by single-spa

            lavas

            by lavas-project

            startup-demo

            by designmodo

            mooa

            by phodal

            Try Top Libraries by liyongning

            element-ui

            by liyongningJavaScript

            qiankun

            by liyongningTypeScript

            webpack-bundle-analysis

            by liyongningJavaScript

            ts-cli

            by liyongningTypeScript

            VDOM

            by liyongningJavaScript