Initial boiler plate project
This commit is contained in:
15
node_modules/next/dist/esm/build/webpack/loaders/next-flight-loader/action-client-wrapper.js
generated
vendored
Normal file
15
node_modules/next/dist/esm/build/webpack/loaders/next-flight-loader/action-client-wrapper.js
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
// This file must be bundled in the app's client layer, it shouldn't be directly
|
||||
// imported by the server.
|
||||
import { callServer } from "next/dist/client/app-call-server";
|
||||
// A noop wrapper to let the Flight client create the server reference.
|
||||
// See also: https://github.com/facebook/react/pull/26632
|
||||
export 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, callServer);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=action-client-wrapper.js.map
|
||||
1
node_modules/next/dist/esm/build/webpack/loaders/next-flight-loader/action-client-wrapper.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/build/webpack/loaders/next-flight-loader/action-client-wrapper.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../src/build/webpack/loaders/next-flight-loader/action-client-wrapper.ts"],"names":["callServer","createServerReference","id","createServerReferenceImpl","process","env","NEXT_RUNTIME","require"],"mappings":"AAAA,gFAAgF;AAChF,0BAA0B;AAE1B,SAASA,UAAU,QAAQ,mCAAkC;AAE7D,uEAAuE;AACvE,yDAAyD;AACzD,OAAO,SAASC,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,IAAIF;AACvC"}
|
||||
13
node_modules/next/dist/esm/build/webpack/loaders/next-flight-loader/action-validate.js
generated
vendored
Normal file
13
node_modules/next/dist/esm/build/webpack/loaders/next-flight-loader/action-validate.js
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
// 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.
|
||||
export 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}.\nRead more: https://nextjs.org/docs/messages/invalid-use-server-value`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=action-validate.js.map
|
||||
1
node_modules/next/dist/esm/build/webpack/loaders/next-flight-loader/action-validate.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/build/webpack/loaders/next-flight-loader/action-validate.js.map
generated
vendored
Normal 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;AACjE,OAAO,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,uEAAuE,CAAC;QAExJ;IACF;AACF"}
|
||||
98
node_modules/next/dist/esm/build/webpack/loaders/next-flight-loader/index.js
generated
vendored
Normal file
98
node_modules/next/dist/esm/build/webpack/loaders/next-flight-loader/index.js
generated
vendored
Normal file
@ -0,0 +1,98 @@
|
||||
import { RSC_MOD_REF_PROXY_ALIAS } from "../../../../lib/constants";
|
||||
import { BARREL_OPTIMIZATION_PREFIX, RSC_MODULE_TYPES } from "../../../../shared/lib/constants";
|
||||
import { warnOnce } from "../../../../shared/lib/utils/warn-once";
|
||||
import { getRSCModuleInformation } from "../../../analysis/get-page-static-info";
|
||||
import { formatBarrelOptimizedResource } from "../../utils";
|
||||
import { getModuleBuildInfo } from "../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";
|
||||
export function getAssumedSourceType(mod, sourceType) {
|
||||
var _buildInfo_rsc, _buildInfo_rsc1;
|
||||
const buildInfo = getModuleBuildInfo(mod);
|
||||
const detectedClientEntryType = buildInfo == null ? void 0 : (_buildInfo_rsc = buildInfo.rsc) == null ? void 0 : _buildInfo_rsc.clientEntryType;
|
||||
const clientRefs = (buildInfo == null ? void 0 : (_buildInfo_rsc1 = buildInfo.rsc) == null ? void 0 : _buildInfo_rsc1.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";
|
||||
}
|
||||
}
|
||||
return assumedSourceType;
|
||||
}
|
||||
export default function transformSource(source, sourceMap) {
|
||||
var _this__module_matchResource, _this__module, _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 = getModuleBuildInfo(this._module);
|
||||
buildInfo.rsc = getRSCModuleInformation(source, true);
|
||||
// Resource key is the unique identifier for the resource. When RSC renders
|
||||
// a client module, that key is used to identify that module across all compiler
|
||||
// layers.
|
||||
//
|
||||
// Usually it's the module's file path + the export name (e.g. `foo.js#bar`).
|
||||
// But with Barrel Optimizations, one file can be splitted into multiple modules,
|
||||
// so when you import `foo.js#bar` and `foo.js#baz`, they are actually different
|
||||
// "foo.js" being created by the Barrel Loader (one only exports `bar`, the other
|
||||
// only exports `baz`).
|
||||
//
|
||||
// Because of that, we must add another query param to the resource key to
|
||||
// differentiate them.
|
||||
let resourceKey = this.resourcePath;
|
||||
if ((_this__module = this._module) == null ? void 0 : (_this__module_matchResource = _this__module.matchResource) == null ? void 0 : _this__module_matchResource.startsWith(BARREL_OPTIMIZATION_PREFIX)) {
|
||||
resourceKey = formatBarrelOptimizedResource(resourceKey, this._module.matchResource);
|
||||
}
|
||||
// A client boundary.
|
||||
if (((_buildInfo_rsc = buildInfo.rsc) == null ? void 0 : _buildInfo_rsc.type) === RSC_MODULE_TYPES.client) {
|
||||
var _this__module_parser, _this__module1;
|
||||
const assumedSourceType = getAssumedSourceType(this._module, (_this__module1 = this._module) == null ? void 0 : (_this__module_parser = _this__module1.parser) == null ? void 0 : _this__module_parser.sourceType);
|
||||
const clientRefs = buildInfo.rsc.clientRefs;
|
||||
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}"
|
||||
`;
|
||||
let cnt = 0;
|
||||
for (const ref of clientRefs){
|
||||
if (ref === "") {
|
||||
esmSource += `\nexports[''] = createProxy(String.raw\`${resourceKey}#\`);`;
|
||||
} else if (ref === "default") {
|
||||
esmSource += `\
|
||||
export default createProxy(String.raw\`${resourceKey}#default\`);
|
||||
`;
|
||||
} else {
|
||||
esmSource += `
|
||||
const e${cnt} = createProxy(String.raw\`${resourceKey}#${ref}\`);
|
||||
export { e${cnt++} as ${ref} };`;
|
||||
}
|
||||
}
|
||||
this.callback(null, esmSource, sourceMap);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (((_buildInfo_rsc1 = buildInfo.rsc) == null ? void 0 : _buildInfo_rsc1.type) !== RSC_MODULE_TYPES.client) {
|
||||
if (noopHeadPath === this.resourcePath) {
|
||||
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.`);
|
||||
}
|
||||
}
|
||||
const replacedSource = source.replace(RSC_MOD_REF_PROXY_ALIAS, MODULE_PROXY_PATH);
|
||||
this.callback(null, replacedSource, sourceMap);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/next/dist/esm/build/webpack/loaders/next-flight-loader/index.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/build/webpack/loaders/next-flight-loader/index.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../src/build/webpack/loaders/next-flight-loader/index.ts"],"names":["RSC_MOD_REF_PROXY_ALIAS","BARREL_OPTIMIZATION_PREFIX","RSC_MODULE_TYPES","warnOnce","getRSCModuleInformation","formatBarrelOptimizedResource","getModuleBuildInfo","noopHeadPath","require","resolve","MODULE_PROXY_PATH","getAssumedSourceType","mod","sourceType","buildInfo","detectedClientEntryType","rsc","clientEntryType","clientRefs","assumedSourceType","length","includes","transformSource","source","sourceMap","Error","_module","resourceKey","resourcePath","matchResource","startsWith","type","client","parser","callback","esmSource","cnt","ref","replacedSource","replace"],"mappings":"AACA,SAASA,uBAAuB,QAAQ,4BAA2B;AACnE,SACEC,0BAA0B,EAC1BC,gBAAgB,QACX,mCAAkC;AACzC,SAASC,QAAQ,QAAQ,yCAAwC;AACjE,SAASC,uBAAuB,QAAQ,yCAAwC;AAChF,SAASC,6BAA6B,QAAQ,cAAa;AAC3D,SAASC,kBAAkB,QAAQ,2BAA0B;AAE7D,MAAMC,eAAeC,QAAQC,OAAO,CAAC;AACrC,gEAAgE;AAChE,MAAMC,oBACJ;AAGF,OAAO,SAASC,qBACdC,GAAmB,EACnBC,UAAsB;QAGUC,gBACbA;IAFnB,MAAMA,YAAYR,mBAAmBM;IACrC,MAAMG,0BAA0BD,8BAAAA,iBAAAA,UAAWE,GAAG,qBAAdF,eAAgBG,eAAe;IAC/D,MAAMC,aAAaJ,CAAAA,8BAAAA,kBAAAA,UAAWE,GAAG,qBAAdF,gBAAgBI,UAAU,KAAI,EAAE;IAEnD,4EAA4E;IAC5E,6EAA6E;IAC7E,4DAA4D;IAC5D,IAAIC,oBAAoBN;IACxB,IAAIM,sBAAsB,UAAUJ,4BAA4B,QAAQ;QACtE,IACEG,WAAWE,MAAM,KAAK,KACrBF,WAAWE,MAAM,KAAK,KAAKF,UAAU,CAAC,EAAE,KAAK,IAC9C;YACA,uEAAuE;YACvE,yEAAyE;YACzE,oBAAoB;YACpBC,oBAAoB;QACtB,OAAO,IAAI,CAACD,WAAWG,QAAQ,CAAC,MAAM;YACpC,2CAA2C;YAC3CF,oBAAoB;QACtB;IACF;IACA,OAAOA;AACT;AAEA,eAAe,SAASG,gBAEtBC,MAAc,EACdC,SAAc;QAyBV,6BAAA,eAQAV,gBAwCAA;IAvEJ,8BAA8B;IAC9B,IAAI,OAAOS,WAAW,UAAU;QAC9B,MAAM,IAAIE,MAAM;IAClB;IAEA,gDAAgD;IAChD,mEAAmE;IACnE,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jB,EAAEC,IAAI,2BAA2B,EAAET,YAAY,CAAC,EAAEU,IAAI;UACnD,EAAED,MAAM,IAAI,EAAEC,IAAI,GAAG,CAAC;gBACxB;YACF;YAEA,IAAI,CAACH,QAAQ,CAAC,MAAMC,WAAWX;YAC/B;QACF;IACF;IAEA,IAAIV,EAAAA,kBAAAA,UAAUE,GAAG,qBAAbF,gBAAeiB,IAAI,MAAK7B,iBAAiB8B,MAAM,EAAE;QACnD,IAAIzB,iBAAiB,IAAI,CAACqB,YAAY,EAAE;YACtCzB,SACE,CAAC,0OAA0O,CAAC;QAEhP;IACF;IAEA,MAAMmC,iBAAiBf,OAAOgB,OAAO,CACnCvC,yBACAU;IAEF,IAAI,CAACwB,QAAQ,CAAC,MAAMI,gBAAgBd;AACtC"}
|
||||
5
node_modules/next/dist/esm/build/webpack/loaders/next-flight-loader/module-proxy.js
generated
vendored
Normal file
5
node_modules/next/dist/esm/build/webpack/loaders/next-flight-loader/module-proxy.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
/* eslint-disable import/no-extraneous-dependencies */ import { createClientModuleProxy } from "react-server-dom-webpack/server.edge";
|
||||
// Re-assign to make it typed.
|
||||
export const createProxy = createClientModuleProxy;
|
||||
|
||||
//# sourceMappingURL=module-proxy.js.map
|
||||
1
node_modules/next/dist/esm/build/webpack/loaders/next-flight-loader/module-proxy.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/build/webpack/loaders/next-flight-loader/module-proxy.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../src/build/webpack/loaders/next-flight-loader/module-proxy.ts"],"names":["createClientModuleProxy","createProxy"],"mappings":"AAAA,oDAAoD,GACpD,SAASA,uBAAuB,QAAQ,uCAAsC;AAE9E,8BAA8B;AAC9B,OAAO,MAAMC,cAAyCD,wBAAuB"}
|
||||
6
node_modules/next/dist/esm/build/webpack/loaders/next-flight-loader/server-reference.js
generated
vendored
Normal file
6
node_modules/next/dist/esm/build/webpack/loaders/next-flight-loader/server-reference.js
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
/* eslint-disable import/no-extraneous-dependencies */ import { registerServerReference as flightRegisterServerReference } from "react-server-dom-webpack/server.edge";
|
||||
export function registerServerReference(id, action) {
|
||||
return flightRegisterServerReference(action, id, null);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=server-reference.js.map
|
||||
1
node_modules/next/dist/esm/build/webpack/loaders/next-flight-loader/server-reference.js.map
generated
vendored
Normal file
1
node_modules/next/dist/esm/build/webpack/loaders/next-flight-loader/server-reference.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../src/build/webpack/loaders/next-flight-loader/server-reference.ts"],"names":["registerServerReference","flightRegisterServerReference","id","action"],"mappings":"AAAA,oDAAoD,GACpD,SAASA,2BAA2BC,6BAA6B,QAAQ,uCAAsC;AAE/G,OAAO,SAASD,wBAAwBE,EAAU,EAAEC,MAAW;IAC7D,OAAOF,8BAA8BE,QAAQD,IAAI;AACnD"}
|
||||
Reference in New Issue
Block a user