refactor: replace the legacy function runtime with shared
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -175,7 +175,7 @@ export function generateStoreBrowserModule(ast: PageAst): string {
|
||||
.join(",\n");
|
||||
const groups = new Map<string, RuntimeFunctionDecl[]>();
|
||||
for (const fn of ast.runtimeFunctions.filter((entry) =>
|
||||
["client", "shared", "legacy"].includes(entry.runtime),
|
||||
["client", "shared"].includes(entry.runtime),
|
||||
)) {
|
||||
const group = groups.get(fn.name) ?? [];
|
||||
group.push(fn);
|
||||
@@ -296,7 +296,7 @@ function __create(definition) {
|
||||
Object.keys(actions).forEach(function (name) { delete actions[name]; });
|
||||
Object.entries(currentDefinition.actions || {}).forEach(function (pair) {
|
||||
const name = pair[0], candidates = pair[1];
|
||||
const selected = candidates.find(function (entry) { return entry.runtime === "client"; }) || candidates.find(function (entry) { return entry.runtime === "shared"; }) || candidates.find(function (entry) { return entry.runtime === "legacy"; });
|
||||
const selected = candidates.find(function (entry) { return entry.runtime === "client"; }) || candidates.find(function (entry) { return entry.runtime === "shared"; });
|
||||
if (!selected) return;
|
||||
actions[name] = async function () {
|
||||
const args = Array.prototype.slice.call(arguments);
|
||||
|
||||
Reference in New Issue
Block a user