@umijs/renderer-react 4.0.0-beta.9 → 4.0.0-canary-20240513.3

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/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@umijs/renderer-react",
3
- "version": "4.0.0-beta.9",
3
+ "version": "4.0.0-canary-20240513.3",
4
4
  "description": "@umijs/renderer-react",
5
- "homepage": "https://github.com/umijs/umi-next/tree/master/packages/renderer-react#readme",
6
- "bugs": "https://github.com/umijs/umi-next/issues",
5
+ "homepage": "https://github.com/umijs/umi/tree/master/packages/renderer-react#readme",
6
+ "bugs": "https://github.com/umijs/umi/issues",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "https://github.com/umijs/umi-next"
9
+ "url": "https://github.com/umijs/umi"
10
10
  },
11
11
  "license": "MIT",
12
12
  "sideEffects": false,
@@ -15,18 +15,16 @@
15
15
  "files": [
16
16
  "dist"
17
17
  ],
18
- "scripts": {
19
- "build": "pnpm tsc",
20
- "build:deps": "pnpm esno ../../scripts/bundleDeps.ts",
21
- "dev": "pnpm build -- --watch"
22
- },
23
18
  "dependencies": {
24
- "history": "5.0.1",
25
- "react-router-dom": "6.0.0-beta.8"
19
+ "@babel/runtime": "7.23.6",
20
+ "@loadable/component": "5.15.2",
21
+ "history": "5.3.0",
22
+ "react-helmet-async": "1.3.0",
23
+ "react-router-dom": "6.3.0"
26
24
  },
27
25
  "devDependencies": {
28
- "react": "18.0.0-alpha-f2c381131-20211004",
29
- "react-dom": "18.0.0-alpha-f2c381131-20211004"
26
+ "react": "18.1.0",
27
+ "react-dom": "18.1.0"
30
28
  },
31
29
  "peerDependencies": {
32
30
  "react": ">=16.8",
@@ -37,5 +35,11 @@
37
35
  },
38
36
  "authors": [
39
37
  "chencheng <sorrycc@gmail.com> (https://github.com/sorrycc)"
40
- ]
41
- }
38
+ ],
39
+ "scripts": {
40
+ "build": "umi-scripts father build",
41
+ "build:deps": "umi-scripts bundleDeps",
42
+ "dev": "umi-scripts father dev",
43
+ "test": "umi-scripts jest-turbo"
44
+ }
45
+ }
package/dist/app.d.ts DELETED
@@ -1,14 +0,0 @@
1
- /// <reference types="react" />
2
- import { Location } from 'history';
3
- import { Navigator } from 'react-router-dom';
4
- import { IRoutesById } from './types';
5
- export declare function App(props: {
6
- navigator: Navigator;
7
- location: Location;
8
- routes: IRoutesById;
9
- routeComponents: Record<string, any>;
10
- pluginManager: any;
11
- }): JSX.Element;
12
- export declare function RouteComponent(props: {
13
- id: string;
14
- }): JSX.Element;
package/dist/app.js DELETED
@@ -1,48 +0,0 @@
1
- import React from 'react';
2
- import { Router, useRoutes } from 'react-router-dom';
3
- import { AppContext, useAppContext } from './appContext';
4
- import { createClientRoutes } from './routes';
5
- export function App(props) {
6
- const clientRoutes = React.useMemo(() => {
7
- return createClientRoutes({
8
- routesById: props.routes,
9
- Component: RouteComponent,
10
- });
11
- }, [props.routes]);
12
- let ret = (React.createElement(AppContext.Provider, { value: {
13
- routes: props.routes,
14
- routeComponents: props.routeComponents,
15
- pluginManager: props.pluginManager,
16
- clientRoutes,
17
- } },
18
- React.createElement(Router, { navigator: props.navigator, location: props.location },
19
- React.createElement(Routes, null))));
20
- for (const key of [
21
- 'innerProvider',
22
- 'i18nProvider',
23
- 'dataflowProvider',
24
- 'outerProvider',
25
- ]) {
26
- ret = props.pluginManager.applyPlugins({
27
- type: 'modify',
28
- key: key,
29
- initialValue: ret,
30
- });
31
- }
32
- return ret;
33
- }
34
- function Routes() {
35
- const { clientRoutes } = useAppContext();
36
- return useRoutes(clientRoutes) || clientRoutes[0].element;
37
- }
38
- function Loading() {
39
- return React.createElement("div", null, "Loading...");
40
- }
41
- export function RouteComponent(props) {
42
- const loader = useAppContext().routeComponents[props.id];
43
- const RouteComponent = React.lazy(loader);
44
- // ref: https://reactjs.org/docs/code-splitting.html
45
- // TODO: replace with https://github.com/gregberge/loadable-components when we support ssr
46
- return (React.createElement(React.Suspense, { fallback: React.createElement(Loading, null) },
47
- React.createElement(RouteComponent, null)));
48
- }