main repo

This commit is contained in:
Basilosaurusrex
2025-11-24 18:09:40 +01:00
parent b636ee5e70
commit f027651f9b
34146 changed files with 4436636 additions and 0 deletions

View File

@@ -0,0 +1 @@
export declare function createServerReference(id: string): any;

View File

@@ -0,0 +1,23 @@
// This file must be bundled in the app's client layer, it shouldn't be directly
// imported by the server.
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "createServerReference", {
enumerable: true,
get: function() {
return createServerReference;
}
});
const _appcallserver = require("next/dist/client/app-call-server");
function createServerReference(id) {
// Since we're using the Edge build of Flight client for SSR [1], here we need to
// also use the same Edge build to create the reference. For the client bundle,
// we use the default and let Webpack to resolve it to the correct version.
// 1: https://github.com/vercel/next.js/blob/16eb80b0b0be13f04a6407943664b5efd8f3d7d0/packages/next/src/server/app-render/use-flight-response.tsx#L24-L26
const { createServerReference: createServerReferenceImpl } = !!process.env.NEXT_RUNTIME ? require("react-server-dom-webpack/client.edge") : require("react-server-dom-webpack/client");
return createServerReferenceImpl(id, _appcallserver.callServer);
}
//# sourceMappingURL=action-client-wrapper.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/build/webpack/loaders/next-flight-loader/action-client-wrapper.ts"],"names":["createServerReference","id","createServerReferenceImpl","process","env","NEXT_RUNTIME","require","callServer"],"mappings":"AAAA,gFAAgF;AAChF,0BAA0B;;;;;+BAMVA;;;eAAAA;;;+BAJW;AAIpB,SAASA,sBAAsBC,EAAU;IAC9C,iFAAiF;IACjF,+EAA+E;IAC/E,2EAA2E;IAC3E,yJAAyJ;IACzJ,MAAM,EAAED,uBAAuBE,yBAAyB,EAAE,GACxD,CAAC,CAACC,QAAQC,GAAG,CAACC,YAAY,GAEtBC,QAAQ,0CAERA,QAAQ;IAGd,OAAOJ,0BAA0BD,IAAIM,yBAAU;AACjD"}

View File

@@ -0,0 +1 @@
export declare function createActionProxy(id: string, bound: null | any[], action: any, originalAction?: any): void;

View File

@@ -0,0 +1,53 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "createActionProxy", {
enumerable: true,
get: function() {
return createActionProxy;
}
});
const SERVER_REFERENCE_TAG = Symbol.for("react.server.reference");
function createActionProxy(id, bound, action, originalAction) {
function bindImpl(_, ...boundArgs) {
const currentAction = this;
const newAction = async function(...args) {
if (originalAction) {
return originalAction(newAction.$$bound.concat(args));
} else {
// In this case we're calling the user-defined action directly.
return currentAction(...newAction.$$bound, ...args);
}
};
for (const key of [
"$$typeof",
"$$id",
"$$FORM_ACTION"
]){
// @ts-ignore
newAction[key] = currentAction[key];
}
// Rebind args
newAction.$$bound = (currentAction.$$bound || []).concat(boundArgs);
// Assign bind method
newAction.bind = bindImpl.bind(newAction);
return newAction;
}
Object.defineProperties(action, {
$$typeof: {
value: SERVER_REFERENCE_TAG
},
$$id: {
value: id
},
$$bound: {
value: bound
},
bind: {
value: bindImpl
}
});
}
//# sourceMappingURL=action-proxy.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/build/webpack/loaders/next-flight-loader/action-proxy.ts"],"names":["createActionProxy","SERVER_REFERENCE_TAG","Symbol","for","id","bound","action","originalAction","bindImpl","_","boundArgs","currentAction","newAction","args","$$bound","concat","key","bind","Object","defineProperties","$$typeof","value","$$id"],"mappings":";;;;+BAEgBA;;;eAAAA;;;AAFhB,MAAMC,uBAAuBC,OAAOC,GAAG,CAAC;AAEjC,SAASH,kBACdI,EAAU,EACVC,KAAmB,EACnBC,MAAW,EACXC,cAAoB;IAEpB,SAASC,SAAoBC,CAAM,EAAE,GAAGC,SAAgB;QACtD,MAAMC,gBAAgB,IAAI;QAE1B,MAAMC,YAAY,eAAgB,GAAGC,IAAW;YAC9C,IAAIN,gBAAgB;gBAClB,OAAOA,eAAeK,UAAUE,OAAO,CAACC,MAAM,CAACF;YACjD,OAAO;gBACL,+DAA+D;gBAC/D,OAAOF,iBAAiBC,UAAUE,OAAO,KAAKD;YAChD;QACF;QAEA,KAAK,MAAMG,OAAO;YAAC;YAAY;YAAQ;SAAgB,CAAE;YACvD,aAAa;YACbJ,SAAS,CAACI,IAAI,GAAGL,aAAa,CAACK,IAAI;QACrC;QAEA,cAAc;QACdJ,UAAUE,OAAO,GAAG,AAACH,CAAAA,cAAcG,OAAO,IAAI,EAAE,AAAD,EAAGC,MAAM,CAACL;QAEzD,qBAAqB;QACrBE,UAAUK,IAAI,GAAGT,SAASS,IAAI,CAACL;QAE/B,OAAOA;IACT;IAEAM,OAAOC,gBAAgB,CAACb,QAAQ;QAC9Bc,UAAU;YACRC,OAAOpB;QACT;QACAqB,MAAM;YACJD,OAAOjB;QACT;QACAU,SAAS;YACPO,OAAOhB;QACT;QACAY,MAAM;YACJI,OAAOb;QACT;IACF;AACF"}

