# @squide/core

## 7.6.5

### Patch Changes

- [#803](https://github.com/workleap/wl-squide/pull/803) [`2f95cdd`](https://github.com/workleap/wl-squide/commit/2f95cdd3723cbbafe3385ff5ff8b8714fa8a01e5) Thanks [@patricklafrance](https://github.com/patricklafrance)! - The package is now published from the protected `npm-publish` GitHub environment with npm Trusted Publishing. The code of the package did not change.

## 7.6.4

### Patch Changes

- [#789](https://github.com/workleap/wl-squide/pull/789) [`af471d7`](https://github.com/workleap/wl-squide/commit/af471d7eefbaafaa81bec4c0b364456229c2d82d) Thanks [@claude](https://github.com/apps/claude)! - Updated dependencies to their latest versions.

## 7.6.3

### Patch Changes

- [#762](https://github.com/workleap/wl-squide/pull/762) [`e5e03be`](https://github.com/workleap/wl-squide/commit/e5e03bebd4829c559128c539d7db6448f5bdc47e) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Updated dependencies to their latest versions.

## 7.6.2

### Patch Changes

- [#743](https://github.com/workleap/wl-squide/pull/743) [`10fd934`](https://github.com/workleap/wl-squide/commit/10fd9348f471fa34a61d81906246acfc05298aaa) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Declare `@types/react` as an optional peer dependency, so the React types in the package declarations resolve under installs that link packages from outside the project, such as pnpm's global virtual store.

## 7.6.1

### Patch Changes

- [#725](https://github.com/workleap/wl-squide/pull/725) [`910ba4e`](https://github.com/workleap/wl-squide/commit/910ba4eae6a0375c29e5a8b89a8c74ba74fe0eee) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Updated dependencies to their latest versions.
  
  - `@squide/firefly`, `@squide/msw`, `@squide/firefly-storybook` and `@squide/firefly-module-federation` now require `msw` `^3.0.3` as a peer dependency. With MSW 3, the `worker.start()` option `onUnhandledRequest` is renamed to `onUnhandledFrame`. Since `msw-storybook-addon` 2.x only supports MSW 2, `@squide/firefly-storybook` now requires `msw-storybook-addon` `^3.0.3`:
  
  ```ts
  await worker.start({
      onUnhandledFrame: "bypass"
  });
  ```
  
  - `@squide/firefly-rsbuild-configs` now uses `@workleap/rsbuild-configs` 5.x. When customizing HTTPS with `https: (defaults) => ({ ... })`, the `selfsignedOptions.days` option has been removed; use `selfsignedOptions.notAfterDate` instead. Self-signed certificates are now cached in `node_modules/.cache/basic-ssl`, so a new certificate is generated (and must be trusted again) on first run after upgrading.

## 7.6.0

### Minor Changes

- [#713](https://github.com/workleap/wl-squide/pull/713) [`469672b`](https://github.com/workleap/wl-squide/commit/469672b9cbaa0b7d8892ae30f4642986b70f6ca7) Thanks [@patricklafrance](https://github.com/patricklafrance)! - `Plugin` gained optional members: `isReady()`, `registerReadyListener(callback)` and `removeReadyListener(callback)`, plus the exported `PluginReadyListener` type. A plugin implements them when it performs asynchronous work the application must wait for before rendering, such as the `i18nextPlugin` loading the resources of a language. `isReady()` is a status: it returns `false` again when new work starts and `true` once it settles, and the listeners are executed on every transition to ready. A plugin that doesn't implement them is always considered ready.
  
  `ModuleManager.addModuleRegistry` now attaches the listeners registered with `registerModulesRegisteredListener` and `registerModulesReadyListener` to a registry added afterwards. Previously a listener registered before the registry was added was never notified of that registry's status changes, and since both checks require every registry, the listener never fired.
  
  `ModuleManager.getAreModulesRegistered()` and `getAreModulesReady()` no longer report `true` while a registry hasn't started registering. A registry without modules settles synchronously before the next registry starts, and a listener subscribed from a plugin constructor was notified in between, before the remote modules of an application without local modules had registered anything. `ModuleManager.addModuleRegistry` throws once the registration has started, a registry added afterwards would never be started.

## 7.5.1

### Patch Changes

- [#706](https://github.com/workleap/wl-squide/pull/706) [`d37944e`](https://github.com/workleap/wl-squide/commit/d37944e0a82a459196ee08fb7bdea1bcf153d84c) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Updated dependencies to their latest versions.

## 7.5.0

### Minor Changes

- [#697](https://github.com/workleap/wl-squide/pull/697) [`a66a04a`](https://github.com/workleap/wl-squide/commit/a66a04afe75b6c570b0205902eb08cf028cba96c) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Added `runtime.registerDeferredRegistrationScopeStartedListener(callback)` and `runtime.removeDeferredRegistrationScopeStartedListener(callback)`, the non plugin counterpart of `Plugin.onDeferredRegistrationScopeStarted`.

  ```ts
  const dispose = runtime.registerDeferredRegistrationScopeStartedListener(
    ({ operation }) => {
      // "register" for the initial run, "update" for every subsequent one.
      commandPaletteRegistry.clear();
    }
  );

  // When the listener is not needed anymore.
  dispose();
  ```

  Registration returns a disposer. `removeDeferredRegistrationScopeStartedListener` is there for consumers that prefer to hold onto the callback reference.

  ## Why

  A registry that modules fill from their deferred registration functions needs the same clear-and-replay treatment Squide already gives its navigation items, otherwise an entry registered behind a feature flag survives that flag being turned off for the rest of the session.

  `Plugin.onDeferredRegistrationScopeStarted` covers that when the registry lives in a plugin. It often doesn't — an application-side registration helper holds the same kind of per-run state and needs the same signal, without inventing a plugin to hold it.

  ## One mechanism, two entry points

  This is deliberately **not** a second way to do the same thing. The listener takes the same options, returns the same optional completion function, and is driven from the same `ModuleManager` scope bracket as the plugin hook, in the same place, under the same guarantees:

  - Notified on **both** the initial run and every update run, before any module's deferred registration function. Plugins are notified first, so a listener can read what a plugin just reset.
  - A returned completion function runs once the run has settled, before the runtime's scope is completed, and runs even when the run failed — partial commit, no rollback, the same semantics as the navigation items.
  - The listener and its completion function must be synchronous. Nothing awaits them.
  - An error thrown by either is logged and swallowed; one faulty listener never fails a run.
  - Listeners are notified in registration order.

  **Prefer the plugin hook when the registry lives in a plugin** — there is nothing to subscribe and nothing to dispose. Reach for a listener only when the state isn't owned by a plugin.

  The listeners are also reachable from the `RuntimeScope` instance that modules receive: observing the boundary is allowed, even though starting or completing a scope is not.

  ## Are you affected

  No. This release is purely additive; existing code is unaffected.

## 7.4.0

### Minor Changes

- [#698](https://github.com/workleap/wl-squide/pull/698) [`c92bdfc`](https://github.com/workleap/wl-squide/commit/c92bdfc17015fd524cb40eccc06c94c6cf69548e) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Plugins can now hook into the lifecycle of a deferred registration run, to clear and replay their own registry the way Squide clears and replays its navigation items.

  The `Plugin` abstract class gained one optional method:

  ```ts
  onDeferredRegistrationScopeStarted?(options: DeferredRegistrationScopeOptions): DeferredRegistrationScopeCompletionFunction | void;
  ```

  It's optional and unimplemented on the base class, so **no existing plugin needs any change**.

  ## The problem

  A deferred registration function runs again every time the deferred registrations are updated, whenever a feature flag value changes or the data passed to `useDeferredRegistrations` changes. Squide discards the navigation items registered by the previous run before replaying the new one, which is what makes a conditionally registered item disappear once its condition stops holding.

  A plugin that exposes its own registry to modules got no such treatment. Nothing told that registry a new run was starting, so an entry registered from a deferred registration function guarded by a feature flag survived that flag being turned off, for the rest of the session. The plugin had no signal to act on either: the initial deferred registration run dispatched no event at all, so a plugin couldn't even tell which of its entries came from a deferred registration function and which came from a module's static registration.

  ## The hook

  `onDeferredRegistrationScopeStarted` is executed when a run starts, before any module's deferred registration function, and receives:

  - `operation`: `"register"` for the initial run, `"update"` for every subsequent update run.
  - `transactional`: `false` for the initial run, `true` for every update run.

  It can return a completion function, executed once every module's deferred registration function has settled, while the runtime's own scope is still open. Buffering the incoming entries during a transactional run and committing them from the completion function is what lets a registry be swapped atomically — readers never observe a half-filled registry, and the commit lands before React is told to re-render.

  Both the hook and the completion function must be synchronous. Squide doesn't await them.

  ## Guarantees

  - The hook is executed on **both** the initial run and every update run.
  - The completion function is executed even when the run fails, with whatever the modules managed to register. A failed run isn't rolled back, matching how the navigation items already behave. Note that a module throwing doesn't fail the run: module errors are collected and returned rather than thrown.
  - A plugin that doesn't declare the method is skipped.
  - A faulty plugin is isolated, the same way a faulty module is. A throwing hook or a throwing completion function is logged, the remaining plugins are still notified, the modules still register, the runtime's scope is still completed, and the run still resolves.

  ## Caveats

  On an update run, completion functions execute before Squide commits the navigation items of that run, so a completion function must not read `getNavigationItems()` — it would still return the items of the previous run. A completion function should only commit the plugin's own state.

  A plugin error reaches the runtime logger only. It doesn't surface through the `onError` callback of `useDeferredRegistrations`, which reports module registration errors. And because a throwing hook leaves that plugin's registry in whatever state it reached, it usually means the previous run's entries are still there — the very thing this hook exists to prevent, for that one plugin. Treat it as a bug to fix, not as a way to skip a run.

## 7.3.1

### Patch Changes

- [#682](https://github.com/workleap/wl-squide/pull/682) [`b8bfd7c`](https://github.com/workleap/wl-squide/commit/b8bfd7caf4286c5cffbf449d2ea211ae49c5b8dc) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Fixed the module registries running their success logging on the error path. The `Successfully registered...` log sat after the `try/catch` rather than inside the `try`, so a module or deferred registration that failed had its failure logged and then, immediately after, a success written to the same logger scope.

  Both loggers that implement a logger scope today, `@workleap/logging` and `@workleap/logrocket`, buffer a scope's logs and flush them from `end()`, and both ignore a second `end()` call. The error path had already ended the scope, so the stray log was queued and then discarded rather than displayed. Console and session replay output is therefore unchanged, and you were only affected if your application registers a logger that writes each log as it is called.

  `registerModules`, `registerDeferredRegistrations` and `updateDeferredRegistrations` are fixed on the local registry, along with the two deferred registration functions on the remote one. `RemoteModuleRegistry.registerModules` was already correct and is the shape the other five now match.

## 7.3.0

### Minor Changes

- [#678](https://github.com/workleap/wl-squide/pull/678) [`4d65ac0`](https://github.com/workleap/wl-squide/commit/4d65ac00c3094d9276c7c9f5914499863701032b) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Reverts the registration reporting and navigation item correctness changes released in `@squide/firefly@18.4.0`, `@squide/react-router@9.3.0` and `@squide/core@7.2.0`.

  **The three fixes that release carried are withdrawn.** If you upgraded into `18.4.0` for one of them, it is going away again in this version. The changesets being undone are `brave-moons-argue`, `tidy-pandas-repeat` and `witty-carrots-jam`.

  The changes were shipped as a single bundle. One of them introduced defects in the navigation item registry that were not caught before release, and because the three were entangled in the same commit the whole bundle is coming out rather than a piece of it. The source of these packages is now identical to `@squide/firefly@18.3.0`, `@squide/react-router@9.2.0` and `@squide/core@7.1.1`.

  ## What is withdrawn

  - **Sections are no longer copied on the deferred path.** A module that registers the same section object on more than one deferred registration run will again accumulate children on it, rendering duplicate links after repeated feature flag flips. Mutating a section after registering it once again updates the live menu.
  - **The section index key returns to the `-` separator.** `menuId` and section `$id` are joined with `-` again, so `("analytics", "sidebar-performance")` and `("analytics-sidebar", "performance")` collide once more. A nested item can attach to the wrong menu's section, two distinct sections can throw `A navigation section index has already been registered for the menu`, and strict mode can report one missing section instead of two. The keys returned by `getPendingSectionIds` change content again — treat them as opaque. `parseSectionIndexKey` reverts to splitting on `-`, so it no longer round-trips a key back to its `menuId` and `sectionId`: a key built from ids that contain a `-` now yields more than two elements. It remains deprecated, and nothing in the framework calls it.
  - **Deferred registration update runs no longer report the real outcome of their registrations.** A buffered registration is again reported as `registered` before the replay happens, and the replay logs nothing, so a menu can silently lose a link while the console shows success.
  - **`useStrictRegistrationMode` no longer re-validates navigation items after a completed deferred registration update.** Validation runs only once, when the modules become ready. A section lost by an update run surfaces only after a page reload. Applications that started throwing in development on a feature flag flip will stop throwing and go back to failing silently.

  ## Removed API

  These were all added in the release being reverted and are removed again:

  - `NavigationItemRegistrationStatus` loses its `"buffered"` member.
  - `_validateRegistrations` loses its `includeRoutes` option.

  This is released as a minor rather than a major because narrowing `NavigationItemRegistrationStatus` is only breaking for a consumer that already adopted the member, and it was published less than two days before being withdrawn with no recorded downloads. If you are pinned to `18.4.0` and reference `"buffered"` or `includeRoutes`, remove those references when you upgrade.

  The section index key ambiguity is the one piece tracked for re-landing, and it will go in on its own rather than as part of a bundle.

## 7.2.0

### Minor Changes

- [#671](https://github.com/workleap/wl-squide/pull/671) [`fb2669e`](https://github.com/workleap/wl-squide/commit/fb2669e985e20d71363d50d6d703033afaf1c7a9) Thanks [@patricklafrance](https://github.com/patricklafrance)! - A deferred registration update run now reports the real outcome of its registrations, and the navigation items are validated again once it completes.

  An update run buffers every registration and replays it when the run completes, but a buffered registration was reported as `registered` before the replay had happened. A nested item whose section was not re-registered by that run stayed pending, and the replay logged nothing at all, so a menu could silently lose a link while the console showed a green success.

  - `registerNavigationItem` now reports a buffered registration as `buffered`, and the replay reports whether each item ended up registered or pending. `NavigationItemRegistrationStatus` gained a `"buffered"` value.
  - `useStrictRegistrationMode` re-runs the navigation item validation after every completed deferred registration update, throwing in development and logging in production, exactly as it does once the modules are ready. Validation previously ran only once, so a section lost by an update run surfaced only after a page reload. `strictMode={false}` on `AppRouter` remains the opt-out.
  - `_validateRegistrations` accepts a new `includeRoutes` option. Routes are frozen after the initial registration phase and cannot become pending during an update run, so they are not re-validated.

  Applications that were silently losing navigation items on a feature flag flip will start throwing in development. That is the intended outcome, it surfaces misconfigurations that were previously invisible.

## 7.1.1

### Patch Changes

- [#639](https://github.com/workleap/wl-squide/pull/639) [`9ad83bb`](https://github.com/workleap/wl-squide/commit/9ad83bb34e71d64e76b7f2a390f4da3ef2ebcf87) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Updated dependencies to their latest versions.

## 7.1.0

### Minor Changes

- [#616](https://github.com/workleap/wl-squide/pull/616) [`be245cd`](https://github.com/workleap/wl-squide/commit/be245cd2141e9dc59fb328052ccbb8cd93e4937e) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Added `runtime.getNavigationItemsByMenu()` plus the matching `useRuntimeNavigationItemsByMenu` (`@squide/react-router`) and `useNavigationItemsByMenu` (`@squide/firefly`) hooks. The new APIs return the full navigation registry as a `Map<string, NavigationItem[]>` grouped by menu id. The returned map is a fresh, mutation-safe copy and is reference-stable across calls/renders until the registry changes (registration, deferred completion, or clear).

## 7.0.1

### Patch Changes

- [#603](https://github.com/workleap/wl-squide/pull/603) [`1fb3adb`](https://github.com/workleap/wl-squide/commit/1fb3adb99bd9573b6029852887f440deb88ca6f2) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Bumped dependencies.

## 7.0.0

### Major Changes

- [#586](https://github.com/workleap/wl-squide/pull/586) [`f26a67f`](https://github.com/workleap/wl-squide/commit/f26a67f80984c50aaf9b3b550a8e1f25edcbb43e) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Added typed EventBus through module augmentation of EventMap.

## 6.1.15

### Patch Changes

- [#575](https://github.com/workleap/wl-squide/pull/575) [`9c91bd4`](https://github.com/workleap/wl-squide/commit/9c91bd47c5357a2b15b1fb0e984f81687a3b8b53) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Bump dependencies

## 6.1.14

### Patch Changes

- [#493](https://github.com/workleap/wl-squide/pull/493) [`3689db0`](https://github.com/workleap/wl-squide/commit/3689db04642a919455d9f4703270c2d338c0c156) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Bumped dependencies.

## 6.1.13

### Patch Changes

- [#430](https://github.com/workleap/wl-squide/pull/430) [`cc3178b`](https://github.com/workleap/wl-squide/commit/cc3178b85212aba6570c42fb1bc7d552cc1fe998) Thanks [@github-actions](https://github.com/apps/github-actions)! - Updated dependencies to their latest versions.

## 6.1.12

### Patch Changes

- [#392](https://github.com/workleap/wl-squide/pull/392) [`4001ae7`](https://github.com/workleap/wl-squide/commit/4001ae75f7aea8ee124ce831f69a1f55a342cef5) Thanks [@patricklafrance](https://github.com/patricklafrance)! - `initializeFireflyForStorybook` now accept a `useMsw` option to opt-out of MSW and will now render as expected if no local modules are provided.

## 6.1.11

### Patch Changes

- [#373](https://github.com/workleap/wl-squide/pull/373) [`f9138cc`](https://github.com/workleap/wl-squide/commit/f9138cc4bd0a1d175ad4bd7e695d1edd7fbe4c1c) Thanks [@alexasselin008](https://github.com/alexasselin008)! - Bumped dependencies

## 6.1.10

### Patch Changes

- [#369](https://github.com/workleap/wl-squide/pull/369) [`a7fc49e`](https://github.com/workleap/wl-squide/commit/a7fc49ed2b111189cc310100482c1fcf37cfad58) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Bumped dependencies.

## 6.1.9

### Patch Changes

- [#365](https://github.com/workleap/wl-squide/pull/365) [`992dd28`](https://github.com/workleap/wl-squide/commit/992dd28ce8aa03559c556f24df4ebc9c3129c943) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Added memoize to the plugin retrieval code.

## 6.1.8

### Patch Changes

- [#361](https://github.com/workleap/wl-squide/pull/361) [`0479f4b`](https://github.com/workleap/wl-squide/commit/0479f4bb0bf17282dbd19dba92b3ac097cf01614) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Bumped dependency versions.

## 6.1.7

### Patch Changes

- [#352](https://github.com/workleap/wl-squide/pull/352) [`7bd7af5`](https://github.com/workleap/wl-squide/commit/7bd7af5a757912309704b9e93bf8ecf1388e6787) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Bump dependency versions.

## 6.1.6

### Patch Changes

- [#347](https://github.com/workleap/wl-squide/pull/347) [`6354489`](https://github.com/workleap/wl-squide/commit/6354489117e9826291da71f977daae55a5c5484a) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Bumped package versions.

## 6.1.5

### Patch Changes

- [#342](https://github.com/workleap/wl-squide/pull/342) [`3be4070`](https://github.com/workleap/wl-squide/commit/3be4070d2d647804903b5cc01113e20d5d71cb11) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Minor fine tuning following v16 release.

## 6.1.4

### Patch Changes

- [#339](https://github.com/workleap/wl-squide/pull/339) [`de6b333`](https://github.com/workleap/wl-squide/commit/de6b3335f538252bac9545d82c8f1218612eb923) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Bumped packages version.

## 6.1.3

### Patch Changes

- [#332](https://github.com/workleap/wl-squide/pull/332) [`eb933a7`](https://github.com/workleap/wl-squide/commit/eb933a72514ff3e01f5d3dafa17556e1a07471f6) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Bumpbed dependencies

## 6.1.2

### Patch Changes

- [#330](https://github.com/workleap/wl-squide/pull/330) [`09ffa31`](https://github.com/workleap/wl-squide/commit/09ffa3167a82182e7f7793615402ce8b6702f77b) Thanks [@copilot-swe-agent](https://github.com/apps/copilot-swe-agent)! - Bump versions to test OIDC publishing

## 6.1.1

### Patch Changes

- [#318](https://github.com/workleap/wl-squide/pull/318) [`6bf9a65`](https://github.com/workleap/wl-squide/commit/6bf9a65f222a6201655cf1ee525e94211aabe0b7) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Updated dependency versions.

## 6.1.0

### Minor Changes

- [#313](https://github.com/workleap/wl-squide/pull/313) [`bea660b`](https://github.com/workleap/wl-squide/commit/bea660bf827dd123a52f6062a7be8865dc99055b) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Hardened Honeycomb integration and added support for React Router relative paths.

## 6.0.0

### Major Changes

- [#311](https://github.com/workleap/wl-squide/pull/311) [`cc52e8b`](https://github.com/workleap/wl-squide/commit/cc52e8bfbe9d3d215f51d12755743f17c0c69772) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Deferred registration functions now receives a runtime instance as the first argument. This new scope runtime instance should used whenever runtime access is required within a deferred registration function scope.

  Before:

  The `runtime` argument of the registration function is used to register the navigation item.

  ```ts !#1,2,4
  export const register: ModuleRegisterFunction<
    FireflyRuntime,
    unknown,
    DeferredRegistrationData
  > = (runtime) => {
    return ({ featureFlags }, operation) => {
      if (featureFlags.featureA) {
        runtime.registerNavigationItem({
          $id: "feature-a",
          $label: operation === "register" ? "Feature A" : "Feature A updated",
          to: "/feature-a",
        });
      }
    };
  };
  ```

  After:

  The `deferredRuntime` argument of the **deferred** registration function is used to register the navigation item.

  ```ts !#2,4
  export const register: ModuleRegisterFunction<
    FireflyRuntime,
    unknown,
    DeferredRegistrationData
  > = (runtime) => {
    return (deferredRuntime, { featureFlags }, operation) => {
      if (featureFlags.featureA) {
        deferredRuntime.registerNavigationItem({
          $id: "feature-a",
          $label: operation === "register" ? "Feature A" : "Feature A updated",
          to: "/feature-a",
        });
      }
    };
  };
  ```

## 5.7.0

### Minor Changes

- [#302](https://github.com/workleap/wl-squide/pull/302) [`e55c60b`](https://github.com/workleap/wl-squide/commit/e55c60b8e5a3c258a5a7d667ce990f73021f8e5d) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Improved the logging API.

## 5.6.0

### Minor Changes

- [#300](https://github.com/workleap/wl-squide/pull/300) [`8d3eae2`](https://github.com/workleap/wl-squide/commit/8d3eae2ee4dc0331f83047e3ef313c6abb15dc3f) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Improved the logging API.

## 5.5.0

### Minor Changes

- [#296](https://github.com/workleap/wl-squide/pull/296) [`a143988`](https://github.com/workleap/wl-squide/commit/a1439886931f773ff8e71fa8dd8b429108525717) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Updated dependencies.

## 5.4.9

### Patch Changes

- [#289](https://github.com/workleap/wl-squide/pull/289) [`ee6f7d5`](https://github.com/workleap/wl-squide/commit/ee6f7d52ff6afa8ac757770c89b39978c40a70bc) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Fixed Honeycomb telemetry traces when data fetching fails and bumped dependencies versions.

## 5.4.8

### Patch Changes

- [#271](https://github.com/workleap/wl-squide/pull/271) [`fdc2dc5`](https://github.com/workleap/wl-squide/commit/fdc2dc5acb7ebec0d3b22f1a29ff1801930f1f57) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Updated dependencies.

## 5.4.7

### Patch Changes

- [#269](https://github.com/workleap/wl-squide/pull/269) [`d3a3fa0`](https://github.com/workleap/wl-squide/commit/d3a3fa05fe75db24a128263e8a2df57233769298) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Updated dependencies.

## 5.4.6

### Patch Changes

- [#256](https://github.com/workleap/wl-squide/pull/256) [`6c4ee56`](https://github.com/workleap/wl-squide/commit/6c4ee5624141a51d6eefd99dd053e81eb5b08e5c) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Update dependencies versioning to the new Workleap's internal guidelines.

## 5.4.5

### Patch Changes

- [#249](https://github.com/workleap/wl-squide/pull/249) [`9429e98`](https://github.com/workleap/wl-squide/commit/9429e98382f054ed560297aa8a1e54caba40db4f) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Fix an issue with removing "once" listener from the EventBus.

## 5.4.4

### Patch Changes

- [#247](https://github.com/workleap/wl-squide/pull/247) [`ddcb106`](https://github.com/workleap/wl-squide/commit/ddcb106a6b3522e09d1ab92c417725185ffc64e6) Thanks [@patricklafrance](https://github.com/patricklafrance)! - The error structure is now an instance of `Error` rather than an object literal.

## 5.4.3

### Patch Changes

- [#244](https://github.com/workleap/wl-squide/pull/244) [`5d13eb0`](https://github.com/workleap/wl-squide/commit/5d13eb038a724b499b820d7e1dc864c87954510b) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Updated dependencies.

## 5.4.2

### Patch Changes

- [#231](https://github.com/workleap/wl-squide/pull/231) [`3c6bce0`](https://github.com/workleap/wl-squide/commit/3c6bce0cd559d0b8517d644661b6fb2b818ab2f6) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Packages now includes source code and sourcemap.

## 5.4.1

### Patch Changes

- [#221](https://github.com/workleap/wl-squide/pull/221) [`8411080`](https://github.com/workleap/wl-squide/commit/8411080dfd0df6d0eafb01888298154fa5e5d925) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Fix deferred registrations.

## 5.4.0

### Minor Changes

- [#219](https://github.com/workleap/wl-squide/pull/219) [`25cb482`](https://github.com/workleap/wl-squide/commit/25cb482779ee280f3f7109de4607b92dcfeef7f3) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Now dispatching events to enable instrumentation packages for observability platforms.

## 5.3.0

### Minor Changes

- [#206](https://github.com/workleap/wl-squide/pull/206) [`8ee26fd`](https://github.com/workleap/wl-squide/commit/8ee26fd6ab7126bacf3dec900629fbd045dfd180) Thanks [@patricklafrance](https://github.com/patricklafrance)! - - Renamed a route definition `$name` option to `$id`.

  - Renamed the `registerRoute` `$parentName` option to `$parentId`.

  These changes should have been a major version but since Squide firefly v9 has been released a few days ago and no applications already migrated, it's include as part of v9 breaking changes.

## 5.2.0

### Minor Changes

- [#204](https://github.com/workleap/wl-squide/pull/204) [`d3f7b9c`](https://github.com/workleap/wl-squide/commit/d3f7b9c6aa80249cd898916f6315ea27c4526812) Thanks [@patricklafrance](https://github.com/patricklafrance)! - The `registerNavigationItem` function now accepts a `sectionId` option to nest the item under a specific navigation section:

  ```ts
  runtime.registerNavigationItem(
    {
      $id: "link",
      $label: "Link",
      to: "/link",
    },
    {
      sectionId: "some-section",
    }
  );
  ```

## 5.1.0

### Minor Changes

- [#195](https://github.com/workleap/wl-squide/pull/195) [`98e4839`](https://github.com/workleap/wl-squide/commit/98e48393fda27ebb2974ecc1e2f71b09f4e84953) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Replaced the `ManagedRoutes` placeholder by the `PublicRoutes` and `ProtectedRoutes` placeholder.

  Before:

  ```tsx
  import {
    ManagedRoutes,
    type ModuleRegisterFunction,
    type FireflyRuntime,
  } from "@squide/firefly";
  import { RootLayout } from "./RootLayout.tsx";

  export const registerHost: ModuleRegisterFunction<FireflyRuntime> = (
    runtime
  ) => {
    runtime.registerRoute(
      {
        element: <RootLayout />,
        children: [ManagedRoutes],
      },
      {
        hoist: true,
      }
    );
  };
  ```

  Now:

  ```tsx
  import {
    PublicRoutes,
    ProtectedRoutes,
    type ModuleRegisterFunction,
    type FireflyRuntime,
  } from "@squide/firefly";
  import { RootLayout } from "./RootLayout.tsx";

  export const registerHost: ModuleRegisterFunction<FireflyRuntime> = (
    runtime
  ) => {
    runtime.registerRoute(
      {
        element: <RootLayout />,
        children: [PublicRoutes, ProtectedRoutes],
      },
      {
        hoist: true,
      }
    );
  };
  ```

  Or:

  ```tsx
  import {
    PublicRoutes,
    ProtectedRoutes,
    type ModuleRegisterFunction,
    type FireflyRuntime,
  } from "@squide/firefly";
  import { RootLayout } from "./RootLayout.tsx";

  export const registerHost: ModuleRegisterFunction<FireflyRuntime> = (
    runtime
  ) => {
    runtime.registerRoute(
      {
        element: <RootLayout />,
        children: [
          PublicRoutes,
          {
            element: <AuthenticationBoundary />,
            children: [
              {
                element: <AuthenticatedLayout />,
                children: [ProtectedRoutes],
              },
            ],
          },
        ],
      },
      {
        hoist: true,
      }
    );
  };
  ```

  This release also includes a new `runtime.registerPublicRoute()` function.

## 5.0.1

### Patch Changes

- [#191](https://github.com/workleap/wl-squide/pull/191) [`2b62c53`](https://github.com/workleap/wl-squide/commit/2b62c539b0f3123cb47475566181e0b446ea6b40) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Updated packages description.

## 5.0.0

### Major Changes

- [#182](https://github.com/workleap/wl-squide/pull/182) [`58cf066`](https://github.com/workleap/wl-squide/commit/58cf066e87e23611510c254cca96016bd2bad08a) Thanks [@patricklafrance](https://github.com/patricklafrance)! - ## Firefly v9

  This major version of @squide/firefly introduces TanStack Query as the official library for fetching the global data of a Squide's application and features a complete rewrite of the AppRouter component, which now uses a state machine to manage the application's bootstrapping flow.

  Prior to v9, Squide applications couldn't use TanStack Query to fetch global data, making it challenging for Workleap's applications to keep their global data in sync with the server state. With v9, applications can now leverage custom wrappers of the useQueries hook to fetch and keep their global data up-to-date with the server state. Additionally, the new deferred registrations update feature allows applications to even keep their conditional navigation items in sync with the server state.

  Finally, with v9, Squide's philosophy has evolved. We used to describe Squide as a shell for federated applications. Now, we refer to Squide as a shell for modular applications. After playing with Squide's local module feature for a while, we discovered that Squide offers significant value even for non-federated applications, which triggered this shift in philosophy.

  > For a full breakdown of the changres and a migration procedure, read the following [documentation](https://workleap.github.io/wl-squide/guides/migrate-to-firefly-v9/).

  ## Breaking changes

  - The `useAreModulesRegistered` hook has been removed, use the `useIsBootstrapping` hook instead.
  - The `useAreModulesReady` hook has been removed, use the `useIsBootstrapping` hook instead.
  - The `useIsMswStarted` hook has been removed, use the `useIsBootstrapping` hook instead.
  - The `completeModuleRegistrations` function as been removed use the `useDeferredRegistrations` hook instead.
  - The `completeLocalModulesRegistrations` function has been removed use the `useDeferredRegistrations` hook instead.
  - The `completeRemoteModuleRegistrations` function has been removed use the `useDeferredRegistrations` hook instead.
  - The `useSession` hook has been removed, define your own React context instead.
  - The `useIsAuthenticated` hook has been removed, define your own React context instead.
  - The `sessionAccessor` option has been removed from the `FireflyRuntime` options, define your own React context instead.
  - Removed supports for deferred routes.
  - Plugin's constructor now requires a runtime instance argument.
  - Plugins now registers with a factory function.
  - Full rewrite of the `AppRouter` component.

  ## Renamed

  - The `setMswAsStarted` function has been renamed to `setMswIsReady`.

  ## Others

  - The `@squide/firefly` package now takes a peerDependency on `@tanstack/react-query`.
  - The `@squide/firefly` package doesn't takes a peerDependency on `react-error-boundary` anymore.

  ## New hooks and functions

  - A new `useIsBoostrapping` hook is now available.
  - A new `useDeferredRegistrations` hook is now available.
  - A new `usePublicDataQueries` hook is now available.
  - A new `useProtectedDataQueries` hook is now available.
  - A new `isGlobalDataQueriesError` function is now available.

  ## Improvements

  - Deferred registration functions now always receive a `data` argument.
  - Deferred registration functions now receives a new `operation` argument.
  - Navigation items now include a `$canRender` option, enabling modules to control whether a navigation item should be rendered.
  - New `$key` option for navigation items.

  For more details about the changes and a migration procedure, read the following [documentation](https://workleap.github.io/wl-squide/guides/migrate-to-firefly-v9/).

## 4.0.0

### Major Changes

- [#168](https://github.com/workleap/wl-squide/pull/168) [`89ace29`](https://github.com/workleap/wl-squide/commit/89ace29b9aeadbbe83cfa71dd137b9f1a115c283) Thanks [@patricklafrance](https://github.com/patricklafrance)! - This release Migrates Squide from Webpack Module Federation to [Module Federation 2.0](https://module-federation.io/guide/start/quick-start.html).

  This release deprecates the following packages:

  - `@squide/webpack-module-federation`, use `@squide/module-federation` instead.
  - `@squide/firefly-configs`, use `@squide/firefly-webpack-configs` instead.

  And introduce a few changes to existing API:

  - The `FireflyRuntime` nows accept a `useMsw` option and expose a new `isMswEnabled` getter:

  ```ts
  // bootstrap.tsx

  import { FireflyRuntime } from "@squide/firefly";

  const runtime = new FireflyRuntime({
    useMsw: true,
  });

  // Use the runtime to determine if MSW handlers should be registered.
  if (runtime.isMswEnabled) {
    // ...
  }
  ```

  - The `registerRemoteModules` function doesn't accept the remotes URL anymore. The remotes URL should be configured in the webpack configuration files.

  Previously:

  ```ts
  // bootstrap.tsx

  import {
    registerRemoteModules,
    type RemoteDefinition,
  } from "@squide/firefly";

  const Remotes: RemoteDefinition = [
    {
      name: "remote1",
      url: "http://localhost:8081",
    },
  ];

  await registerRemoteModules(Remotes, runtime);
  ```

  ```js
  // webpack.dev.js

  import { defineDevHostConfig } from "@squide/firefly-webpack-configs";
  import { swcConfig } from "./swc.dev.js";

  export default defineDevHostConfig(swcConfig, 8080, {
    overlay: false,
  });
  ```

  Now:

  ```ts
  // bootstrap.tsx

  import {
    registerRemoteModules,
    type RemoteDefinition,
  } from "@squide/firefly";

  const Remotes: RemoteDefinition = [
    {
      name: "remote1",
    },
  ];

  await registerRemoteModules(Remotes, runtime);
  ```

  ```js
  // webpack.dev.js

  import { defineDevHostConfig } from "@squide/firefly-webpack-configs";
  import { swcConfig } from "./swc.dev.js";

  /**
   * @typedef {import("@squide/firefly-webpack-configs").RemoteDefinition}[]
   */
  export const Remotes = [
    {
      name: "remote1",
      url: "http://localhost:8081",
    },
  ];

  export default defineDevHostConfig(swcConfig, 8080, Remotes, {
    overlay: false,
  });
  ```

  To migrate:

  1. Replace the `@squide/webpack-module-federation` dependency by `@squide/module-federation`.

  2. Replace the `@squide/firefly-configs` dependency by `@squide/firefly-webpack-configs`.

  3. Move the remotes URL from the `bootstrap.tsx` file to the `webpack.*.js` files.

  4. Integrate the new `useMsw` and `isMswEnabled` props.

## 3.4.0

### Minor Changes

- [#154](https://github.com/workleap/wl-squide/pull/154) [`e440515`](https://github.com/workleap/wl-squide/commit/e4405150a3c364fd4029c345399891614a434176) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Added a mergeDeferredRegistrations utility functions.

## 3.3.2

### Patch Changes

- [#152](https://github.com/workleap/wl-squide/pull/152) [`d27fe71`](https://github.com/workleap/wl-squide/commit/d27fe717f899e395c3f01af86aac3e015159d719) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Updated dependency versions.

## 3.3.1

### Patch Changes

- [#150](https://github.com/workleap/wl-squide/pull/150) [`d091846`](https://github.com/workleap/wl-squide/commit/d091846502bed6b783b69ab8eff7ae36d8e25449) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Adding a generic type for the event bus payload.

## 3.3.0

### Minor Changes

- [#144](https://github.com/workleap/wl-squide/pull/144) [`39d0bbe4`](https://github.com/workleap/wl-squide/commit/39d0bbe45902d54832e9aa8deb2c1949a2cf3c5f) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Internal cleanup.

## 3.2.1

### Patch Changes

- [#133](https://github.com/workleap/wl-squide/pull/133) [`1cda1be`](https://github.com/workleap/wl-squide/commit/1cda1be30779d1a1d5d2e21eac043baff20c0f7e) Thanks [@patricklafrance](https://github.com/patricklafrance)! - The completeDeferredRegistrations function data was required instead of optionnal. It has been fixed.

## 3.2.0

### Minor Changes

- [#131](https://github.com/workleap/wl-squide/pull/131) [`7caa44b`](https://github.com/workleap/wl-squide/commit/7caa44ba81a97d0705caf2f56e6536ae285c920d) Thanks [@patricklafrance](https://github.com/patricklafrance)! - - Added a `usePlugin` hook.

## 3.1.1

### Patch Changes

- [#128](https://github.com/workleap/wl-squide/pull/128) [`4c3b6f1`](https://github.com/workleap/wl-squide/commit/4c3b6f1929364844dda6c1190fc45c3b037e8df9) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Internally changed the usage of `setInterval` for `useSyncExternalStore`.

## 3.1.0

### Minor Changes

- [#115](https://github.com/workleap/wl-squide/pull/115) [`568255a`](https://github.com/workleap/wl-squide/commit/568255a50a519e7d19c8c2b03909559686cd24c4) Thanks [@patricklafrance](https://github.com/patricklafrance)! - - A plugin can now optionally implement a "\_setRuntime" method to received the current runtime at bootstrapping.

## 3.0.0

### Major Changes

- [#112](https://github.com/workleap/wl-squide/pull/112) [`a9dda1c`](https://github.com/workleap/wl-squide/commit/a9dda1c3b010f616556fc3313c1934e20a26bc11) Thanks [@patricklafrance](https://github.com/patricklafrance)! - - Renamed the `AbstractRuntime` class to `Runtime`.

## 2.2.0

### Minor Changes

- [#103](https://github.com/workleap/wl-squide/pull/103) [`b72fca3`](https://github.com/workleap/wl-squide/commit/b72fca38385ddacbcd80376c9afd0c9485658d90) Thanks [@patricklafrance](https://github.com/patricklafrance)! - - The `completeLocalModuleRegistrations` function `data` argument is now required.
  - Internal cleanup

## 2.1.0

### Minor Changes

- [#101](https://github.com/workleap/wl-squide/pull/101) [`1e77dca`](https://github.com/workleap/wl-squide/commit/1e77dcaf26660e42f2d5054b3fa1cd018c2ec009) Thanks [@patricklafrance](https://github.com/patricklafrance)! - This release introduces new APIs to support deferred routes registration with the ultimate goal of conditionally adding routes based on feature flags.

  - Updated the `ModuleRegisterFunction` type to accept a `function` as the return value.
  - Added a `completeLocalModuleRegistrations` function to complete the second phase of the registration process for local modules.

## 2.0.0

### Major Changes

- [#93](https://github.com/workleap/wl-squide/pull/93) [`d66a196`](https://github.com/workleap/wl-squide/commit/d66a196db9346803e1c996ef64089eda9aeff180) Thanks [@patricklafrance](https://github.com/patricklafrance)! - ### Addition

  - Added support for plugins to Squide runtime.
  - Added a `parentName` option to `registerRoute`.

  ### Updated

  - The `layoutPath` option of `registerRoute` has been renamed to `parentPath`.
  - `registerNavigationItems` has been renamed to `registerNavigationItem` and now only accepts a single item by call.
  - A navigation item `label`, `additionalProps` and `priority` fields has been renamed to `$label`, `$additionalProps` and `$priority`. This is part of an effort to ensure no future release of [React Router](https://reactrouter.com/en/main) introduced new properties with names that are conflicting with Squide.
  - Local modules `register` function can now be `async`. This is useful if you want for example to conditionally to a dynamic `import` to load a dependency such as [msw](https://www.npmjs.com/package/msw).

  ### Removed

  - Removed the Service features at it was confusing and not that helpful. We recommend using React context instead to share services with the modules.

## 1.1.1

### Patch Changes

- [#77](https://github.com/workleap/wl-squide/pull/77) [`5d3295c`](https://github.com/workleap/wl-squide/commit/5d3295cfdb98ce56b8878dcb1bb58fb3f6fac975) Thanks [@patricklafrance](https://github.com/patricklafrance)! - TBD

## 1.1.0

### Minor Changes

- [#73](https://github.com/workleap/wl-squide/pull/73) [`5407086`](https://github.com/workleap/wl-squide/commit/5407086a98587901abe341360729f8fe972d8174) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Added a new composable nested layouts feature

## 1.0.2

### Patch Changes

- [#66](https://github.com/workleap/wl-squide/pull/66) [`1a419de`](https://github.com/workleap/wl-squide/commit/1a419de33e22af7af990984068ab864e5be8fd4b) Thanks [@patricklafrance](https://github.com/patricklafrance)! - New release

## 1.0.1

### Patch Changes

- [#54](https://github.com/workleap/wl-squide/pull/54) [`1f0e967`](https://github.com/workleap/wl-squide/commit/1f0e96781513b262122fb8e47e10379caae0b731) Thanks [@ofrogon](https://github.com/ofrogon)! - Migrate project from GitHub organization

## 1.0.0

### Major Changes

- [#30](https://github.com/workleap/wl-squide/pull/30) [`edcd948`](https://github.com/workleap/wl-squide/commit/edcd948fa942a36fa77b05459722e91fa2f80f11) Thanks [@patricklafrance](https://github.com/patricklafrance)! - First stable release of @squide

## 0.0.1

### Patch Changes

- [#20](https://github.com/workleap/wl-squide/pull/20) [`1c3e332`](https://github.com/workleap/wl-squide/commit/1c3e3321ba2f54558f8b10b934d0defa8156ae29) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Testing changeset configuration
