@stackflow/react
Advanced tools
Comparing version 1.2.0-canary.0 to 1.2.0-canary.1
@@ -44,3 +44,3 @@ "use strict"; | ||
key: "plugin-loader", | ||
overrideInitialEvents({ initialEvents }) { | ||
overrideInitialEvents({ initialEvents, initialContext }) { | ||
if (initialEvents.length === 0) { | ||
@@ -50,10 +50,17 @@ return []; | ||
return initialEvents.map((event) => { | ||
var _a; | ||
if (event.name !== "Pushed") { | ||
return event; | ||
} | ||
if (initialContext.initialLoaderData) { | ||
return __spreadProps(__spreadValues({}, event), { | ||
activityContext: __spreadProps(__spreadValues({}, event.activityContext), { | ||
loaderData: initialContext.initialLoaderData | ||
}) | ||
}); | ||
} | ||
const { activityName, activityParams } = event; | ||
const loader = (_a = config.activities.find( | ||
const matchActivity = config.activities.find( | ||
(activity) => activity.name === activityName | ||
)) == null ? void 0 : _a.loader; | ||
); | ||
const loader = matchActivity == null ? void 0 : matchActivity.loader; | ||
if (!loader) { | ||
@@ -60,0 +67,0 @@ return event; |
import type { ActivityBaseParams, ActivityDefinition, Config } from "@stackflow/config"; | ||
import type { ActivityComponentType, StackComponentType, StackflowReactPlugin } from "../stable"; | ||
import type { ActivityComponentType, StackflowReactPlugin } from "../stable"; | ||
import type { StackComponentType } from "./StackComponentType"; | ||
import { type Actions } from "./makeActions"; | ||
@@ -4,0 +5,0 @@ import { type StepActions } from "./makeStepActions"; |
@@ -91,3 +91,5 @@ "use strict"; | ||
], | ||
initialContext: props.initialContext, | ||
initialContext: { | ||
initialLoaderData: props.initialLoaderData | ||
}, | ||
plugins, | ||
@@ -117,3 +119,5 @@ handlers: { | ||
activityComponentMap: input.components, | ||
initialContext: props.initialContext | ||
initialContext: { | ||
initialLoaderData: props.initialLoaderData | ||
} | ||
} | ||
@@ -120,0 +124,0 @@ ) }) }); |
{ | ||
"name": "@stackflow/react", | ||
"version": "1.2.0-canary.0", | ||
"version": "1.2.0-canary.1", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "type": "git", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
208029
262
5022
0