View File

@@ -0,0 +1 @@
export declare function ensureServerEntryExports(actions: any[]): void;

View File

@@ -0,0 +1,23 @@
// This function ensures that all the exported values are valid server actions,
// during the runtime. By definition all actions are required to be async
// functions, but here we can only check that they are functions.
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "ensureServerEntryExports", {
enumerable: true,
get: function() {
return ensureServerEntryExports;
}
});
function ensureServerEntryExports(actions) {
for(let i = 0; i < actions.length; i++){
const action = actions[i];
if (typeof action !== "function") {
throw new Error(`A "use server" file can only export async functions, found ${typeof action}.`);
}
}
}
//# sourceMappingURL=action-validate.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/build/webpack/loaders/next-flight-loader/action-validate.ts"],"names":["ensureServerEntryExports","actions","i","length","action","Error"],"mappings":"AAAA,+EAA+E;AAC/E,yEAAyE;AACzE,iEAAiE;;;;;+BACjDA;;;eAAAA;;;AAAT,SAASA,yBAAyBC,OAAc;IACrD,IAAK,IAAIC,IAAI,GAAGA,IAAID,QAAQE,MAAM,EAAED,IAAK;QACvC,MAAME,SAASH,OAAO,CAACC,EAAE;QACzB,IAAI,OAAOE,WAAW,YAAY;YAChC,MAAM,IAAIC,MACR,CAAC,2DAA2D,EAAE,OAAOD,OAAO,CAAC,CAAC;QAElF;IACF;AACF"}

View File

@@ -0,0 +1 @@
export default function transformSource(this: any, source: string, sourceMap: any): void;

View File

