Skip to content

Commit

Permalink
feat: Migrated getting started templates to v9 (#187)
Browse files Browse the repository at this point in the history
* Migrated getting started templates to v9

* Fixed CI
  • Loading branch information
patricklafrance authored Sep 8, 2024
1 parent 2de7ea3 commit 5dd1daa
Show file tree
Hide file tree
Showing 33 changed files with 2,410 additions and 597 deletions.
2 changes: 1 addition & 1 deletion docs/getting-started/create-local-module.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ const runtime = new FireflyRuntime({
await registerRemoteModules(Remotes, runtime);

// Register the local module.
registerLocalModules([registerHost, registerMyLocalModule], runtime);
await registerLocalModules([registerHost, registerMyLocalModule], runtime);

const root = createRoot(document.getElementById("root")!);

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/add-a-shared-dependency.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ order: 760
# Add a shared dependency

!!!warning
This guide only applies to applications that include [remote modules](../reference/registration/registerRemoteModules.md).
This guide only applies to federated applications (applications including [remote modules](../reference/registration/registerRemoteModules.md)).
!!!

[Shared dependencies](https://module-federation.io/configure/shared.html) is one of the most powerful concepts of Module Federation. However, mastering its configuration can be quite challenging. **Failure** to configure shared dependencies properly in a federated application using Module Federation can significantly **impact** both **user** and **developer experiences**.
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/override-a-react-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export function ColoredPage() {

In the previous code samples, the host application provides a value for the `BackgroundColorContext`, and the `ColoredPage` component of the remote module uses this value to set its background color (to `blue` for this example).

## Override the context for the remote module
## Override the context for the module

Now, suppose the requirements change, and a page of the remote module must have a `red` background. The context can be overriden for that page by declaring a new provider directly in the routes registration:

Expand Down Expand Up @@ -114,7 +114,7 @@ export const register: ModuleRegisterFunction<FireflyRuntime> = runtime => {
## Update a singleton dependency version

!!!warning
This section applies only to federated applications (applications having [remote modules](../reference/registration/registerRemoteModules.md)).
This section only applies to federated applications (applications including [remote modules](../reference/registration/registerRemoteModules.md)).
!!!

Let's consider a more specific use case where the host application declares a `ThemeContext` from Workleap's new design system, [Hopper](https://hopper.workleap.design/):
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"ci-build": "turbo run build --filter=./packages/* --cache-dir=node_modules/.cache/turbo",
"pretest": "turbo run build --filter=./packages/*",
"test": "jest",
"prelint": "turbo run --filter=!@getting-started/* build",
"prelint": "turbo run build",
"lint": "pnpm run \"/^lint:.*/\"",
"lint:eslint": "eslint . --max-warnings=-0 --cache --cache-location node_modules/.cache/eslint",
"lint:knip": "knip --cache --cache-location node_modules/.cache/knip",
"lint:installed-check": "installed-check --engine-check --version-check",
"lint:types": "pnpm -r --parallel --include-workspace-root --filter=!@getting-started/* exec tsc",
"lint:types": "pnpm -r --parallel --include-workspace-root exec tsc",
"changeset": "changeset",
"publish-pkg": "changeset publish",
"clean": "pnpm -r --parallel --include-workspace-root exec pnpm dlx rimraf dist .turbo .netlify node_modules/.cache",
Expand Down Expand Up @@ -55,7 +55,7 @@
"typescript": "5.5.3"
},
"engines": {
"node": ">=20.0.0",
"node": ">=21.1.0",
"pnpm": ">=9"
},
"packageManager": "[email protected]+sha512.140036830124618d624a2187b50d04289d5a087f326c9edfc0ccd733d76c4f52c3a313d4fc148794a2a9d81553016004e6742e8cf850670268a7387fc220c903"
Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ export * from "./messaging/eventBus.ts";
export * from "./messaging/useEventBusDispatcher.ts";
export * from "./messaging/useEventBusListener.ts";

export * from "./federation/mergeDeferredRegistrations.ts";
export * from "./federation/moduleRegistry.ts";
export * from "./federation/registerLocalModules.ts";
export * from "./federation/registerModule.ts";
export * from "./registration/mergeDeferredRegistrations.ts";
export * from "./registration/moduleRegistry.ts";
export * from "./registration/registerLocalModules.ts";
export * from "./registration/registerModule.ts";

export * from "./plugins/plugin.ts";

2 changes: 1 addition & 1 deletion packages/core/tests/mergeDeferredRegistrations.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mergeDeferredRegistrations } from "../src/federation/mergeDeferredRegistrations.ts";
import type { DeferredRegistrationFunction } from "../src/index.ts";
import { mergeDeferredRegistrations } from "../src/registration/mergeDeferredRegistrations.ts";

function noop() {}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LocalModuleRegistry } from "../src/federation/registerLocalModules.ts";
import { LocalModuleRegistry } from "../src/registration/registerLocalModules.ts";
import { Runtime } from "../src/runtime/runtime.ts";

function simulateDelay(delay: number) {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/tests/registerLocalModules.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LocalModuleRegistry } from "../src/federation/registerLocalModules.ts";
import { LocalModuleRegistry } from "../src/registration/registerLocalModules.ts";
import { Runtime } from "../src/runtime/runtime.ts";

function simulateDelay(delay: number) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LocalModuleRegistry } from "../src/federation/registerLocalModules.ts";
import { LocalModuleRegistry } from "../src/registration/registerLocalModules.ts";
import { Runtime } from "../src/runtime/runtime.ts";

function simulateDelay(delay: number) {
Expand Down
Loading

0 comments on commit 5dd1daa

Please sign in to comment.