Skip to content

Commit b8c35a7

Browse files
committed
refactor: improve package treeshaking
1 parent 88837a0 commit b8c35a7

File tree

100 files changed

+701
-495
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+701
-495
lines changed

docs/apis/reactant-share/README.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,8 @@ Here is the counter example, it uses `reactant-share` ShareWorker mode:
3131

3232
```tsx
3333
import React from 'react';
34-
import {
35-
ViewModule,
36-
createApp,
37-
injectable,
38-
useConnector,
39-
action,
40-
state,
41-
delegate,
42-
} from 'reactant-share';
34+
import { ViewModule, createApp, injectable, useConnector, action, state } from 'reactant';
35+
import { delegate } from 'reactant-share';
4336

4437
@injectable({ name: 'counter' })
4538
class Counter {

examples/reactant-share-base-coworker/src/app.view.tsx

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,9 @@
22
/* eslint-disable jsx-a11y/anchor-is-valid */
33
import React, { useState, FunctionComponent } from 'react';
44
import { Switch, Route } from 'reactant-web';
5-
import {
6-
ViewModule,
7-
injectable,
8-
useConnector,
9-
Router,
10-
PortDetector,
11-
ClientTransport,
12-
ServerTransport,
13-
Transport,
14-
} from 'reactant-share';
5+
import { ViewModule, injectable, useConnector } from 'reactant';
6+
import { Router, PortDetector } from 'reactant-share';
7+
import type { ClientTransport, ServerTransport, Transport } from 'reactant-share';
158
import { TodoListView } from './todoList.view';
169
import { CounterView } from './counter.view';
1710

examples/reactant-share-base-coworker/src/counter-coworker.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ import {
44
Router,
55
Storage,
66
StorageOptions,
7-
IStorageOptions,
87
RouterOptions,
98
createHashHistory,
10-
IRouterOptions,
11-
ICoworkerOptions,
129
createCoworker,
1310
} from 'reactant-share';
11+
import type { IStorageOptions, IRouterOptions, ICoworkerOptions } from 'reactant-share';
1412
import localForage from 'localforage';
1513
import { AppView } from './app.view';
1614
import { ProxyCounter } from './proxyCounter';

examples/reactant-share-base-coworker/src/counter.view.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import {
55
useConnector,
66
action,
77
state,
8-
delegate,
9-
} from 'reactant-share';
8+
} from 'reactant';
9+
import { delegate } from 'reactant-share';
1010

1111
import { ProxyCounter } from './proxyCounter';
1212

examples/reactant-share-base-coworker/src/coworker.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@ import {
44
Router,
55
Storage,
66
StorageOptions,
7-
IStorageOptions,
87
RouterOptions,
98
createHashHistory,
10-
IRouterOptions,
119
Coworker,
1210
CoworkerOptions,
13-
ICoworkerOptions,
1411
} from 'reactant-share';
12+
import type { IStorageOptions, IRouterOptions, ICoworkerOptions } from 'reactant-share';
1513
import localForage from 'localforage';
1614
import { AppView } from './app.view';
1715
import { ProxyCounter } from './proxyCounter';

examples/reactant-share-base-coworker/src/iframe.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import { render } from 'reactant-web';
2-
import {
3-
createSharedApp,
4-
RouterOptions,
5-
createHashHistory,
6-
IRouterOptions,
7-
} from 'reactant-share';
2+
import { createSharedApp, RouterOptions, createHashHistory } from 'reactant-share';
3+
import type { IRouterOptions } from 'reactant-share';
84
import { CounterView } from './counter.view';
95

106
createSharedApp({

examples/reactant-share-base-coworker/src/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@ import {
44
Router,
55
Storage,
66
StorageOptions,
7-
IStorageOptions,
87
RouterOptions,
98
createHashHistory,
10-
IRouterOptions,
119
Coworker,
1210
CoworkerOptions,
13-
ICoworkerOptions,
1411
createCoworker,
1512
} from 'reactant-share';
13+
import type { IStorageOptions, IRouterOptions, ICoworkerOptions } from 'reactant-share';
1614
import localForage from 'localforage';
1715
import { AppView } from './app.view';
1816
import { ProxyCounter } from './proxyCounter';

examples/reactant-share-base-coworker/src/proxyCounter.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { injectable, action, state, getCoworker, subscribe } from 'reactant-share';
1+
import { injectable, action, state, subscribe } from 'reactant';
2+
import { getCoworker } from 'reactant-share';
23

34
@injectable({
45
name: 'ProxyCounter',

examples/reactant-share-base-coworker/src/todoList.view.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ import {
77
useConnector,
88
action,
99
state,
10-
delegate,
1110
computed,
1211
optional,
13-
Storage,
14-
} from 'reactant-share';
12+
} from 'reactant';
13+
import { delegate, Storage } from 'reactant-share';
1514

1615
interface Todo {
1716
id: string;

examples/reactant-share-hybrid/src/iframe.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import { render } from 'reactant-web';
2-
import {
3-
createSharedApp,
4-
RouterOptions,
5-
createHashHistory,
6-
IRouterOptions,
7-
} from 'reactant-share';
2+
import { createSharedApp, RouterOptions, createHashHistory } from 'reactant-share';
3+
import type { IRouterOptions } from 'reactant-share';
84
import { CounterView } from './modules/counter.view';
95

106
createSharedApp({

0 commit comments

Comments
 (0)