@@ -0,0 +1,92 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return transformSource;
}
});
const _constants = require("../../../../lib/constants");
const _constants1 = require("../../../../shared/lib/constants");
const _warnonce = require("../../../../shared/lib/utils/warn-once");
const _getpagestaticinfo = require("../../../analysis/get-page-static-info");
const _getmodulebuildinfo = require("../get-module-build-info");
const noopHeadPath = require.resolve("next/dist/client/components/noop-head");
// For edge runtime it will be aliased to esm version by webpack
const MODULE_PROXY_PATH = "next/dist/build/webpack/loaders/next-flight-loader/module-proxy";
function transformSource(source, sourceMap) {
var _buildInfo_rsc, _buildInfo_rsc1;
// Avoid buffer to be consumed
if (typeof source !== "string") {
throw new Error("Expected source to have been transformed to a string.");
}
// Assign the RSC meta information to buildInfo.
// Exclude next internal files which are not marked as client files
const buildInfo = (0, _getmodulebuildinfo.getModuleBuildInfo)(this._module);
buildInfo.rsc = (0, _getpagestaticinfo.getRSCModuleInformation)(source, true);
// A client boundary.
if (((_buildInfo_rsc = buildInfo.rsc) == null ? void 0 : _buildInfo_rsc.type) === _constants1.RSC_MODULE_TYPES.client) {
var _this__module_parser, _this__module;
const sourceType = (_this__module = this._module) == null ? void 0 : (_this__module_parser = _this__module.parser) == null ? void 0 : _this__module_parser.sourceType;
const detectedClientEntryType = buildInfo.rsc.clientEntryType;
const clientRefs = buildInfo.rsc.clientRefs;
// It's tricky to detect the type of a client boundary, but we should always
// use the `module` type when we can, to support `export *` and `export from`
// syntax in other modules that import this client boundary.
let assumedSourceType = sourceType;
if (assumedSourceType === "auto" && detectedClientEntryType === "auto") {
if (clientRefs.length === 0 || clientRefs.length === 1 && clientRefs[0] === "") {
// If there's zero export detected in the client boundary, and it's the
// `auto` type, we can safely assume it's a CJS module because it doesn't
// have ESM exports.
assumedSourceType = "commonjs";
} else if (!clientRefs.includes("*")) {
// Otherwise, we assume it's an ESM module.
assumedSourceType = "module";
}
}
if (assumedSourceType === "module") {
if (clientRefs.includes("*")) {
this.callback(new Error(`It's currently unsupported to use "export *" in a client boundary. Please use named exports instead.`));
return;
}
let esmSource = `\
import { createProxy } from "${MODULE_PROXY_PATH}"
const proxy = createProxy(String.raw\`${this.resourcePath}\`)
// Accessing the __esModule property and exporting $$typeof are required here.
// The __esModule getter forces the proxy target to create the default export
// and the $$typeof value is for rendering logic to determine if the module
// is a client boundary.
const { __esModule, $$typeof } = proxy;
const __default__ = proxy.default;
`;
let cnt = 0;
for (const ref of clientRefs){
if (ref === "") {
esmSource += `\nexports[''] = proxy[''];`;
} else if (ref === "default") {
esmSource += `
export { __esModule, $$typeof };
export default __default__;`;
} else {
esmSource += `
const e${cnt} = proxy["${ref}"];
export { e${cnt++} as ${ref} };`;
}
}
this.callback(null, esmSource, sourceMap);
return;
}
}
if (((_buildInfo_rsc1 = buildInfo.rsc) == null ? void 0 : _buildInfo_rsc1.type) !== _constants1.RSC_MODULE_TYPES.client) {
if (noopHeadPath === this.resourcePath) {
(0, _warnonce.warnOnce)(`Warning: You're using \`next/head\` inside the \`app\` directory, please migrate to the Metadata API. See https://nextjs.org/docs/app/building-your-application/upgrading/app-router-migration#step-3-migrating-nexthead for more details.`);
}
}
this.callback(null, source.replace(_constants.RSC_MOD_REF_PROXY_ALIAS, MODULE_PROXY_PATH), sourceMap);
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/build/webpack/loaders/next-flight-loader/index.ts"],"names":["transformSource","noopHeadPath","require","resolve","MODULE_PROXY_PATH","source","sourceMap","buildInfo","Error","getModuleBuildInfo","_module","rsc","getRSCModuleInformation","type","RSC_MODULE_TYPES","client","sourceType","parser","detectedClientEntryType","clientEntryType","clientRefs","assumedSourceType","length","includes","callback","esmSource","resourcePath","cnt","ref","warnOnce","replace","RS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CACX,IAAIhB,MACF,CAAC,oGAAoG,CAAC;gBAG1G;YACF;YAEA,IAAIiB,YAAY,CAAC;6BACM,EAAErB,kBAAkB;sCACX,EAAE,IAAI,CAACsB,YAAY,CAAC;;;;;;;;AAQ1D,CAAC;YACK,IAAIC,MAAM;YACV,KAAK,MAAMC,OAAOR,WAAY;gBAC5B,IAAIQ,QAAQ,IAAI;oBACdH,aAAa,CAAC,0BAA0B,CAAC;gBAC3C,OAAO,IAAIG,QAAQ,WAAW;oBAC5BH,aAAa,CAAC;;2BAEG,CAAC;gBACpB,OAAO;oBACLA,aAAa,CAAC;OACjB,EAAEE,IAAI,UAAU,EAAEC,IAAI;UACnB,EAAED,MAAM,IAAI,EAAEC,IAAI,GAAG,CAAC;gBACxB;YACF;YAEA,IAAI,CAACJ,QAAQ,CAAC,MAAMC,WAAWnB;YAC/B;QACF;IACF;IAEA,IAAIC,EAAAA,kBAAAA,UAAUI,GAAG,qBAAbJ,gBAAeM,IAAI,MAAKC,4BAAgB,CAACC,MAAM,EAAE;QACnD,IAAId,iBAAiB,IAAI,CAACyB,YAAY,EAAE;YACtCG,IAAAA,kBAAQ,EACN,CAAC,0OAA0O,CAAC;QAEhP;IACF;IAEA,IAAI,CAACL,QAAQ,CACX,MACAnB,OAAOyB,OAAO,CAACC,kCAAuB,EAAE3B,oBACxCE;AAEJ"}

View File

@@ -0,0 +1 @@
export declare const createProxy: (moduleId: string) => any;

View File

@@ -0,0 +1,14 @@
/* eslint-disable import/no-extraneous-dependencies */ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "createProxy", {
enumerable: true,
get: function() {
return createProxy;
}
});
const _serveredge = require("react-server-dom-webpack/server.edge");
const createProxy = _serveredge.createClientModuleProxy;
//# sourceMappingURL=module-proxy.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/build/webpack/loaders/next-flight-loader/module-proxy.ts"],"names":["createProxy","createClientModuleProxy"],"mappings":"AAAA,oDAAoD;;;;+BAIvCA;;;eAAAA;;;4BAH2B;AAGjC,MAAMA,cAAyCC,mCAAuB"}