split-micro-app

Configure and deploy standalone micro-apps within a monorepo using React Router and Cloudflare Workers.

82.1k|15.8k|Updated May 21, 2023
One-click install
npx skills add https://github.com/lobehub/lobehub --skill split-micro-app
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: split-micro-app
Source: https://github.com/lobehub/lobehub/tree/main/.agents/skills/split-micro-app
Command: npx skills add https://github.com/lobehub/lobehub --skill split-micro-app

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @react-router/dev, @cloudflare/vite-plugin, wrangler.

What problem does it solve?

This Skill addresses the complexity of managing micro-app architectures within a monorepo, specifically solving issues related to SSR bundle bloat, cross-repo dependency management, and deployment synchronization between OSS and cloud environments.

Core Features & Use Cases

  • SSR Optimization: Provides strategies for reducing SSR bundle weight through client-gating, stubbing, and deep-path imports.
  • Deployment Orchestration: Manages the lifecycle of micro-apps across different hosting environments, including CDN asset uploads and worker deployments.
  • Use Case: When splitting a new feature into a standalone micro-app, use this Skill to ensure correct route rules, SEO meta-tagging, and proper integration with the lobehub gateway (torii).

Quick Start

Use the split-micro-app skill to configure the build and deployment pipeline for a new micro-app named workbench.

Frequently Asked Questions about split-micro-app

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I split a monorepo surface into a standalone micro-app?▼

Create a new directory under apps/ and implement the required RR framework structure including root.tsx, entry.server.tsx, and a worker entry. Ensure the build pipeline is configured to handle SSR and CDN asset deployment.

What is the best way to reduce SSR bundle weight?▼

Reduce bundle weight by client-gating heavy routes, stubbing server-side store hubs, and using deep-path imports to avoid barrel file side effects. Trace module imports to identify and remove unnecessary dependencies.

Does this skill support Cloudflare Workers deployment?▼

Yes, the skill provides instructions for deploying SSR-enabled micro-apps to Cloudflare Workers using wrangler, including configuration for API reverse-proxying and static asset handling.

How do I handle SEO for SSR pages in a micro-app?▼

Use the shared buildPageMeta utility to define title, description, robots, and Open Graph tags. Ensure every leaf route returns the full set of meta-tags to replace root defaults.

When should I avoid using this micro-app approach?▼

Avoid this approach for simple features that do not require independent scaling, SSR, or separate deployment lifecycles, as the overhead of managing a micro-app architecture is significant.