rari 0.2.2 → 0.2.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/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{server-CYRJ1imY.js → server-BwDou3Zb.js} +2 -13
- package/dist/{server-Do9Jt8NN.d.ts → server-Ph4oyo0B.d.ts} +0 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +1 -1
- package/package.json +6 -6
- package/src/vite/index.ts +9 -29
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ErrorBoundaryProps, FileRouteInfo, HttpRuntimeClient, LayoutProps, Link, LinkProps, LoadingProps, Navigate, NavigationOptions, NavigationState, Outlet, PageComponent, PageProps, Route, RouteComponent, RouteGenerationOptions, RouteMatch, RouteMeta, RouteParams, RouterConfig, RouterContext, RouterProvider, RouterProviderProps, Routes, RuntimeClient, SearchParams, buildSearchString, buildUrl, createHttpRuntimeClient, extractParamNames, findMatchingRoute, getRoutePriority, isDynamicRoute, isPathActive, joinPaths, normalizePathname, parseSearchParams, parseUrl, useNavigation, useParams, usePathname, useRoute, useRouter, useSearchParams, withRouter } from "./runtime-client-P4vvSVPV.js";
|
|
2
|
-
import { FileRouteGenerator, convertFilePatternToRoutePattern, createReactDOMOptimization, createRouteManifest, defineRariConfig, generateFileRoutes, loadRouteManifest, rari, rariRouter, validateRoutes, watchFileRoutes } from "./server-
|
|
2
|
+
import { FileRouteGenerator, convertFilePatternToRoutePattern, createReactDOMOptimization, createRouteManifest, defineRariConfig, generateFileRoutes, loadRouteManifest, rari, rariRouter, validateRoutes, watchFileRoutes } from "./server-Ph4oyo0B.js";
|
|
3
3
|
export { ErrorBoundaryProps, FileRouteGenerator, FileRouteInfo, HttpRuntimeClient, LayoutProps, Link, LinkProps, LoadingProps, Navigate, NavigationOptions, NavigationState, Outlet, PageComponent, PageProps, RouteComponent as Route, RouteGenerationOptions, RouteMatch, RouteMeta, RouteParams, Route as RouteType, RouterConfig, RouterContext, RouterProvider, RouterProviderProps, Routes, RuntimeClient, SearchParams, buildSearchString, buildUrl, convertFilePatternToRoutePattern, createHttpRuntimeClient, createReactDOMOptimization, createRouteManifest, defineRariConfig, extractParamNames, findMatchingRoute, generateFileRoutes, getRoutePriority, isDynamicRoute, isPathActive, joinPaths, loadRouteManifest, normalizePathname, parseSearchParams, parseUrl, rari, rariRouter, useNavigation, useParams, usePathname, useRoute, useRouter, useSearchParams, validateRoutes, watchFileRoutes, withRouter };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpRuntimeClient, Link, Navigate, Outlet, RouteComponent, Routes, buildSearchString, buildUrl, createHttpRuntimeClient, extractParamNames, findMatchingRoute, getRoutePriority, isDynamicRoute, isPathActive, joinPaths, normalizePathname, parseSearchParams, parseUrl, router_default, useNavigation, useParams, usePathname, useRoute, useRouter, useSearchParams, withRouter } from "./runtime-client-CcEhh-F7.js";
|
|
2
|
-
import { FileRouteGenerator, convertFilePatternToRoutePattern, createReactDOMOptimization, createRouteManifest, defineRariConfig, generateFileRoutes, loadRouteManifest, rari, rariRouter, validateRoutes, watchFileRoutes } from "./server-
|
|
2
|
+
import { FileRouteGenerator, convertFilePatternToRoutePattern, createReactDOMOptimization, createRouteManifest, defineRariConfig, generateFileRoutes, loadRouteManifest, rari, rariRouter, validateRoutes, watchFileRoutes } from "./server-BwDou3Zb.js";
|
|
3
3
|
import "./server-build-DaBgiV55.js";
|
|
4
4
|
|
|
5
5
|
export { FileRouteGenerator, HttpRuntimeClient, Link, Navigate, Outlet, RouteComponent as Route, router_default as RouterProvider, Routes, buildSearchString, buildUrl, convertFilePatternToRoutePattern, createHttpRuntimeClient, createReactDOMOptimization, createRouteManifest, defineRariConfig, extractParamNames, findMatchingRoute, generateFileRoutes, getRoutePriority, isDynamicRoute, isPathActive, joinPaths, loadRouteManifest, normalizePathname, parseSearchParams, parseUrl, rari, rariRouter, useNavigation, useParams, usePathname, useRoute, useRouter, useSearchParams, validateRoutes, watchFileRoutes, withRouter };
|
|
@@ -5111,7 +5111,7 @@ var require_chokidar = __commonJS({ "../../node_modules/.pnpm/chokidar@3.6.0/nod
|
|
|
5111
5111
|
|
|
5112
5112
|
//#endregion
|
|
5113
5113
|
//#region src/router/file-routes.ts
|
|
5114
|
-
var import_chokidar$1 = __toESM(require_chokidar()
|
|
5114
|
+
var import_chokidar$1 = __toESM(require_chokidar());
|
|
5115
5115
|
var FileRouteGenerator = class {
|
|
5116
5116
|
pagesDir;
|
|
5117
5117
|
extensions;
|
|
@@ -5420,7 +5420,7 @@ function convertFilePatternToRoutePattern(pattern) {
|
|
|
5420
5420
|
|
|
5421
5421
|
//#endregion
|
|
5422
5422
|
//#region src/router/vite-plugin.ts
|
|
5423
|
-
var import_chokidar = __toESM(require_chokidar()
|
|
5423
|
+
var import_chokidar = __toESM(require_chokidar());
|
|
5424
5424
|
const DEFAULT_OPTIONS = {
|
|
5425
5425
|
pagesDir: "src/pages",
|
|
5426
5426
|
extensions: [
|
|
@@ -5944,13 +5944,6 @@ if (import.meta.hot) {
|
|
|
5944
5944
|
const mainJsHref = scriptMatch[1];
|
|
5945
5945
|
html = html.replace(scriptMatch[0], `<link rel="preload" as="script" crossorigin href="${mainJsHref}" fetchpriority="high">
|
|
5946
5946
|
<script type="module" crossorigin src="${mainJsHref}" fetchpriority="high"><\/script>`);
|
|
5947
|
-
}
|
|
5948
|
-
const preconnectDomains = options$1.preconnectDomains || [];
|
|
5949
|
-
if (preconnectDomains.length > 0) {
|
|
5950
|
-
const preconnectHints = preconnectDomains.map((domain) => ` <link rel="dns-prefetch" href="//${domain}">`).join("\n");
|
|
5951
|
-
html = html.replace("</head>", ` <!-- Performance optimizations -->
|
|
5952
|
-
${preconnectHints}
|
|
5953
|
-
</head>`);
|
|
5954
5947
|
}
|
|
5955
5948
|
file.source = html;
|
|
5956
5949
|
}
|
|
@@ -5961,10 +5954,6 @@ ${preconnectHints}
|
|
|
5961
5954
|
if (!config.build.rolldownOptions.input) config.build.rolldownOptions.input = { main: "./index.html" };
|
|
5962
5955
|
config.build.rolldownOptions.output = config.build.rolldownOptions.output || {};
|
|
5963
5956
|
const outputConfig = Array.isArray(config.build.rolldownOptions.output) ? config.build.rolldownOptions.output[0] || {} : config.build.rolldownOptions.output;
|
|
5964
|
-
outputConfig.assetFileNames = (assetInfo) => {
|
|
5965
|
-
if (assetInfo.name?.endsWith(".css")) return "assets/[name]-[hash][extname]";
|
|
5966
|
-
return "assets/[name]-[hash][extname]";
|
|
5967
|
-
};
|
|
5968
5957
|
outputConfig.manualChunks = (id) => {
|
|
5969
5958
|
if (id.includes("node_modules/react-dom") || id.includes("react-dom/client") || id.includes("react-dom/server") || id.includes("react-dom/")) return "react-dom";
|
|
5970
5959
|
if ((id.includes("node_modules/react") || id.includes("react/")) && !id.includes("react-dom")) return "react";
|
|
@@ -60,7 +60,6 @@ interface RariOptions {
|
|
|
60
60
|
projectRoot?: string;
|
|
61
61
|
serverBuild?: ServerBuildOptions;
|
|
62
62
|
serverHandler?: boolean;
|
|
63
|
-
preconnectDomains?: string[];
|
|
64
63
|
}
|
|
65
64
|
declare function rari(options?: RariOptions): Plugin[];
|
|
66
65
|
declare function createReactDOMOptimization(): {
|
package/dist/server.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ErrorBoundaryProps, FileRouteInfo, HttpRuntimeClient, LayoutProps, Link, LinkProps, LoadingProps, Navigate, NavigationOptions, NavigationState, Outlet, PageComponent, PageProps, Route, RouteComponent, RouteGenerationOptions, RouteMatch, RouteMeta, RouteParams, RouterConfig, RouterContext, RouterProvider, RouterProviderProps, Routes, RuntimeClient, SearchParams, buildSearchString, buildUrl, createHttpRuntimeClient, extractParamNames, findMatchingRoute, getRoutePriority, isDynamicRoute, isPathActive, joinPaths, normalizePathname, parseSearchParams, parseUrl, useNavigation, useParams, usePathname, useRoute, useRouter, useSearchParams, withRouter } from "./runtime-client-P4vvSVPV.js";
|
|
2
|
-
import { FileRouteGenerator, convertFilePatternToRoutePattern, createReactDOMOptimization, createRouteManifest, defineRariConfig, generateFileRoutes, loadRouteManifest, rari, rariRouter, validateRoutes, watchFileRoutes } from "./server-
|
|
2
|
+
import { FileRouteGenerator, convertFilePatternToRoutePattern, createReactDOMOptimization, createRouteManifest, defineRariConfig, generateFileRoutes, loadRouteManifest, rari, rariRouter, validateRoutes, watchFileRoutes } from "./server-Ph4oyo0B.js";
|
|
3
3
|
export { ErrorBoundaryProps, FileRouteGenerator, FileRouteInfo, HttpRuntimeClient, LayoutProps, Link, LinkProps, LoadingProps, Navigate, NavigationOptions, NavigationState, Outlet, PageComponent, PageProps, RouteComponent as Route, RouteGenerationOptions, RouteMatch, RouteMeta, RouteParams, Route as RouteType, RouterConfig, RouterContext, RouterProvider, RouterProviderProps, Routes, RuntimeClient, SearchParams, buildSearchString, buildUrl, convertFilePatternToRoutePattern, createHttpRuntimeClient, createReactDOMOptimization, createRouteManifest, defineRariConfig, extractParamNames, findMatchingRoute, generateFileRoutes, getRoutePriority, isDynamicRoute, isPathActive, joinPaths, loadRouteManifest, normalizePathname, parseSearchParams, parseUrl, rari, rariRouter, useNavigation, useParams, usePathname, useRoute, useRouter, useSearchParams, validateRoutes, watchFileRoutes, withRouter };
|
package/dist/server.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpRuntimeClient, Link, Navigate, Outlet, RouteComponent, Routes, buildSearchString, buildUrl, createHttpRuntimeClient, extractParamNames, findMatchingRoute, getRoutePriority, isDynamicRoute, isPathActive, joinPaths, normalizePathname, parseSearchParams, parseUrl, router_default, useNavigation, useParams, usePathname, useRoute, useRouter, useSearchParams, withRouter } from "./runtime-client-CcEhh-F7.js";
|
|
2
|
-
import { FileRouteGenerator, convertFilePatternToRoutePattern, createReactDOMOptimization, createRouteManifest, defineRariConfig, generateFileRoutes, loadRouteManifest, rari, rariRouter, validateRoutes, watchFileRoutes } from "./server-
|
|
2
|
+
import { FileRouteGenerator, convertFilePatternToRoutePattern, createReactDOMOptimization, createRouteManifest, defineRariConfig, generateFileRoutes, loadRouteManifest, rari, rariRouter, validateRoutes, watchFileRoutes } from "./server-BwDou3Zb.js";
|
|
3
3
|
import "./server-build-DaBgiV55.js";
|
|
4
4
|
|
|
5
5
|
export { FileRouteGenerator, HttpRuntimeClient, Link, Navigate, Outlet, RouteComponent as Route, router_default as RouterProvider, Routes, buildSearchString, buildUrl, convertFilePatternToRoutePattern, createHttpRuntimeClient, createReactDOMOptimization, createRouteManifest, defineRariConfig, extractParamNames, findMatchingRoute, generateFileRoutes, getRoutePriority, isDynamicRoute, isPathActive, joinPaths, loadRouteManifest, normalizePathname, parseSearchParams, parseUrl, rari, rariRouter, useNavigation, useParams, usePathname, useRoute, useRouter, useSearchParams, validateRoutes, watchFileRoutes, withRouter };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rari",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.4",
|
|
5
5
|
"description": "Runtime Accelerated Rendering Infrastructure (Rari)",
|
|
6
6
|
"author": "Ryan Skinner",
|
|
7
7
|
"license": "MIT",
|
|
@@ -82,11 +82,11 @@
|
|
|
82
82
|
"rollup-plugin-esbuild": "^6.2.1"
|
|
83
83
|
},
|
|
84
84
|
"optionalDependencies": {
|
|
85
|
-
"rari-darwin-arm64": "0.2.
|
|
86
|
-
"rari-darwin-x64": "0.2.
|
|
87
|
-
"rari-linux-arm64": "0.2.
|
|
88
|
-
"rari-linux-x64": "0.2.
|
|
89
|
-
"rari-win32-x64": "0.2.
|
|
85
|
+
"rari-darwin-arm64": "0.2.2",
|
|
86
|
+
"rari-darwin-x64": "0.2.2",
|
|
87
|
+
"rari-linux-arm64": "0.2.2",
|
|
88
|
+
"rari-linux-x64": "0.2.2",
|
|
89
|
+
"rari-win32-x64": "0.2.2"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
92
|
"@types/node": "^24.2.1",
|
package/src/vite/index.ts
CHANGED
|
@@ -13,7 +13,6 @@ interface RariOptions {
|
|
|
13
13
|
projectRoot?: string
|
|
14
14
|
serverBuild?: ServerBuildOptions
|
|
15
15
|
serverHandler?: boolean
|
|
16
|
-
preconnectDomains?: string[]
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
function scanForClientComponents(srcDir: string): Set<string> {
|
|
@@ -420,7 +419,7 @@ if (import.meta.hot) {
|
|
|
420
419
|
})
|
|
421
420
|
}
|
|
422
421
|
}
|
|
423
|
-
catch {}
|
|
422
|
+
catch { }
|
|
424
423
|
if (!aliasFinds.has('react')) {
|
|
425
424
|
aliasesToAppend.push({ find: 'react', replacement: reactPath })
|
|
426
425
|
}
|
|
@@ -437,7 +436,7 @@ if (import.meta.hot) {
|
|
|
437
436
|
]
|
|
438
437
|
}
|
|
439
438
|
}
|
|
440
|
-
catch {}
|
|
439
|
+
catch { }
|
|
441
440
|
|
|
442
441
|
config.environments = config.environments || {}
|
|
443
442
|
|
|
@@ -553,23 +552,6 @@ if (import.meta.hot) {
|
|
|
553
552
|
)
|
|
554
553
|
}
|
|
555
554
|
|
|
556
|
-
const preconnectDomains
|
|
557
|
-
= (options as RariOptions).preconnectDomains || []
|
|
558
|
-
if (preconnectDomains.length > 0) {
|
|
559
|
-
const preconnectHints = preconnectDomains
|
|
560
|
-
.map(
|
|
561
|
-
(domain: string) =>
|
|
562
|
-
` <link rel="dns-prefetch" href="//${domain}">`,
|
|
563
|
-
)
|
|
564
|
-
.join('\n')
|
|
565
|
-
html = html.replace(
|
|
566
|
-
'</head>',
|
|
567
|
-
` <!-- Performance optimizations -->
|
|
568
|
-
${preconnectHints}
|
|
569
|
-
</head>`,
|
|
570
|
-
)
|
|
571
|
-
}
|
|
572
|
-
|
|
573
555
|
file.source = html
|
|
574
556
|
}
|
|
575
557
|
})
|
|
@@ -589,13 +571,6 @@ ${preconnectHints}
|
|
|
589
571
|
? config.build.rolldownOptions.output[0] || {}
|
|
590
572
|
: config.build.rolldownOptions.output
|
|
591
573
|
|
|
592
|
-
outputConfig.assetFileNames = (assetInfo) => {
|
|
593
|
-
if (assetInfo.name?.endsWith('.css')) {
|
|
594
|
-
return 'assets/[name]-[hash][extname]'
|
|
595
|
-
}
|
|
596
|
-
return 'assets/[name]-[hash][extname]'
|
|
597
|
-
}
|
|
598
|
-
|
|
599
574
|
outputConfig.manualChunks = (id) => {
|
|
600
575
|
if (
|
|
601
576
|
id.includes('node_modules/react-dom')
|
|
@@ -628,6 +603,7 @@ ${preconnectHints}
|
|
|
628
603
|
if (id.includes('.css') || id.includes('polyfill')) {
|
|
629
604
|
return true
|
|
630
605
|
}
|
|
606
|
+
// Preserve side effects for React modules to prevent import issues
|
|
631
607
|
if (
|
|
632
608
|
id.includes('react-dom')
|
|
633
609
|
|| id.includes('react')
|
|
@@ -635,9 +611,13 @@ ${preconnectHints}
|
|
|
635
611
|
|| id.includes('react-dom/client')
|
|
636
612
|
|| id.includes('react-dom/server')
|
|
637
613
|
) {
|
|
614
|
+
return true
|
|
615
|
+
}
|
|
616
|
+
// Only disable side effects for specific safe modules
|
|
617
|
+
if (id.includes('node_modules') && !id.includes('react')) {
|
|
638
618
|
return false
|
|
639
619
|
}
|
|
640
|
-
return
|
|
620
|
+
return true
|
|
641
621
|
},
|
|
642
622
|
unknownGlobalSideEffects: false,
|
|
643
623
|
}
|
|
@@ -1479,7 +1459,7 @@ const ${componentName} = registerClientReference(
|
|
|
1479
1459
|
return { id, external: true }
|
|
1480
1460
|
}
|
|
1481
1461
|
}
|
|
1482
|
-
catch {}
|
|
1462
|
+
catch { }
|
|
1483
1463
|
}
|
|
1484
1464
|
|
|
1485
1465
|
return null
|