@modern-js/runtime 2.8.0 → 2.9.0
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/CHANGELOG.md +18 -0
- package/dist/cjs/router/runtime/DeferredDataScripts.js +2 -140
- package/dist/cjs/router/runtime/DeferredDataScripts.node.js +165 -0
- package/dist/cjs/ssr/serverRender/index.js +8 -0
- package/dist/cjs/ssr/serverRender/renderToStream/bulidTemplate.before.js +2 -2
- package/dist/cjs/ssr/serverRender/renderToStream/renderToPipe.worker.js +25 -9
- package/dist/cjs/ssr/serverRender/utils.js +3 -0
- package/dist/esm/router/runtime/DeferredDataScripts.js +2 -164
- package/dist/esm/router/runtime/DeferredDataScripts.node.js +166 -0
- package/dist/esm/ssr/serverRender/index.js +6 -1
- package/dist/esm/ssr/serverRender/renderToStream/bulidTemplate.before.js +1 -1
- package/dist/esm/ssr/serverRender/renderToStream/renderToPipe.worker.js +24 -11
- package/dist/esm/ssr/serverRender/utils.js +2 -1
- package/dist/esm-node/router/runtime/DeferredDataScripts.js +2 -144
- package/dist/esm-node/router/runtime/DeferredDataScripts.node.js +148 -0
- package/dist/esm-node/ssr/serverRender/index.js +8 -0
- package/dist/esm-node/ssr/serverRender/renderToStream/bulidTemplate.before.js +1 -1
- package/dist/esm-node/ssr/serverRender/renderToStream/renderToPipe.worker.js +25 -9
- package/dist/esm-node/ssr/serverRender/utils.js +2 -0
- package/dist/types/router/runtime/DeferredDataScripts.d.ts +2 -7
- package/dist/types/router/runtime/DeferredDataScripts.node.d.ts +8 -0
- package/dist/types/router/runtime/index.d.ts +1 -1
- package/dist/types/ssr/serverRender/renderToStream/renderToPipe.worker.d.ts +1 -1
- package/dist/types/ssr/serverRender/utils.d.ts +1 -0
- package/package.json +9 -9
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const CSS_CHUNKS_PLACEHOLDER = "<!--<?- chunksMap.css ?>-->";
|
|
1
2
|
function getLoadableScripts(extractor) {
|
|
2
3
|
const check = (scripts2) => (scripts2 || "").includes("__LOADABLE_REQUIRED_CHUNKS___ext");
|
|
3
4
|
const scripts = extractor.getScriptTags();
|
|
@@ -7,5 +8,6 @@ function getLoadableScripts(extractor) {
|
|
|
7
8
|
return scripts.split("</script>").slice(0, 2).map((i) => `${i}</script>`).join("");
|
|
8
9
|
}
|
|
9
10
|
export {
|
|
11
|
+
CSS_CHUNKS_PLACEHOLDER,
|
|
10
12
|
getLoadableScripts
|
|
11
13
|
};
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
declare const _default: () => null;
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
* DeferredDataScripts only renders in server side,
|
|
5
|
-
* it doesn't need to be hydrated in client side.
|
|
6
|
-
*/
|
|
7
|
-
declare const DeferredDataScripts: () => JSX.Element | null;
|
|
8
|
-
export default DeferredDataScripts;
|
|
3
|
+
export default _default;
|
|
@@ -4,6 +4,6 @@ export type { SingleRouteConfig, RouterConfig };
|
|
|
4
4
|
export default routerPlugin;
|
|
5
5
|
export { modifyRoutes } from './plugin';
|
|
6
6
|
export * from './withRouter';
|
|
7
|
-
export type { FormEncType, FormMethod, GetScrollRestorationKeyFunction, ParamKeyValuePair, SubmitOptions, URLSearchParamsInit, FetcherWithComponents, ActionFunction, ActionFunctionArgs, AwaitProps, unstable_Blocker, unstable_BlockerFunction, DataRouteMatch, DataRouteObject, Fetcher, Hash, IndexRouteObject, IndexRouteProps, JsonFunction, LayoutRouteProps, LoaderFunction, LoaderFunctionArgs, Location, MemoryRouterProps, NavigateFunction, NavigateOptions, NavigateProps, Navigation, Navigator,
|
|
7
|
+
export type { FormEncType, FormMethod, GetScrollRestorationKeyFunction, ParamKeyValuePair, SubmitOptions, URLSearchParamsInit, FetcherWithComponents, BrowserRouterProps, HashRouterProps, HistoryRouterProps, LinkProps, NavLinkProps, FormProps, ScrollRestorationProps, SubmitFunction, ActionFunction, ActionFunctionArgs, AwaitProps, unstable_Blocker, unstable_BlockerFunction, DataRouteMatch, DataRouteObject, Fetcher, Hash, IndexRouteObject, IndexRouteProps, JsonFunction, LayoutRouteProps, LoaderFunction, LoaderFunctionArgs, Location, MemoryRouterProps, NavigateFunction, NavigateOptions, NavigateProps, Navigation, Navigator, NonIndexRouteObject, OutletProps, Params, ParamParseKey, Path, PathMatch, Pathname, PathPattern, PathRouteProps, RedirectFunction, RelativeRoutingType, RouteMatch, RouteObject, RouteProps, RouterProps, RouterProviderProps, RoutesProps, Search, ShouldRevalidateFunction, To } from 'react-router-dom';
|
|
8
8
|
export { createBrowserRouter, createHashRouter, createMemoryRouter, RouterProvider, BrowserRouter, HashRouter, MemoryRouter, Router, Await, Form, Link, NavLink, Navigate, Outlet, Route, Routes, ScrollRestoration, useActionData, useAsyncError, useAsyncValue, useBeforeUnload, useFetcher, useFetchers, useFormAction, useHref, useInRouterContext, useLinkClickHandler, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes, useSearchParams, useSubmit, createRoutesFromChildren, createRoutesFromElements, createSearchParams, generatePath, isRouteErrorResponse, matchPath, matchRoutes, renderMatches, resolvePath } from 'react-router-dom';
|
|
9
9
|
export { defer, json, redirect } from '@modern-js/utils/remix-router';
|
|
@@ -4,5 +4,5 @@ import type { Writable } from 'stream';
|
|
|
4
4
|
import type { RenderToReadableStreamOptions } from 'react-dom/server';
|
|
5
5
|
import { RuntimeContext } from '../types';
|
|
6
6
|
export type Pipe<T extends Writable> = (output: T) => Promise<T | string>;
|
|
7
|
-
declare function renderToPipe(rootElement: React.ReactElement, context: RuntimeContext, options?: RenderToReadableStreamOptions):
|
|
7
|
+
declare function renderToPipe(rootElement: React.ReactElement, context: RuntimeContext, options?: RenderToReadableStreamOptions): Promise<string | ReadableStream<any>>;
|
|
8
8
|
export default renderToPipe;
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "2.
|
|
14
|
+
"version": "2.9.0",
|
|
15
15
|
"engines": {
|
|
16
16
|
"node": ">=14.17.6"
|
|
17
17
|
},
|
|
@@ -158,9 +158,9 @@
|
|
|
158
158
|
"react-side-effect": "^2.1.1",
|
|
159
159
|
"redux-logger": "^3.0.6",
|
|
160
160
|
"styled-components": "^5.3.1",
|
|
161
|
-
"@modern-js/plugin": "2.
|
|
162
|
-
"@modern-js/
|
|
163
|
-
"@modern-js/
|
|
161
|
+
"@modern-js/plugin": "2.9.0",
|
|
162
|
+
"@modern-js/utils": "2.9.0",
|
|
163
|
+
"@modern-js/types": "2.9.0"
|
|
164
164
|
},
|
|
165
165
|
"peerDependencies": {
|
|
166
166
|
"react": ">=17",
|
|
@@ -181,11 +181,11 @@
|
|
|
181
181
|
"react-dom": "^18",
|
|
182
182
|
"ts-jest": "^27.0.4",
|
|
183
183
|
"typescript": "^4",
|
|
184
|
-
"@modern-js/app-tools": "2.
|
|
185
|
-
"@modern-js/core": "2.
|
|
186
|
-
"@modern-js/server-core": "2.
|
|
187
|
-
"@scripts/jest-config": "2.
|
|
188
|
-
"@scripts/build": "2.
|
|
184
|
+
"@modern-js/app-tools": "2.9.0",
|
|
185
|
+
"@modern-js/core": "2.9.0",
|
|
186
|
+
"@modern-js/server-core": "2.9.0",
|
|
187
|
+
"@scripts/jest-config": "2.9.0",
|
|
188
|
+
"@scripts/build": "2.9.0"
|
|
189
189
|
},
|
|
190
190
|
"sideEffects": false,
|
|
191
191
|
"modernConfig": {},
|