@vercel/microfrontends 1.4.0-canary.3 → 1.4.0-canary.4
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/bin/cli.cjs +13 -3
- package/dist/config.cjs +12 -2
- package/dist/config.cjs.map +1 -1
- package/dist/config.js +12 -2
- package/dist/config.js.map +1 -1
- package/dist/experimental/sveltekit.cjs +12 -2
- package/dist/experimental/sveltekit.cjs.map +1 -1
- package/dist/experimental/sveltekit.js +12 -2
- package/dist/experimental/sveltekit.js.map +1 -1
- package/dist/experimental/vite.cjs +12 -2
- package/dist/experimental/vite.cjs.map +1 -1
- package/dist/experimental/vite.js +12 -2
- package/dist/experimental/vite.js.map +1 -1
- package/dist/microfrontends/server.cjs +12 -2
- package/dist/microfrontends/server.cjs.map +1 -1
- package/dist/microfrontends/server.js +12 -2
- package/dist/microfrontends/server.js.map +1 -1
- package/dist/next/client.cjs +1 -1
- package/dist/next/client.cjs.map +1 -1
- package/dist/next/client.js +1 -1
- package/dist/next/client.js.map +1 -1
- package/dist/next/config.cjs +12 -2
- package/dist/next/config.cjs.map +1 -1
- package/dist/next/config.js +12 -2
- package/dist/next/config.js.map +1 -1
- package/dist/next/middleware.cjs +12 -2
- package/dist/next/middleware.cjs.map +1 -1
- package/dist/next/middleware.js +12 -2
- package/dist/next/middleware.js.map +1 -1
- package/dist/next/testing.cjs +12 -2
- package/dist/next/testing.cjs.map +1 -1
- package/dist/next/testing.js +12 -2
- package/dist/next/testing.js.map +1 -1
- package/dist/utils/mfe-port.cjs +12 -2
- package/dist/utils/mfe-port.cjs.map +1 -1
- package/dist/utils/mfe-port.js +12 -2
- package/dist/utils/mfe-port.js.map +1 -1
- package/package.json +1 -1
package/dist/next/config.js
CHANGED
|
@@ -340,6 +340,16 @@ import { parse as parse2 } from "jsonc-parser";
|
|
|
340
340
|
|
|
341
341
|
// src/config/microfrontends-config/client/index.ts
|
|
342
342
|
import { pathToRegexp } from "path-to-regexp";
|
|
343
|
+
var regexpCache = /* @__PURE__ */ new Map();
|
|
344
|
+
var getRegexp = (path6) => {
|
|
345
|
+
const existing = regexpCache.get(path6);
|
|
346
|
+
if (existing) {
|
|
347
|
+
return existing;
|
|
348
|
+
}
|
|
349
|
+
const regexp = pathToRegexp(path6);
|
|
350
|
+
regexpCache.set(path6, regexp);
|
|
351
|
+
return regexp;
|
|
352
|
+
};
|
|
343
353
|
var MicrofrontendConfigClient = class {
|
|
344
354
|
constructor(config, opts) {
|
|
345
355
|
this.pathCache = {};
|
|
@@ -369,7 +379,7 @@ var MicrofrontendConfigClient = class {
|
|
|
369
379
|
);
|
|
370
380
|
}
|
|
371
381
|
isEqual(other) {
|
|
372
|
-
return JSON.stringify(this.applications) === JSON.stringify(other.applications);
|
|
382
|
+
return this === other || JSON.stringify(this.applications) === JSON.stringify(other.applications);
|
|
373
383
|
}
|
|
374
384
|
getApplicationNameForPath(path6) {
|
|
375
385
|
if (!path6.startsWith("/")) {
|
|
@@ -383,7 +393,7 @@ var MicrofrontendConfigClient = class {
|
|
|
383
393
|
if (application.routing) {
|
|
384
394
|
for (const group of application.routing) {
|
|
385
395
|
for (const childPath of group.paths) {
|
|
386
|
-
const regexp =
|
|
396
|
+
const regexp = getRegexp(childPath);
|
|
387
397
|
if (regexp.test(pathname)) {
|
|
388
398
|
this.pathCache[path6] = name;
|
|
389
399
|
return name;
|