refactor: replace the legacy function runtime with shared

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-19 23:13:05 +05:30
co-authored by Claude Opus 5
parent 224af8fd96
commit ec63090006
10 changed files with 72 additions and 33 deletions
+2 -2
View File
@@ -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);