tamagui-loader 3.0.0-beta.924.1 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs +1 -1
- package/dist/cjs/zeroRuntime.cjs +1 -1
- package/dist/esm/loader.mjs +1 -1
- package/dist/esm/loader.mjs.map +1 -1
- package/dist/esm/requireResolve.mjs +1 -6
- package/dist/esm/zeroRuntime.mjs +1 -1
- package/dist/esm/zeroRuntime.mjs.map +1 -1
- package/package.json +10 -8
- package/src/loader.ts +1 -1
- package/src/zeroRuntime.ts +2 -2
- package/types/zeroRuntime.d.ts +1 -1
package/dist/cjs/loader.cjs
CHANGED
|
@@ -42,7 +42,7 @@ const loader = async function loader2(sourceIn) {
|
|
|
42
42
|
this.cacheable(true);
|
|
43
43
|
const callback = this.async();
|
|
44
44
|
const sourcePath = `${this.resourcePath}`;
|
|
45
|
-
if (sourcePath.includes("node_modules") || sourcePath.includes("
|
|
45
|
+
if (sourcePath.includes("node_modules") || sourcePath.includes("local-icons")) return callback(null, sourceIn);
|
|
46
46
|
const source = sourceIn.toString();
|
|
47
47
|
try {
|
|
48
48
|
const options = {
|
package/dist/cjs/zeroRuntime.cjs
CHANGED
|
@@ -161,7 +161,7 @@ async function buildWebpackIsland(input) {
|
|
|
161
161
|
},
|
|
162
162
|
plugins: [new input.webpack.ProvidePlugin(input.defines.provide), new input.webpack.DefinePlugin({
|
|
163
163
|
...input.defines.define,
|
|
164
|
-
"process.env.TAMAGUI_RUNTIME": JSON.stringify("
|
|
164
|
+
"process.env.TAMAGUI_RUNTIME": JSON.stringify("island"),
|
|
165
165
|
"process.env.TAMAGUI_DID_OUTPUT_CSS": JSON.stringify("1"),
|
|
166
166
|
"process.env.TAMAGUI_TARGET": JSON.stringify("web"),
|
|
167
167
|
"process.env.TAMAGUI_IS_SERVER": JSON.stringify(""),
|
package/dist/esm/loader.mjs
CHANGED
|
@@ -14,7 +14,7 @@ const loader = async function loader2(sourceIn) {
|
|
|
14
14
|
this.cacheable(true);
|
|
15
15
|
const callback = this.async();
|
|
16
16
|
const sourcePath = `${this.resourcePath}`;
|
|
17
|
-
if (sourcePath.includes("node_modules") || sourcePath.includes("
|
|
17
|
+
if (sourcePath.includes("node_modules") || sourcePath.includes("local-icons")) return callback(null, sourceIn);
|
|
18
18
|
const source = sourceIn.toString();
|
|
19
19
|
try {
|
|
20
20
|
const options = {
|
package/dist/esm/loader.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.js","names":[],"sources":["esm/loader.js"],"sourcesContent":["import Static from \"@tamagui/static\";\nimport { createHash } from \"node:crypto\";\nimport { readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { cssLoaderPath } from \"./css\";\nimport { getWebpackZeroController, publishZeroBuildInfo, zeroModuleKey } from \"./zeroRuntime\";\n\nconst { getPragmaOptions, isTamaguiSpecifier } = Static;\nError.stackTraceLimit = Number.POSITIVE_INFINITY;\nlet index = 0;\nconst compilerFrontends = /* @__PURE__ */ new Map();\nprocess.env.TAMAGUI_TARGET = \"web\";\nconst loader = async function loader2(sourceIn) {\n\tthis.cacheable(true);\n\tconst callback = this.async();\n\tconst sourcePath = `${this.resourcePath}`;\n\tif (sourcePath.includes(\"node_modules\") || sourcePath.includes(\"
|
|
1
|
+
{"version":3,"file":"loader.js","names":[],"sources":["esm/loader.js"],"sourcesContent":["import Static from \"@tamagui/static\";\nimport { createHash } from \"node:crypto\";\nimport { readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { cssLoaderPath } from \"./css\";\nimport { getWebpackZeroController, publishZeroBuildInfo, zeroModuleKey } from \"./zeroRuntime\";\n\nconst { getPragmaOptions, isTamaguiSpecifier } = Static;\nError.stackTraceLimit = Number.POSITIVE_INFINITY;\nlet index = 0;\nconst compilerFrontends = /* @__PURE__ */ new Map();\nprocess.env.TAMAGUI_TARGET = \"web\";\nconst loader = async function loader2(sourceIn) {\n\tthis.cacheable(true);\n\tconst callback = this.async();\n\tconst sourcePath = `${this.resourcePath}`;\n\tif (sourcePath.includes(\"node_modules\") || sourcePath.includes(\"local-icons\")) return callback(null, sourceIn);\n\tconst source = sourceIn.toString();\n\ttry {\n\t\tconst options = {\n\t\t\tplatform: \"web\",\n\t\t\t...this.getOptions()\n\t\t};\n\t\tconst { shouldDisable, shouldPrintDebug } = await getPragmaOptions({\n\t\t\tsource,\n\t\t\tpath: sourcePath\n\t\t});\n\t\tif (shouldPrintDebug === \"verbose\") {\n\t\t\tconsole.warn(`\n\n --- Incoming source --- \n\n`);\n\t\t\tconsole.warn(source);\n\t\t}\n\t\tif (options.disableExtraction || shouldDisable) {\n\t\t\tif (shouldPrintDebug) console.info(options.disableExtraction ? \"Disabling extraction via loader options\" : \"Disabling on file via pragma\");\n\t\t\treturn callback(null, source);\n\t\t}\n\t\tconst cssPath = `${sourcePath}.${index++}.tamagui.css`;\n\t\tconst root = this.rootContext || process.cwd();\n\t\tconst key = createHash(\"sha256\").update(root).update(\"\\0\").update(options.config || \"tamagui.config.ts\").update(\"\\0\").update(JSON.stringify(options.components || [])).digest(\"hex\");\n\t\tlet compiler = compilerFrontends.get(key);\n\t\tif (!compiler) {\n\t\t\tcompiler = new Static.CompilerFrontend();\n\t\t\tcompilerFrontends.set(key, compiler);\n\t\t}\n\t\tconst zero = getWebpackZeroController(options, root);\n\t\tconst webpackResolve = this.getResolve({});\n\t\tconst project = await Static.loadCompilerProject({\n\t\t\troot,\n\t\t\ttarget: \"web\",\n\t\t\toptions,\n\t\t\tgeneration: key,\n\t\t\tmissingProjectMessage: \"Unable to load the Tamagui project for webpack compilation\",\n\t\t\tasync resolveComponents(moduleNames) {\n\t\t\t\treturn Promise.all(moduleNames.map(async (moduleName) => ({\n\t\t\t\t\tmoduleName,\n\t\t\t\t\tid: await webpackResolve(path.dirname(sourcePath), moduleName)\n\t\t\t\t})));\n\t\t\t}\n\t\t});\n\t\tconst { projectInfo } = project;\n\t\tconst extracted = await compiler.compile({\n\t\t\tid: sourcePath,\n\t\t\tsource,\n\t\t\troot,\n\t\t\ttarget: \"web\",\n\t\t\tproject,\n\t\t\tresolve: async (specifier, importer) => {\n\t\t\t\ttry {\n\t\t\t\t\treturn { id: await webpackResolve(path.dirname(importer), specifier) };\n\t\t\t\t} catch {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t},\n\t\t\tload: async (id) => {\n\t\t\t\ttry {\n\t\t\t\t\treturn await readFile(id.split(/[?#]/, 1)[0], \"utf8\");\n\t\t\t\t} catch {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tif (zero?.islandBuild) {\n\t\t\tpublishZeroBuildInfo(zero, this, {\n\t\t\t\tisland: zero.islandBuild,\n\t\t\t\tcss: extracted.plan.css,\n\t\t\t\tbridgeCSS: [],\n\t\t\t\tbridges: [],\n\t\t\t\tviolations: [],\n\t\t\t\terasedExports: []\n\t\t\t});\n\t\t\treturn callback(null, extracted.output.code, extracted.output.map);\n\t\t}\n\t\tif (zero) {\n\t\t\tconst relative = path.relative(root, sourcePath);\n\t\t\tif (!(relative !== \"\" && !relative.startsWith(`..${path.sep}`) && !relative.split(path.sep).includes(\"node_modules\"))) return callback(null, extracted.output.code, extracted.output.map);\n\t\t\tconst zeroResult = Static.transformZeroModule({\n\t\t\t\tmode: zero.isEnforcing ? \"enforce\" : \"report\",\n\t\t\t\tid: sourcePath,\n\t\t\t\troot,\n\t\t\t\tsource,\n\t\t\t\tplan: extracted.plan,\n\t\t\t\tconfig: projectInfo.tamaguiConfig,\n\t\t\t\tisTamaguiSpecifier,\n\t\t\t\tresolveIslandLoader: (specifier) => {\n\t\t\t\t\tconst islandId = zero.loaderIds.get(zeroModuleKey(path.resolve(path.dirname(sourcePath), specifier)));\n\t\t\t\t\treturn islandId ? { islandId } : null;\n\t\t\t\t},\n\t\t\t\tresolveIslandModule: (specifier) => zero.islandModuleIds.get(zeroModuleKey(path.resolve(path.dirname(sourcePath), specifier))) ?? null\n\t\t\t});\n\t\t\tpublishZeroBuildInfo(zero, this, {\n\t\t\t\tisland: null,\n\t\t\t\tcss: extracted.plan.css,\n\t\t\t\tbridgeCSS: [...zeroResult.bridgeCSS],\n\t\t\t\tbridges: [...zeroResult.bridges],\n\t\t\t\tviolations: zeroResult.violations.map((violation) => {\n\t\t\t\t\tconst { line, column } = Static.offsetToLineColumn(source, violation.span.start);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tfile: path.relative(root, sourcePath),\n\t\t\t\t\t\tline,\n\t\t\t\t\t\tcolumn,\n\t\t\t\t\t\trule: violation.rule,\n\t\t\t\t\t\tcode: violation.code,\n\t\t\t\t\t\tcomponent: violation.component,\n\t\t\t\t\t\tmessage: violation.message\n\t\t\t\t\t};\n\t\t\t\t}),\n\t\t\t\terasedExports: zeroResult.erased.exports\n\t\t\t});\n\t\t\tif (zero.isEnforcing) return callback(null, zeroResult.output.code, zeroResult.output.map);\n\t\t}\n\t\tlet code = extracted.output.code;\n\t\tif (extracted.plan.css) {\n\t\t\tconst importPath = `${cssPath}!=!${cssLoaderPath}?${`cssData=${Buffer.from(extracted.plan.css).toString(\"base64url\")}`}!${this.remainingRequest}`;\n\t\t\tcode = `${code}\n\nrequire(${JSON.stringify(importPath)})`;\n\t\t}\n\t\tcallback(null, code, extracted.output.map);\n\t} catch (err) {\n\t\tconst message = err instanceof Error ? `${err.message}\n${err.stack}` : String(err);\n\t\tconsole.error(\"Tamagui Webpack Loader Error:\\n\", ` ${message}\n`);\n\t\tif (message.includes(\"Cannot create proxy\")) console.info(\"This is usually due to components not loading at build-time. Check for logs just below the line above:\");\n\t\tcallback(err instanceof Error ? err : new Error(message));\n\t}\n};\n\nexport { loader };"],"mappings":";;;;;;;;AAOA,MAAM,EAAE,kBAAkB,uBAAuB;AACjD,MAAM,kBAAkB,OAAO;AAC/B,IAAI,QAAQ;AACZ,MAAM,oCAAoC,IAAI,IAAI;AAClD,QAAQ,IAAI,iBAAiB;AAC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K,SAAS,eAAe,QAAQ,MAAM,IAAI,MAAM,OAAO,CAAC;CACzD;AACD"}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
-
throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
const requireResolve = "url" in import.meta ? createRequire(import.meta.url).resolve : __require.resolve;
|
|
3
|
+
const requireResolve = "url" in import.meta ? createRequire(import.meta.url).resolve : require.resolve;
|
|
9
4
|
|
|
10
5
|
export { requireResolve };
|
|
11
6
|
//# sourceMappingURL=requireResolve.mjs.map
|
package/dist/esm/zeroRuntime.mjs
CHANGED
|
@@ -122,7 +122,7 @@ async function buildWebpackIsland(input) {
|
|
|
122
122
|
},
|
|
123
123
|
plugins: [new input.webpack.ProvidePlugin(input.defines.provide), new input.webpack.DefinePlugin({
|
|
124
124
|
...input.defines.define,
|
|
125
|
-
"process.env.TAMAGUI_RUNTIME": JSON.stringify("
|
|
125
|
+
"process.env.TAMAGUI_RUNTIME": JSON.stringify("island"),
|
|
126
126
|
"process.env.TAMAGUI_DID_OUTPUT_CSS": JSON.stringify("1"),
|
|
127
127
|
"process.env.TAMAGUI_TARGET": JSON.stringify("web"),
|
|
128
128
|
"process.env.TAMAGUI_IS_SERVER": JSON.stringify(""),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zeroRuntime.js","names":[],"sources":["esm/zeroRuntime.js"],"sourcesContent":["import Static from \"@tamagui/static\";\nimport { createHash } from \"node:crypto\";\nimport { readFileSync } from \"node:fs\";\nimport path from \"node:path\";\n\nconst ZERO_CSS_FILENAME = \"tamagui-zero.css\";\nconst ZERO_ISLAND_DIRNAME = \"tamagui-islands\";\nconst normalizePath = (value) => value.replace(/\\\\/g, \"/\");\nconst zeroModuleKey = (value) => normalizePath(value).replace(/\\.(?:js|jsx|ts|tsx|mjs|cjs)$/, \"\");\nconst CONTROLLERS_KEY = \"__tamagui_webpack_zero_controllers__\";\nconst controllers = globalThis[CONTROLLERS_KEY] ||= /* @__PURE__ */ new Map();\nfunction getWebpackZeroController(options, root) {\n\tconst resolved = Static.resolveZeroRuntimeSync(options, root);\n\tif (resolved.mode === \"off\") return null;\n\tStatic.assertZeroIntegrationSupport(\"next-webpack\", resolved);\n\tconst existing = controllers.get(root);\n\tif (existing) return existing;\n\tconst publicDir = path.join(root, \"public\");\n\tconst cssHref = `/${ZERO_CSS_FILENAME}`;\n\tconst artifact = new Static.ZeroCSSArtifact(resolved.cssPath);\n\tartifact.expectIslands(resolved.islands.map((island) => island.id));\n\tconst configPath = path.isAbsolute(options.config || \"\") ? options.config : path.resolve(root, options.config || \"tamagui.config.ts\");\n\tfor (const island of resolved.islands) Static.writeIslandModules({\n\t\tisland,\n\t\tintegration: \"next-webpack\",\n\t\tconfigPath,\n\t\tscriptUrl: `/${ZERO_ISLAND_DIRNAME}/${island.id}.js`,\n\t\tcssHref\n\t});\n\tconst controller = {\n\t\toptions,\n\t\tresolved,\n\t\tartifact,\n\t\tcssHref,\n\t\troot,\n\t\tpublicDir,\n\t\tbridges: /* @__PURE__ */ new Map(),\n\t\tviolations: [],\n\t\tloaderIds: new Map(resolved.islands.map((island) => [zeroModuleKey(island.loader), island.id])),\n\t\tislandModuleIds: new Map(resolved.islands.map((island) => [zeroModuleKey(island.module), island.id])),\n\t\tislandBuild: null,\n\t\tloaderModules: /* @__PURE__ */ new Set(),\n\t\tisEnforcing: resolved.mode === \"enforce\",\n\t\tconfigHash: \"\"\n\t};\n\tcontrollers.set(root, controller);\n\treturn controller;\n}\nconst BUILD_INFO_KEY = \"tamaguiZero\";\nfunction publishZeroBuildInfo(controller, context, info) {\n\tconst buildInfo = context._module?.buildInfo;\n\tif (!buildInfo) throw new Error(`[tamagui zero-runtime] webpack gave the Tamagui loader no module record for ${context.resourcePath}, so this module's CSS could not be carried into the one generated artifact.`);\n\tbuildInfo[BUILD_INFO_KEY] = info;\n\tcontroller.loaderModules.add(context.resourcePath);\n}\nfunction readZeroBuildInfo(module) {\n\treturn module?.buildInfo?.[BUILD_INFO_KEY] ?? null;\n}\nfunction* flattenModules(modules) {\n\tfor (const module of modules) {\n\t\tyield module;\n\t\tconst inner = module.modules;\n\t\tif (inner) yield* flattenModules(inner);\n\t}\n}\nfunction collectZeroBuildInfo(controller, modules) {\n\tlet seen = 0;\n\tlet restored = 0;\n\tconst transformed = /* @__PURE__ */ new Set();\n\tconst erasedExports = /* @__PURE__ */ new Map();\n\tconst visited = /* @__PURE__ */ new Set();\n\tfor (const module of flattenModules(modules)) {\n\t\tconst info = readZeroBuildInfo(module);\n\t\tif (!info) continue;\n\t\tconst resource = module.resource;\n\t\tif (visited.has(resource)) continue;\n\t\tvisited.add(resource);\n\t\tseen++;\n\t\tif (!controller.loaderModules.has(resource)) restored++;\n\t\tif (info.island) {\n\t\t\tcontroller.artifact.setIslandModuleCSS(info.island, resource, info.css);\n\t\t\tcontinue;\n\t\t}\n\t\ttransformed.add(resource);\n\t\tif (info.erasedExports.length) erasedExports.set(resource, info.erasedExports);\n\t\tcontroller.artifact.setZeroModuleCSS(resource, info.css);\n\t\tfor (const [identifier, rules] of info.bridgeCSS) controller.artifact.setBridgeRules(identifier, rules);\n\t\tStatic.mergeIslandBridges(controller.bridges, new Map(info.bridges));\n\t\tcontroller.violations.push(...info.violations);\n\t}\n\treturn {\n\t\tmodules: seen,\n\t\trestored,\n\t\ttransformed,\n\t\terasedExports\n\t};\n}\nasync function buildWebpackIsland(input) {\n\tconst { controller, island } = input;\n\tconst outputPath = path.join(controller.publicDir, ZERO_ISLAND_DIRNAME);\n\tcontroller.islandBuild = island.id;\n\ttry {\n\t\tawait new Promise((resolve, reject) => {\n\t\t\tinput.webpack({\n\t\t\t\tmode: input.mode,\n\t\t\t\tdevtool: false,\n\t\t\t\tentry: island.entry,\n\t\t\t\tcontext: controller.root,\n\t\t\t\ttarget: \"web\",\n\t\t\t\tresolve: input.resolve,\n\t\t\t\tmodule: { rules: input.moduleRules },\n\t\t\t\texternalsType: \"global\",\n\t\t\t\texternals: { ...Static.ISLAND_EXTERNAL_GLOBAL_PATHS },\n\t\t\t\toutput: {\n\t\t\t\t\tpath: outputPath,\n\t\t\t\t\tfilename: `${island.id}.js`,\n\t\t\t\t\tiife: true,\n\t\t\t\t\tlibrary: {\n\t\t\t\t\t\ttype: \"var\",\n\t\t\t\t\t\tname: `tamaguiIsland_${island.id}`\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tplugins: [new input.webpack.ProvidePlugin(input.defines.provide), new input.webpack.DefinePlugin({\n\t\t\t\t\t...input.defines.define,\n\t\t\t\t\t\"process.env.TAMAGUI_RUNTIME\": JSON.stringify(\"full\"),\n\t\t\t\t\t\"process.env.TAMAGUI_DID_OUTPUT_CSS\": JSON.stringify(\"1\"),\n\t\t\t\t\t\"process.env.TAMAGUI_TARGET\": JSON.stringify(\"web\"),\n\t\t\t\t\t\"process.env.TAMAGUI_IS_SERVER\": JSON.stringify(\"\"),\n\t\t\t\t\t\"process.env.TAMAGUI_ENVIRONMENT\": JSON.stringify(\"client\"),\n\t\t\t\t\t\"process.env.IS_STATIC\": JSON.stringify(\"\"),\n\t\t\t\t\t\"process.env.NODE_ENV\": JSON.stringify(\"production\"),\n\t\t\t\t\t__DEV__: JSON.stringify(false)\n\t\t\t\t})]\n\t\t\t}, (error, stats) => {\n\t\t\t\tif (error) return reject(error);\n\t\t\t\tif (stats?.hasErrors()) return reject(new Error(stats.toString({\n\t\t\t\t\tall: false,\n\t\t\t\t\terrors: true\n\t\t\t\t})));\n\t\t\t\tif (stats) collectZeroBuildInfo(controller, stats.compilation.modules);\n\t\t\t\tresolve();\n\t\t\t});\n\t\t});\n\t} finally {\n\t\tcontroller.islandBuild = null;\n\t}\n\tconst file = path.join(outputPath, `${island.id}.js`);\n\tcontroller.artifact.markIslandComplete(island.id);\n\treturn {\n\t\tfile,\n\t\thash: createHash(\"sha256\").update(readFileSync(file)).digest(\"hex\").slice(0, 16)\n\t};\n}\nfunction collectDefinitions(compiler) {\n\tconst define = {};\n\tconst provide = {};\n\tfor (const plugin of compiler.options.plugins ?? []) {\n\t\tconst candidate = plugin;\n\t\tif (!candidate?.definitions) continue;\n\t\tif (plugin?.constructor?.name === \"DefinePlugin\") Object.assign(define, candidate.definitions);\n\t\telse if (plugin?.constructor?.name === \"ProvidePlugin\") Object.assign(provide, candidate.definitions);\n\t}\n\treturn {\n\t\tdefine,\n\t\tprovide\n\t};\n}\n\nexport { ZERO_CSS_FILENAME, ZERO_ISLAND_DIRNAME, buildWebpackIsland, collectDefinitions, collectZeroBuildInfo, flattenModules, getWebpackZeroController, publishZeroBuildInfo, readZeroBuildInfo, zeroModuleKey };"],"mappings":";;;;;;AAKA,MAAM,oBAAoB;AAC1B,MAAM,sBAAsB;AAC5B,MAAM,iBAAiB,UAAU,MAAM,QAAQ,OAAO,GAAG;AACzD,MAAM,iBAAiB,UAAU,cAAc,KAAK,CAAC,CAAC,QAAQ,gCAAgC,EAAE;AAChG,MAAM,kBAAkB;AACxB,MAAM,cAAc,WAAW,qCAAqC,IAAI,IAAI;AAC5E,SAAS,yBAAyB,SAAS,MAAM;CAChD,MAAM,WAAW,OAAO,uBAAuB,SAAS,IAAI;CAC5D,IAAI,SAAS,SAAS,OAAO,OAAO;CACpC,OAAO,6BAA6B,gBAAgB,QAAQ;CAC5D,MAAM,WAAW,YAAY,IAAI,IAAI;CACrC,IAAI,UAAU,OAAO;CACrB,MAAM,YAAY,KAAK,KAAK,MAAM,QAAQ;CAC1C,MAAM,UAAU,IAAI;CACpB,MAAM,WAAW,IAAI,OAAO,gBAAgB,SAAS,OAAO;CAC5D,SAAS,cAAc,SAAS,QAAQ,KAAK,WAAW,OAAO,EAAE,CAAC;CAClE,MAAM,aAAa,KAAK,WAAW,QAA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AO;EACN;EACA;CACD;AACD"}
|
|
1
|
+
{"version":3,"file":"zeroRuntime.js","names":[],"sources":["esm/zeroRuntime.js"],"sourcesContent":["import Static from \"@tamagui/static\";\nimport { createHash } from \"node:crypto\";\nimport { readFileSync } from \"node:fs\";\nimport path from \"node:path\";\n\nconst ZERO_CSS_FILENAME = \"tamagui-zero.css\";\nconst ZERO_ISLAND_DIRNAME = \"tamagui-islands\";\nconst normalizePath = (value) => value.replace(/\\\\/g, \"/\");\nconst zeroModuleKey = (value) => normalizePath(value).replace(/\\.(?:js|jsx|ts|tsx|mjs|cjs)$/, \"\");\nconst CONTROLLERS_KEY = \"__tamagui_webpack_zero_controllers__\";\nconst controllers = globalThis[CONTROLLERS_KEY] ||= /* @__PURE__ */ new Map();\nfunction getWebpackZeroController(options, root) {\n\tconst resolved = Static.resolveZeroRuntimeSync(options, root);\n\tif (resolved.mode === \"off\") return null;\n\tStatic.assertZeroIntegrationSupport(\"next-webpack\", resolved);\n\tconst existing = controllers.get(root);\n\tif (existing) return existing;\n\tconst publicDir = path.join(root, \"public\");\n\tconst cssHref = `/${ZERO_CSS_FILENAME}`;\n\tconst artifact = new Static.ZeroCSSArtifact(resolved.cssPath);\n\tartifact.expectIslands(resolved.islands.map((island) => island.id));\n\tconst configPath = path.isAbsolute(options.config || \"\") ? options.config : path.resolve(root, options.config || \"tamagui.config.ts\");\n\tfor (const island of resolved.islands) Static.writeIslandModules({\n\t\tisland,\n\t\tintegration: \"next-webpack\",\n\t\tconfigPath,\n\t\tscriptUrl: `/${ZERO_ISLAND_DIRNAME}/${island.id}.js`,\n\t\tcssHref\n\t});\n\tconst controller = {\n\t\toptions,\n\t\tresolved,\n\t\tartifact,\n\t\tcssHref,\n\t\troot,\n\t\tpublicDir,\n\t\tbridges: /* @__PURE__ */ new Map(),\n\t\tviolations: [],\n\t\tloaderIds: new Map(resolved.islands.map((island) => [zeroModuleKey(island.loader), island.id])),\n\t\tislandModuleIds: new Map(resolved.islands.map((island) => [zeroModuleKey(island.module), island.id])),\n\t\tislandBuild: null,\n\t\tloaderModules: /* @__PURE__ */ new Set(),\n\t\tisEnforcing: resolved.mode === \"enforce\",\n\t\tconfigHash: \"\"\n\t};\n\tcontrollers.set(root, controller);\n\treturn controller;\n}\nconst BUILD_INFO_KEY = \"tamaguiZero\";\nfunction publishZeroBuildInfo(controller, context, info) {\n\tconst buildInfo = context._module?.buildInfo;\n\tif (!buildInfo) throw new Error(`[tamagui zero-runtime] webpack gave the Tamagui loader no module record for ${context.resourcePath}, so this module's CSS could not be carried into the one generated artifact.`);\n\tbuildInfo[BUILD_INFO_KEY] = info;\n\tcontroller.loaderModules.add(context.resourcePath);\n}\nfunction readZeroBuildInfo(module) {\n\treturn module?.buildInfo?.[BUILD_INFO_KEY] ?? null;\n}\nfunction* flattenModules(modules) {\n\tfor (const module of modules) {\n\t\tyield module;\n\t\tconst inner = module.modules;\n\t\tif (inner) yield* flattenModules(inner);\n\t}\n}\nfunction collectZeroBuildInfo(controller, modules) {\n\tlet seen = 0;\n\tlet restored = 0;\n\tconst transformed = /* @__PURE__ */ new Set();\n\tconst erasedExports = /* @__PURE__ */ new Map();\n\tconst visited = /* @__PURE__ */ new Set();\n\tfor (const module of flattenModules(modules)) {\n\t\tconst info = readZeroBuildInfo(module);\n\t\tif (!info) continue;\n\t\tconst resource = module.resource;\n\t\tif (visited.has(resource)) continue;\n\t\tvisited.add(resource);\n\t\tseen++;\n\t\tif (!controller.loaderModules.has(resource)) restored++;\n\t\tif (info.island) {\n\t\t\tcontroller.artifact.setIslandModuleCSS(info.island, resource, info.css);\n\t\t\tcontinue;\n\t\t}\n\t\ttransformed.add(resource);\n\t\tif (info.erasedExports.length) erasedExports.set(resource, info.erasedExports);\n\t\tcontroller.artifact.setZeroModuleCSS(resource, info.css);\n\t\tfor (const [identifier, rules] of info.bridgeCSS) controller.artifact.setBridgeRules(identifier, rules);\n\t\tStatic.mergeIslandBridges(controller.bridges, new Map(info.bridges));\n\t\tcontroller.violations.push(...info.violations);\n\t}\n\treturn {\n\t\tmodules: seen,\n\t\trestored,\n\t\ttransformed,\n\t\terasedExports\n\t};\n}\nasync function buildWebpackIsland(input) {\n\tconst { controller, island } = input;\n\tconst outputPath = path.join(controller.publicDir, ZERO_ISLAND_DIRNAME);\n\tcontroller.islandBuild = island.id;\n\ttry {\n\t\tawait new Promise((resolve, reject) => {\n\t\t\tinput.webpack({\n\t\t\t\tmode: input.mode,\n\t\t\t\tdevtool: false,\n\t\t\t\tentry: island.entry,\n\t\t\t\tcontext: controller.root,\n\t\t\t\ttarget: \"web\",\n\t\t\t\tresolve: input.resolve,\n\t\t\t\tmodule: { rules: input.moduleRules },\n\t\t\t\texternalsType: \"global\",\n\t\t\t\texternals: { ...Static.ISLAND_EXTERNAL_GLOBAL_PATHS },\n\t\t\t\toutput: {\n\t\t\t\t\tpath: outputPath,\n\t\t\t\t\tfilename: `${island.id}.js`,\n\t\t\t\t\tiife: true,\n\t\t\t\t\tlibrary: {\n\t\t\t\t\t\ttype: \"var\",\n\t\t\t\t\t\tname: `tamaguiIsland_${island.id}`\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tplugins: [new input.webpack.ProvidePlugin(input.defines.provide), new input.webpack.DefinePlugin({\n\t\t\t\t\t...input.defines.define,\n\t\t\t\t\t\"process.env.TAMAGUI_RUNTIME\": JSON.stringify(\"island\"),\n\t\t\t\t\t\"process.env.TAMAGUI_DID_OUTPUT_CSS\": JSON.stringify(\"1\"),\n\t\t\t\t\t\"process.env.TAMAGUI_TARGET\": JSON.stringify(\"web\"),\n\t\t\t\t\t\"process.env.TAMAGUI_IS_SERVER\": JSON.stringify(\"\"),\n\t\t\t\t\t\"process.env.TAMAGUI_ENVIRONMENT\": JSON.stringify(\"client\"),\n\t\t\t\t\t\"process.env.IS_STATIC\": JSON.stringify(\"\"),\n\t\t\t\t\t\"process.env.NODE_ENV\": JSON.stringify(\"production\"),\n\t\t\t\t\t__DEV__: JSON.stringify(false)\n\t\t\t\t})]\n\t\t\t}, (error, stats) => {\n\t\t\t\tif (error) return reject(error);\n\t\t\t\tif (stats?.hasErrors()) return reject(new Error(stats.toString({\n\t\t\t\t\tall: false,\n\t\t\t\t\terrors: true\n\t\t\t\t})));\n\t\t\t\tif (stats) collectZeroBuildInfo(controller, stats.compilation.modules);\n\t\t\t\tresolve();\n\t\t\t});\n\t\t});\n\t} finally {\n\t\tcontroller.islandBuild = null;\n\t}\n\tconst file = path.join(outputPath, `${island.id}.js`);\n\tcontroller.artifact.markIslandComplete(island.id);\n\treturn {\n\t\tfile,\n\t\thash: createHash(\"sha256\").update(readFileSync(file)).digest(\"hex\").slice(0, 16)\n\t};\n}\nfunction collectDefinitions(compiler) {\n\tconst define = {};\n\tconst provide = {};\n\tfor (const plugin of compiler.options.plugins ?? []) {\n\t\tconst candidate = plugin;\n\t\tif (!candidate?.definitions) continue;\n\t\tif (plugin?.constructor?.name === \"DefinePlugin\") Object.assign(define, candidate.definitions);\n\t\telse if (plugin?.constructor?.name === \"ProvidePlugin\") Object.assign(provide, candidate.definitions);\n\t}\n\treturn {\n\t\tdefine,\n\t\tprovide\n\t};\n}\n\nexport { ZERO_CSS_FILENAME, ZERO_ISLAND_DIRNAME, buildWebpackIsland, collectDefinitions, collectZeroBuildInfo, flattenModules, getWebpackZeroController, publishZeroBuildInfo, readZeroBuildInfo, zeroModuleKey };"],"mappings":";;;;;;AAKA,MAAM,oBAAoB;AAC1B,MAAM,sBAAsB;AAC5B,MAAM,iBAAiB,UAAU,MAAM,QAAQ,OAAO,GAAG;AACzD,MAAM,iBAAiB,UAAU,cAAc,KAAK,CAAC,CAAC,QAAQ,gCAAgC,EAAE;AAChG,MAAM,kBAAkB;AACxB,MAAM,cAAc,WAAW,qCAAqC,IAAI,IAAI;AAC5E,SAAS,yBAAyB,SAAS,MAAM;CAChD,MAAM,WAAW,OAAO,uBAAuB,SAAS,IAAI;CAC5D,IAAI,SAAS,SAAS,OAAO,OAAO;CACpC,OAAO,6BAA6B,gBA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,CAAC;CAChB,MAAM,UAAU,CAAC;CACjB,KAAK,MAAM,UAAU,SAAS,QAAQ,WAAW,CAAC,GAAG;EACpD,MAAM,YAAY;EAClB,IAAI,CAAC,WAAW,aAAa;EAC7B,IAAI,QAAQ,aAAa,SAAS,gBAAgB,OAAO,OAAO,QAAQ,UAAU,WAAW;OACxF,IAAI,QAAQ,aAAa,SAAS,iBAAiB,OAAO,OAAO,SAAS,UAAU,WAAW;CACrG;CACA,OAAO;EACN;EACA;CACD;AACD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tamagui-loader",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
|
+
"license": "MIT",
|
|
4
5
|
"gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
|
|
5
6
|
"files": [
|
|
6
7
|
"src",
|
|
@@ -37,18 +38,18 @@
|
|
|
37
38
|
"clean:build": "tamagui-build clean:build"
|
|
38
39
|
},
|
|
39
40
|
"dependencies": {
|
|
40
|
-
"@tamagui/cli-color": "3.0.
|
|
41
|
-
"@tamagui/core": "3.0.
|
|
42
|
-
"@tamagui/static": "3.0.
|
|
43
|
-
"@tamagui/types": "3.0.
|
|
44
|
-
"@tamagui/web": "3.0.
|
|
41
|
+
"@tamagui/cli-color": "3.0.1",
|
|
42
|
+
"@tamagui/core": "3.0.1",
|
|
43
|
+
"@tamagui/static": "3.0.1",
|
|
44
|
+
"@tamagui/types": "3.0.1",
|
|
45
|
+
"@tamagui/web": "3.0.1",
|
|
45
46
|
"esbuild-loader": "^4.2.2",
|
|
46
47
|
"esm-resolve": "^1.0.8",
|
|
47
48
|
"fs-extra": "^11.2.0",
|
|
48
49
|
"loader-utils": "^3.2.1"
|
|
49
50
|
},
|
|
50
51
|
"devDependencies": {
|
|
51
|
-
"@tamagui/build": "3.0.
|
|
52
|
+
"@tamagui/build": "3.0.1",
|
|
52
53
|
"prettyjson": "^1.2.5",
|
|
53
54
|
"webpack": "^5.88.2"
|
|
54
55
|
},
|
|
@@ -56,5 +57,6 @@
|
|
|
56
57
|
"type": "git",
|
|
57
58
|
"url": "git+https://github.com/tamagui/tamagui.git",
|
|
58
59
|
"directory": "code/compiler/loader"
|
|
59
|
-
}
|
|
60
|
+
},
|
|
61
|
+
"releaseSourceCommit": "c156b7cc55e5a6cc5883ebc8189720850ac32dbd"
|
|
60
62
|
}
|
package/src/loader.ts
CHANGED
|
@@ -28,7 +28,7 @@ export const loader = async function loader(
|
|
|
28
28
|
const callback = this.async()
|
|
29
29
|
const sourcePath = `${this.resourcePath}`
|
|
30
30
|
|
|
31
|
-
if (sourcePath.includes('node_modules') || sourcePath.includes('
|
|
31
|
+
if (sourcePath.includes('node_modules') || sourcePath.includes('local-icons')) {
|
|
32
32
|
return callback(null, sourceIn)
|
|
33
33
|
}
|
|
34
34
|
|
package/src/zeroRuntime.ts
CHANGED
|
@@ -224,7 +224,7 @@ export function collectZeroBuildInfo(
|
|
|
224
224
|
|
|
225
225
|
/**
|
|
226
226
|
* Builds one island as a separate webpack compilation with
|
|
227
|
-
* `TAMAGUI_RUNTIME='
|
|
227
|
+
* `TAMAGUI_RUNTIME='island'`. React is externalized to the handoff the generated
|
|
228
228
|
* loader publishes, so both graphs share one React instance.
|
|
229
229
|
*/
|
|
230
230
|
export async function buildWebpackIsland(input: {
|
|
@@ -267,7 +267,7 @@ export async function buildWebpackIsland(input: {
|
|
|
267
267
|
// the parent compilation's env surface first, so the island sees the
|
|
268
268
|
// same `process.env` shape the zero entry was built against
|
|
269
269
|
...input.defines.define,
|
|
270
|
-
'process.env.TAMAGUI_RUNTIME': JSON.stringify('
|
|
270
|
+
'process.env.TAMAGUI_RUNTIME': JSON.stringify('island'),
|
|
271
271
|
'process.env.TAMAGUI_DID_OUTPUT_CSS': JSON.stringify('1'),
|
|
272
272
|
'process.env.TAMAGUI_TARGET': JSON.stringify('web'),
|
|
273
273
|
'process.env.TAMAGUI_IS_SERVER': JSON.stringify(''),
|
package/types/zeroRuntime.d.ts
CHANGED
|
@@ -79,7 +79,7 @@ export declare function collectZeroBuildInfo(controller: WebpackZeroController,
|
|
|
79
79
|
};
|
|
80
80
|
/**
|
|
81
81
|
* Builds one island as a separate webpack compilation with
|
|
82
|
-
* `TAMAGUI_RUNTIME='
|
|
82
|
+
* `TAMAGUI_RUNTIME='island'`. React is externalized to the handoff the generated
|
|
83
83
|
* loader publishes, so both graphs share one React instance.
|
|
84
84
|
*/
|
|
85
85
|
export declare function buildWebpackIsland(input: {
|