Codync
무료 오픈소스 1:1 대안, Grok Bot과 Muse 대신
엔터프라이즈 수준의 마이크로 프론트엔드 구성 프레임워크, SPA와 SSR·i18n 지원
Enterprise-ready framework for Micro Frontends composition into SPA with SSR & i18n support
개발 도구TypeScript · JavaScriptGitHub @namecheap직접 설치운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
메이커가 쓴 소개는 위의 한 줄이 전부입니다. 더 자세한 내용은 저장소 README에서 읽을 수 있습니다. 저장소 README ↗
README 전체를 불러오는 중입니다.
README 전문 보기 ↗Isomorphic Layout Composer (ILC) - a layout service that composes a web page from fragment services. It supports client/server-based page composition.
Its competitive advantage over other solutions is an isomorphic page composition. It means that ILC assembles a page on the server-side using apps that support Server-side rendering (SSR), and after that, the page is passed on the client-side, so the client-side rendering handles all further navigation.
This approach allows to combine advantages of the Micro Frontends, SPA, and Server-side rendering approaches.
This repository also contains an example of how you can create a frontend that is composed from multiple applications that work in concert and deliver a unified experience.
Microservices get a lot of traction these days. They allow multiple teams to work independently, choose their technology stacks, and establish release cycles. Unfortunately, frontend development doesn't take full advantage of the microservices' benefits. The common practice for building websites is still "a monolith" - a single frontend codebase that consumes multiple APIs.
What if we introduce microservices on the frontend? It would allow frontend developers to work together with their backend counterparts on the same feature and independently deploy parts of the website ("fragments"), such as header, product, and footer. To bring microservices to the frontend, you need a layout service that can "stitch" a website out of fragments. This is where ILC comes into play.
To quickstart with ILC locally, follow the steps below:
Clone the namecheap/ilc repository.
Run pnpm install
Run docker compose up -d. Wait for the process to complete:
[+] Running 6/6
⠿ Network ilc_default Created 0.1s
⠿ Container ilc-ilc-1 Started 0.8s
⠿ Container ilc-postgres-1 Started 0.8s
⠿ Container ilc-registry-1 Started 20.0s
⠿ Container ilc-demo-apps-1 Started 1.4s
⠿ Container ilc-registry_worker-1 Started 19.8s
Run docker compose run registry npm run seed. Wait for the process to complete:
[+] Running 1/1
⠿ Container ilc-postgres-1 Recreated 3.8s
[+] Running 1/1
⠿ Container ilc-postgres-1 Started 0.4s
> [email protected] seed /codebase
> knex --knexfile config/knexfile.ts seed:run
Requiring external module ts-node/register
Working directory changed to /codebase/config
WARNING: NODE_ENV value of 'production' did not match any deployment config file names.
WARNING: See https://github.com/lorenwest/node-config/wiki/Strict-Mode
Ran 8 seed files
Open your browser and navigate to ILC or Registry UI:
ILC: http://localhost:8233/Registry UI: http://localhost:4001/ (user: root, password: pwd)!!! tip "Additional commands"
_ View logs: docker compose logs -f --tail=10
_ Shutdown local ILC: docker compose down
!!! note "" You can find more information about demo applications for this quick start in the namecheap/ilc-demo-apps repository.
The namecheap/ilc repository consists of the following parts:
ilc: code of the Isomorphic Layout Composerregistry: app that contains configuration that ILC uses: a list of micro-fragments, routes, etc.!!! note "Main branch is develop"
The main development branch is develop, not master: open pull requests against develop. develop is unstable: it may contain unreleased and breaking changes. Every push to develop publishes the namecheap/ilc and namecheap/ilc_registry Docker images tagged develop, so for production use a released version tag instead, for example namecheap/ilc:3.0.0 and namecheap/ilc_registry:3.0.0.
ILC relies on the adapters provided within the single-spa ecosystem to connect various frameworks. However, to ensure better integration with ILC, some of the original adapters were extended:
@portal/ prefixILC uses webpack (a static module bundler) to build each application for our micro-frontend approach. Webpack requires access to everything it needs to include in the bundle at build time. It means when an app imports a service (for example, planets import the fetchWithCache service), webpack tries to bundle the service into the planets bundle.
The built-in way to prevent this behavior is webpack externals.
This approach works well but to avoid adding a regex to each service ILC uses the @portal prefix to instruct both webpack and developers that the import is another micro-app/service/frontend.
Code splitting is a complicated topic. In ILC, code splitting is even more complicated. The reason is that the webpack module format expects the loading of extra modules from the website root, which will always fail until a place from where to load extra modules is configured. In ILC, you can see an example of this approach in the demo people application.
If you experience socket timeouts during requests to fragments, plese checkout this workaround https://github.com/namecheap/ilc/issues/444