# Migrate to firefly v11.0

This major version transform the bootstrap function from an async function a sync function. It also introduces a new FireflyProvider alias for RuntimeContext.Provider.

# Breaking changes

# bootstrap

The bootstrap function is not async anymore and stop returning the bootstrapping errors:

Before:

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

const { localModuleErrors, remoteModulesErrors } = await bootstrap({
    localModules: [...],
    remotes: [...]
})

Now:

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

bootstrap({
    localModules: [...],
    remotes: [...],
    onError: error => {
        ...
    } 
})

To handle bootstrapping errors, an onError handler can be provided.

# Optional changes

# Replace RuntimeContext.Provider by FireflyProvider

A new FireflyProvider has been introduced to replace RuntimeContext.Provider. This change is optionnal as both are still supported, but strongly encouraged.

Before:

import { FireflyRuntime, RuntimeContext } from "@squide/firefly";
import { createRoot } from "react-dom/client";

const runtime = new FireflyRuntime();

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

root.render(
    <RuntimeContext.Provider value={runtime}>
        <App />
    </RuntimeContext.Provider>
);

Now:

import { FireflyProvider, FireflyRuntime } from "@squide/firefly";
import { createRoot } from "react-dom/client";

const runtime = new FireflyRuntime();

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

root.render(
    <FireflyProvider runtime={runtime}>
        <App />
    </FireflyProvider>
);