react-server-dom-webpack
Advanced tools
Comparing version 0.0.0-experimental-41f0e9dae-20230907 to 0.0.0-experimental-42687267-20250108
@@ -11,6 +11,60 @@ /** | ||
'use strict'; | ||
'use strict';const h=require("acorn-loose"),l=require("url"),q=require("module"); | ||
module.exports=function(){const m=require("react-server-dom-webpack/server"),n=m.registerServerReference,r=m.createClientModuleProxy,f=q.prototype._compile;q.prototype._compile=function(k,p){if(-1===k.indexOf("use client")&&-1===k.indexOf("use server"))return f.apply(this,arguments);try{var a=h.parse(k,{ecmaVersion:"2024",sourceType:"source"}).body}catch(g){return console.error("Error parsing %s %s",l,g.message),f.apply(this,arguments)}var b=!1,d=!1;for(var c=0;c<a.length;c++){var e=a[c];if("ExpressionStatement"!== | ||
e.type||!e.directive)break;"use client"===e.directive&&(b=!0);"use server"===e.directive&&(d=!0)}if(!b&&!d)return f.apply(this,arguments);if(b&&d)throw Error('Cannot have both "use client" and "use server" directives in the same file.');b&&(a=l.pathToFileURL(p).href,this.exports=r(a));if(d)if(f.apply(this,arguments),d=l.pathToFileURL(p).href,a=this.exports,"function"===typeof a)n(a,d,null);else for(b=Object.keys(a),c=0;c<b.length;c++){e=b[c];const g=a[b[c]];"function"===typeof g&&n(g,d,e)}}}; | ||
"use strict"; | ||
const acorn = require("acorn-loose"), | ||
url = require("url"), | ||
Module = require("module"); | ||
module.exports = function () { | ||
const Server = require("react-server-dom-webpack/server"), | ||
registerServerReference = Server.registerServerReference, | ||
createClientModuleProxy = Server.createClientModuleProxy, | ||
originalCompile = Module.prototype._compile; | ||
Module.prototype._compile = function (content, filename) { | ||
if ( | ||
-1 === content.indexOf("use client") && | ||
-1 === content.indexOf("use server") | ||
) | ||
return originalCompile.apply(this, arguments); | ||
try { | ||
var body = acorn.parse(content, { | ||
ecmaVersion: "2024", | ||
sourceType: "source" | ||
}).body; | ||
} catch (x) { | ||
return ( | ||
console.error("Error parsing %s %s", url, x.message), | ||
originalCompile.apply(this, arguments) | ||
); | ||
} | ||
var useClient = !1, | ||
useServer = !1; | ||
for (var i = 0; i < body.length; i++) { | ||
var node = body[i]; | ||
if ("ExpressionStatement" !== node.type || !node.directive) break; | ||
"use client" === node.directive && (useClient = !0); | ||
"use server" === node.directive && (useServer = !0); | ||
} | ||
if (!useClient && !useServer) return originalCompile.apply(this, arguments); | ||
if (useClient && useServer) | ||
throw Error( | ||
'Cannot have both "use client" and "use server" directives in the same file.' | ||
); | ||
useClient && | ||
((body = url.pathToFileURL(filename).href), | ||
(this.exports = createClientModuleProxy(body))); | ||
if (useServer) | ||
if ( | ||
(originalCompile.apply(this, arguments), | ||
(useServer = url.pathToFileURL(filename).href), | ||
(body = this.exports), | ||
"function" === typeof body) | ||
) | ||
registerServerReference(body, useServer, null); | ||
else | ||
for (useClient = Object.keys(body), i = 0; i < useClient.length; i++) { | ||
node = useClient[i]; | ||
const value = body[useClient[i]]; | ||
"function" === typeof value && | ||
registerServerReference(value, useServer, node); | ||
} | ||
}; | ||
}; |
@@ -11,12 +11,390 @@ /** | ||
'use strict'; | ||
'use strict';var r=require("path"),u=require("url"),x=require("neo-async"),A=require("acorn-loose"),B=require("webpack/lib/dependencies/ModuleDependency"),C=require("webpack/lib/dependencies/NullDependency"),D=require("webpack/lib/Template"),E=require("webpack");const F=Array.isArray;class G extends B{constructor(b){super(b)}get type(){return"client-reference"}}const H=require.resolve("../client.browser.js"); | ||
class I{constructor(b){this.ssrManifestFilename=this.clientManifestFilename=this.chunkName=this.clientReferences=void 0;if(!b||"boolean"!==typeof b.isServer)throw Error("React Server Plugin: You must specify the isServer option as a boolean.");if(b.isServer)throw Error("TODO: Implement the server compiler.");b.clientReferences?"string"!==typeof b.clientReferences&&F(b.clientReferences)?this.clientReferences=b.clientReferences:this.clientReferences=[b.clientReferences]:this.clientReferences=[{directory:".", | ||
recursive:!0,include:/\.(js|ts|jsx|tsx)$/}];"string"===typeof b.chunkName?(this.chunkName=b.chunkName,/\[(index|request)\]/.test(this.chunkName)||(this.chunkName+="[index]")):this.chunkName="client[index]";this.clientManifestFilename=b.clientManifestFilename||"react-client-manifest.json";this.ssrManifestFilename=b.ssrManifestFilename||"react-ssr-manifest.json"}apply(b){const n=this;let p,t=!1;b.hooks.beforeCompile.tapAsync("React Server Plugin",(e,g)=>{e=e.contextModuleFactory;const l=b.resolverFactory.get("context", | ||
{}),a=b.resolverFactory.get("normal");n.resolveAllClientFiles(b.context,l,a,b.inputFileSystem,e,function(c,d){c?g(c):(p=d,g())})});b.hooks.thisCompilation.tap("React Server Plugin",(e,g)=>{g=g.normalModuleFactory;e.dependencyFactories.set(G,g);e.dependencyTemplates.set(G,new C.Template);e=l=>{l.hooks.program.tap("React Server Plugin",()=>{const a=l.state.module;if(a.resource===H&&(t=!0,p))for(let d=0;d<p.length;d++){const m=p[d];var c=n.chunkName.replace(/\[index\]/g,""+d).replace(/\[request\]/g, | ||
D.toPath(m.userRequest));c=new E.AsyncDependenciesBlock({name:c},null,m.request);c.addDependency(m);a.addBlock(c)}})};g.hooks.parser.for("javascript/auto").tap("HarmonyModulesPlugin",e);g.hooks.parser.for("javascript/esm").tap("HarmonyModulesPlugin",e);g.hooks.parser.for("javascript/dynamic").tap("HarmonyModulesPlugin",e)});b.hooks.make.tap("React Server Plugin",e=>{e.hooks.processAssets.tap({name:"React Server Plugin",stage:E.Compilation.PROCESS_ASSETS_STAGE_REPORT},function(){if(!1===t)e.warnings.push(new E.WebpackError("Client runtime at react-server-dom-webpack/client was not found. React Server Components module map file "+ | ||
n.clientManifestFilename+" was not created."));else{var g=new Set((p||[]).map(d=>d.request)),l={},a={};e.chunkGroups.forEach(function(d){function m(k,f){if(g.has(f.resource)&&(f=u.pathToFileURL(f.resource).href,void 0!==f)){const h={};l[f]={id:k,chunks:q,name:"*"};h["*"]={specifier:f,name:"*"};a[k]=h}}const q=d.chunks.map(function(k){return k.id});d.chunks.forEach(function(k){k=e.chunkGraph.getChunkModulesIterable(k);Array.from(k).forEach(function(f){const h=e.chunkGraph.getModuleId(f);m(h,f);f.modules&& | ||
f.modules.forEach(v=>{m(h,v)})})})});var c=JSON.stringify(l,null,2);e.emitAsset(n.clientManifestFilename,new E.sources.RawSource(c,!1));c=JSON.stringify(a,null,2);e.emitAsset(n.ssrManifestFilename,new E.sources.RawSource(c,!1))}})})}resolveAllClientFiles(b,n,p,t,e,g){function l(a){if(-1===a.indexOf("use client"))return!1;let c;try{c=A.parse(a,{ecmaVersion:"2024",sourceType:"module"}).body}catch(d){return!1}for(a=0;a<c.length;a++){const d=c[a];if("ExpressionStatement"!==d.type||!d.directive)break; | ||
if("use client"===d.directive)return!0}return!1}x.map(this.clientReferences,(a,c)=>{"string"===typeof a?c(null,[new G(a)]):n.resolve({},b,a.directory,{},(d,m)=>{if(d)return c(d);e.resolveDependencies(t,{resource:m,resourceQuery:"",recursive:void 0===a.recursive?!0:a.recursive,regExp:a.include,include:void 0,exclude:a.exclude},(q,k)=>{if(q)return c(q);q=k.map(f=>{var h=r.join(m,f.userRequest);h=new G(h);h.userRequest=f.userRequest;return h});x.filter(q,(f,h)=>{p.resolve({},b,f.request,{},(v,y)=>{if(v|| | ||
"string"!==typeof y)return h(null,!1);t.readFile(y,"utf-8",(w,z)=>{if(w||"string"!==typeof z)return h(null,!1);w=l(z);h(null,w)})})},c)})})},(a,c)=>{if(a)return g(a);a=[];for(let d=0;d<c.length;d++)a.push.apply(a,c[d]);g(null,a)})}}module.exports=I; | ||
"use strict"; | ||
var path = require("path"), | ||
url = require("url"), | ||
asyncLib = require("neo-async"), | ||
acorn = require("acorn-loose"), | ||
ModuleDependency = require("webpack/lib/dependencies/ModuleDependency"), | ||
NullDependency = require("webpack/lib/dependencies/NullDependency"), | ||
Template = require("webpack/lib/Template"), | ||
webpack = require("webpack"); | ||
function _unsupportedIterableToArray(o, minLen) { | ||
if (o) { | ||
if ("string" === typeof o) return _arrayLikeToArray(o, minLen); | ||
var n = Object.prototype.toString.call(o).slice(8, -1); | ||
"Object" === n && o.constructor && (n = o.constructor.name); | ||
if ("Map" === n || "Set" === n) return Array.from(o); | ||
if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) | ||
return _arrayLikeToArray(o, minLen); | ||
} | ||
} | ||
function _arrayLikeToArray(arr, len) { | ||
if (null == len || len > arr.length) len = arr.length; | ||
for (var i = 0, arr2 = Array(len); i < len; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
function _createForOfIteratorHelper(o, allowArrayLike) { | ||
var it; | ||
if ("undefined" === typeof Symbol || null == o[Symbol.iterator]) { | ||
if ( | ||
Array.isArray(o) || | ||
(it = _unsupportedIterableToArray(o)) || | ||
(allowArrayLike && o && "number" === typeof o.length) | ||
) { | ||
it && (o = it); | ||
var i = 0; | ||
allowArrayLike = function () {}; | ||
return { | ||
s: allowArrayLike, | ||
n: function () { | ||
return i >= o.length ? { done: !0 } : { done: !1, value: o[i++] }; | ||
}, | ||
e: function (e) { | ||
throw e; | ||
}, | ||
f: allowArrayLike | ||
}; | ||
} | ||
throw new TypeError( | ||
"Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method." | ||
); | ||
} | ||
var normalCompletion = !0, | ||
didErr = !1, | ||
err; | ||
return { | ||
s: function () { | ||
it = o[Symbol.iterator](); | ||
}, | ||
n: function () { | ||
var step = it.next(); | ||
normalCompletion = step.done; | ||
return step; | ||
}, | ||
e: function (e) { | ||
didErr = !0; | ||
err = e; | ||
}, | ||
f: function () { | ||
try { | ||
normalCompletion || null == it.return || it.return(); | ||
} finally { | ||
if (didErr) throw err; | ||
} | ||
} | ||
}; | ||
} | ||
const isArrayImpl = Array.isArray; | ||
class ClientReferenceDependency extends ModuleDependency { | ||
constructor(request) { | ||
super(request); | ||
} | ||
get type() { | ||
return "client-reference"; | ||
} | ||
} | ||
const clientFileName = require.resolve("../client.browser.js"); | ||
class ReactFlightWebpackPlugin { | ||
constructor(options) { | ||
this.serverConsumerManifestFilename = | ||
this.clientManifestFilename = | ||
this.chunkName = | ||
this.clientReferences = | ||
void 0; | ||
if (!options || "boolean" !== typeof options.isServer) | ||
throw Error( | ||
"React Server Plugin: You must specify the isServer option as a boolean." | ||
); | ||
if (options.isServer) throw Error("TODO: Implement the server compiler."); | ||
options.clientReferences | ||
? "string" !== typeof options.clientReferences && | ||
isArrayImpl(options.clientReferences) | ||
? (this.clientReferences = options.clientReferences) | ||
: (this.clientReferences = [options.clientReferences]) | ||
: (this.clientReferences = [ | ||
{ directory: ".", recursive: !0, include: /\.(js|ts|jsx|tsx)$/ } | ||
]); | ||
"string" === typeof options.chunkName | ||
? ((this.chunkName = options.chunkName), | ||
/\[(index|request)\]/.test(this.chunkName) || | ||
(this.chunkName += "[index]")) | ||
: (this.chunkName = "client[index]"); | ||
this.clientManifestFilename = | ||
options.clientManifestFilename || "react-client-manifest.json"; | ||
this.serverConsumerManifestFilename = | ||
options.serverConsumerManifestFilename || "react-ssr-manifest.json"; | ||
} | ||
apply(compiler) { | ||
const _this = this; | ||
let resolvedClientReferences, | ||
clientFileNameFound = !1; | ||
compiler.hooks.beforeCompile.tapAsync( | ||
"React Server Plugin", | ||
(_ref, callback) => { | ||
_ref = _ref.contextModuleFactory; | ||
const contextResolver = compiler.resolverFactory.get("context", {}), | ||
normalResolver = compiler.resolverFactory.get("normal"); | ||
_this.resolveAllClientFiles( | ||
compiler.context, | ||
contextResolver, | ||
normalResolver, | ||
compiler.inputFileSystem, | ||
_ref, | ||
function (err, resolvedClientRefs) { | ||
err | ||
? callback(err) | ||
: ((resolvedClientReferences = resolvedClientRefs), callback()); | ||
} | ||
); | ||
} | ||
); | ||
compiler.hooks.thisCompilation.tap( | ||
"React Server Plugin", | ||
(compilation, _ref2) => { | ||
_ref2 = _ref2.normalModuleFactory; | ||
compilation.dependencyFactories.set(ClientReferenceDependency, _ref2); | ||
compilation.dependencyTemplates.set( | ||
ClientReferenceDependency, | ||
new NullDependency.Template() | ||
); | ||
compilation = (parser) => { | ||
parser.hooks.program.tap("React Server Plugin", () => { | ||
const module = parser.state.module; | ||
if ( | ||
module.resource === clientFileName && | ||
((clientFileNameFound = !0), resolvedClientReferences) | ||
) | ||
for (let i = 0; i < resolvedClientReferences.length; i++) { | ||
const dep = resolvedClientReferences[i]; | ||
var chunkName = _this.chunkName | ||
.replace(/\[index\]/g, "" + i) | ||
.replace(/\[request\]/g, Template.toPath(dep.userRequest)); | ||
chunkName = new webpack.AsyncDependenciesBlock( | ||
{ name: chunkName }, | ||
null, | ||
dep.request | ||
); | ||
chunkName.addDependency(dep); | ||
module.addBlock(chunkName); | ||
} | ||
}); | ||
}; | ||
_ref2.hooks.parser | ||
.for("javascript/auto") | ||
.tap("HarmonyModulesPlugin", compilation); | ||
_ref2.hooks.parser | ||
.for("javascript/esm") | ||
.tap("HarmonyModulesPlugin", compilation); | ||
_ref2.hooks.parser | ||
.for("javascript/dynamic") | ||
.tap("HarmonyModulesPlugin", compilation); | ||
} | ||
); | ||
compiler.hooks.make.tap("React Server Plugin", (compilation) => { | ||
compilation.hooks.processAssets.tap( | ||
{ | ||
name: "React Server Plugin", | ||
stage: webpack.Compilation.PROCESS_ASSETS_STAGE_REPORT | ||
}, | ||
function () { | ||
if (!1 === clientFileNameFound) | ||
compilation.warnings.push( | ||
new webpack.WebpackError( | ||
"Client runtime at react-server-dom-webpack/client was not found. React Server Components module map file " + | ||
_this.clientManifestFilename + | ||
" was not created." | ||
) | ||
); | ||
else { | ||
var configuredCrossOriginLoading = | ||
compilation.outputOptions.crossOriginLoading; | ||
configuredCrossOriginLoading = | ||
"string" === typeof configuredCrossOriginLoading | ||
? "use-credentials" === configuredCrossOriginLoading | ||
? configuredCrossOriginLoading | ||
: "anonymous" | ||
: null; | ||
var resolvedClientFiles = new Set( | ||
(resolvedClientReferences || []).map((ref) => ref.request) | ||
), | ||
clientManifest = {}, | ||
moduleMap = {}; | ||
configuredCrossOriginLoading = { | ||
moduleLoading: { | ||
prefix: compilation.outputOptions.publicPath || "", | ||
crossOrigin: configuredCrossOriginLoading | ||
}, | ||
moduleMap | ||
}; | ||
var runtimeChunkFiles = new Set(); | ||
compilation.entrypoints.forEach((entrypoint) => { | ||
(entrypoint = entrypoint.getRuntimeChunk()) && | ||
entrypoint.files.forEach((runtimeFile) => { | ||
runtimeChunkFiles.add(runtimeFile); | ||
}); | ||
}); | ||
compilation.chunkGroups.forEach(function (chunkGroup) { | ||
function recordModule(id, module) { | ||
if ( | ||
resolvedClientFiles.has(module.resource) && | ||
((module = url.pathToFileURL(module.resource).href), | ||
void 0 !== module) | ||
) { | ||
const ssrExports = {}; | ||
clientManifest[module] = { id, chunks, name: "*" }; | ||
ssrExports["*"] = { specifier: module, name: "*" }; | ||
moduleMap[id] = ssrExports; | ||
} | ||
} | ||
const chunks = []; | ||
chunkGroup.chunks.forEach(function (c) { | ||
var _iterator = _createForOfIteratorHelper(c.files), | ||
_step; | ||
try { | ||
for (_iterator.s(); !(_step = _iterator.n()).done; ) { | ||
const file = _step.value; | ||
if (!file.endsWith(".js")) break; | ||
if (file.endsWith(".hot-update.js")) break; | ||
chunks.push(c.id, file); | ||
break; | ||
} | ||
} catch (err) { | ||
_iterator.e(err); | ||
} finally { | ||
_iterator.f(); | ||
} | ||
}); | ||
chunkGroup.chunks.forEach(function (chunk) { | ||
chunk = compilation.chunkGraph.getChunkModulesIterable(chunk); | ||
Array.from(chunk).forEach(function (module) { | ||
const moduleId = compilation.chunkGraph.getModuleId(module); | ||
recordModule(moduleId, module); | ||
module.modules && | ||
module.modules.forEach((concatenatedMod) => { | ||
recordModule(moduleId, concatenatedMod); | ||
}); | ||
}); | ||
}); | ||
}); | ||
var clientOutput = JSON.stringify(clientManifest, null, 2); | ||
compilation.emitAsset( | ||
_this.clientManifestFilename, | ||
new webpack.sources.RawSource(clientOutput, !1) | ||
); | ||
configuredCrossOriginLoading = JSON.stringify( | ||
configuredCrossOriginLoading, | ||
null, | ||
2 | ||
); | ||
compilation.emitAsset( | ||
_this.serverConsumerManifestFilename, | ||
new webpack.sources.RawSource(configuredCrossOriginLoading, !1) | ||
); | ||
} | ||
} | ||
); | ||
}); | ||
} | ||
resolveAllClientFiles( | ||
context, | ||
contextResolver, | ||
normalResolver, | ||
fs, | ||
contextModuleFactory, | ||
callback | ||
) { | ||
function hasUseClientDirective(source) { | ||
if (-1 === source.indexOf("use client")) return !1; | ||
let body; | ||
try { | ||
body = acorn.parse(source, { | ||
ecmaVersion: "2024", | ||
sourceType: "module" | ||
}).body; | ||
} catch (x) { | ||
return !1; | ||
} | ||
for (source = 0; source < body.length; source++) { | ||
const node = body[source]; | ||
if ("ExpressionStatement" !== node.type || !node.directive) break; | ||
if ("use client" === node.directive) return !0; | ||
} | ||
return !1; | ||
} | ||
asyncLib.map( | ||
this.clientReferences, | ||
(clientReferencePath, cb) => { | ||
"string" === typeof clientReferencePath | ||
? cb(null, [new ClientReferenceDependency(clientReferencePath)]) | ||
: contextResolver.resolve( | ||
{}, | ||
context, | ||
clientReferencePath.directory, | ||
{}, | ||
(err, resolvedDirectory) => { | ||
if (err) return cb(err); | ||
contextModuleFactory.resolveDependencies( | ||
fs, | ||
{ | ||
resource: resolvedDirectory, | ||
resourceQuery: "", | ||
recursive: | ||
void 0 === clientReferencePath.recursive | ||
? !0 | ||
: clientReferencePath.recursive, | ||
regExp: clientReferencePath.include, | ||
include: void 0, | ||
exclude: clientReferencePath.exclude | ||
}, | ||
(err2, deps) => { | ||
if (err2) return cb(err2); | ||
err2 = deps.map((dep) => { | ||
var request = path.join( | ||
resolvedDirectory, | ||
dep.userRequest | ||
); | ||
request = new ClientReferenceDependency(request); | ||
request.userRequest = dep.userRequest; | ||
return request; | ||
}); | ||
asyncLib.filter( | ||
err2, | ||
(clientRefDep, filterCb) => { | ||
normalResolver.resolve( | ||
{}, | ||
context, | ||
clientRefDep.request, | ||
{}, | ||
(err3, resolvedPath) => { | ||
if (err3 || "string" !== typeof resolvedPath) | ||
return filterCb(null, !1); | ||
fs.readFile( | ||
resolvedPath, | ||
"utf-8", | ||
(err4, content) => { | ||
if (err4 || "string" !== typeof content) | ||
return filterCb(null, !1); | ||
err4 = hasUseClientDirective(content); | ||
filterCb(null, err4); | ||
} | ||
); | ||
} | ||
); | ||
}, | ||
cb | ||
); | ||
} | ||
); | ||
} | ||
); | ||
}, | ||
(err, result) => { | ||
if (err) return callback(err); | ||
err = []; | ||
for (let i = 0; i < result.length; i++) err.push.apply(err, result[i]); | ||
callback(null, err); | ||
} | ||
); | ||
} | ||
} | ||
module.exports = ReactFlightWebpackPlugin; |
'use strict'; | ||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./cjs/react-server-dom-webpack-client.browser.production.min.js'); | ||
module.exports = require('./cjs/react-server-dom-webpack-client.browser.production.js'); | ||
} else { | ||
module.exports = require('./cjs/react-server-dom-webpack-client.browser.development.js'); | ||
} |
'use strict'; | ||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./cjs/react-server-dom-webpack-client.edge.production.min.js'); | ||
module.exports = require('./cjs/react-server-dom-webpack-client.edge.production.js'); | ||
} else { | ||
module.exports = require('./cjs/react-server-dom-webpack-client.edge.development.js'); | ||
} |
'use strict'; | ||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./cjs/react-server-dom-webpack-client.node.production.min.js'); | ||
module.exports = require('./cjs/react-server-dom-webpack-client.node.production.js'); | ||
} else { | ||
module.exports = require('./cjs/react-server-dom-webpack-client.node.development.js'); | ||
} |
'use strict'; | ||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./cjs/react-server-dom-webpack-client.node.unbundled.production.min.js'); | ||
module.exports = require('./cjs/react-server-dom-webpack-client.node.unbundled.production.js'); | ||
} else { | ||
module.exports = require('./cjs/react-server-dom-webpack-client.node.unbundled.development.js'); | ||
} |
{ | ||
"name": "react-server-dom-webpack", | ||
"description": "React Server Components bindings for DOM using Webpack. This is intended to be integrated into meta-frameworks. It is not intended to be imported directly.", | ||
"version": "0.0.0-experimental-41f0e9dae-20230907", | ||
"version": "0.0.0-experimental-42687267-20250108", | ||
"keywords": [ | ||
"react" | ||
], | ||
"homepage": "https://reactjs.org/", | ||
"homepage": "https://react.dev/", | ||
"bugs": "https://github.com/facebook/react/issues", | ||
@@ -26,5 +26,9 @@ "license": "MIT", | ||
"server.node.unbundled.js", | ||
"static.js", | ||
"static.browser.js", | ||
"static.edge.js", | ||
"static.node.js", | ||
"static.node.unbundled.js", | ||
"node-register.js", | ||
"cjs/", | ||
"umd/", | ||
"esm/" | ||
@@ -68,3 +72,20 @@ ], | ||
"./server.node.unbundled": "./server.node.unbundled.js", | ||
"./node-loader": "./esm/react-server-dom-webpack-node-loader.production.min.js", | ||
"./static": { | ||
"react-server": { | ||
"workerd": "./static.edge.js", | ||
"deno": "./static.browser.js", | ||
"node": { | ||
"webpack": "./static.node.js", | ||
"default": "./static.node.unbundled.js" | ||
}, | ||
"edge-light": "./static.edge.js", | ||
"browser": "./static.browser.js" | ||
}, | ||
"default": "./static.js" | ||
}, | ||
"./static.browser": "./static.browser.js", | ||
"./static.edge": "./static.edge.js", | ||
"./static.node": "./static.node.js", | ||
"./static.node.unbundled": "./static.node.unbundled.js", | ||
"./node-loader": "./esm/react-server-dom-webpack-node-loader.production.js", | ||
"./node-register": "./node-register.js", | ||
@@ -83,4 +104,4 @@ "./package.json": "./package.json" | ||
"peerDependencies": { | ||
"react": "0.0.0-experimental-41f0e9dae-20230907", | ||
"react-dom": "0.0.0-experimental-41f0e9dae-20230907", | ||
"react": "0.0.0-experimental-42687267-20250108", | ||
"react-dom": "0.0.0-experimental-42687267-20250108", | ||
"webpack": "^5.59.0" | ||
@@ -91,9 +112,4 @@ }, | ||
"neo-async": "^2.6.1", | ||
"loose-envify": "^1.1.0" | ||
}, | ||
"browserify": { | ||
"transform": [ | ||
"loose-envify" | ||
] | ||
"webpack-sources": "^3.2.0" | ||
} | ||
} |
'use strict'; | ||
var s; | ||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./cjs/react-server-dom-webpack-server.browser.production.min.js'); | ||
s = require('./cjs/react-server-dom-webpack-server.browser.production.js'); | ||
} else { | ||
module.exports = require('./cjs/react-server-dom-webpack-server.browser.development.js'); | ||
s = require('./cjs/react-server-dom-webpack-server.browser.development.js'); | ||
} | ||
exports.renderToReadableStream = s.renderToReadableStream; | ||
exports.decodeReply = s.decodeReply; | ||
exports.decodeAction = s.decodeAction; | ||
exports.decodeFormState = s.decodeFormState; | ||
exports.registerServerReference = s.registerServerReference; | ||
exports.registerClientReference = s.registerClientReference; | ||
exports.createClientModuleProxy = s.createClientModuleProxy; | ||
exports.createTemporaryReferenceSet = s.createTemporaryReferenceSet; |
'use strict'; | ||
var s; | ||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./cjs/react-server-dom-webpack-server.edge.production.min.js'); | ||
s = require('./cjs/react-server-dom-webpack-server.edge.production.js'); | ||
} else { | ||
module.exports = require('./cjs/react-server-dom-webpack-server.edge.development.js'); | ||
s = require('./cjs/react-server-dom-webpack-server.edge.development.js'); | ||
} | ||
exports.renderToReadableStream = s.renderToReadableStream; | ||
exports.decodeReply = s.decodeReply; | ||
exports.decodeReplyFromAsyncIterable = s.decodeReplyFromAsyncIterable; | ||
exports.decodeAction = s.decodeAction; | ||
exports.decodeFormState = s.decodeFormState; | ||
exports.registerServerReference = s.registerServerReference; | ||
exports.registerClientReference = s.registerClientReference; | ||
exports.createClientModuleProxy = s.createClientModuleProxy; | ||
exports.createTemporaryReferenceSet = s.createTemporaryReferenceSet; |
'use strict'; | ||
var s; | ||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./cjs/react-server-dom-webpack-server.node.production.min.js'); | ||
s = require('./cjs/react-server-dom-webpack-server.node.production.js'); | ||
} else { | ||
module.exports = require('./cjs/react-server-dom-webpack-server.node.development.js'); | ||
s = require('./cjs/react-server-dom-webpack-server.node.development.js'); | ||
} | ||
exports.renderToPipeableStream = s.renderToPipeableStream; | ||
exports.decodeReplyFromBusboy = s.decodeReplyFromBusboy; | ||
exports.decodeReply = s.decodeReply; | ||
exports.decodeAction = s.decodeAction; | ||
exports.decodeFormState = s.decodeFormState; | ||
exports.registerServerReference = s.registerServerReference; | ||
exports.registerClientReference = s.registerClientReference; | ||
exports.createClientModuleProxy = s.createClientModuleProxy; | ||
exports.createTemporaryReferenceSet = s.createTemporaryReferenceSet; |
'use strict'; | ||
var s; | ||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./cjs/react-server-dom-webpack-server.node.unbundled.production.min.js'); | ||
s = require('./cjs/react-server-dom-webpack-server.node.unbundled.production.js'); | ||
} else { | ||
module.exports = require('./cjs/react-server-dom-webpack-server.node.unbundled.development.js'); | ||
s = require('./cjs/react-server-dom-webpack-server.node.unbundled.development.js'); | ||
} | ||
exports.renderToPipeableStream = s.renderToPipeableStream; | ||
exports.decodeReplyFromBusboy = s.decodeReplyFromBusboy; | ||
exports.decodeReply = s.decodeReply; | ||
exports.decodeAction = s.decodeAction; | ||
exports.decodeFormState = s.decodeFormState; | ||
exports.registerServerReference = s.registerServerReference; | ||
exports.registerClientReference = s.registerClientReference; | ||
exports.createClientModuleProxy = s.createClientModuleProxy; | ||
exports.createTemporaryReferenceSet = s.createTemporaryReferenceSet; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 2 instances in 1 package
1750878
41
49702
1
25
12
+ Addedwebpack-sources@^3.2.0
+ Addedreact@0.0.0-experimental-42687267-20250108(transitive)
+ Addedreact-dom@0.0.0-experimental-42687267-20250108(transitive)
+ Addedscheduler@0.0.0-experimental-42687267-20250108(transitive)
- Removedloose-envify@^1.1.0
- Removedjs-tokens@4.0.0(transitive)
- Removedloose-envify@1.4.0(transitive)
- Removedreact@0.0.0-experimental-41f0e9dae-20230907(transitive)
- Removedreact-dom@0.0.0-experimental-41f0e9dae-20230907(transitive)
- Removedscheduler@0.0.0-experimental-41f0e9dae-20230907(transitive)