Skip to content
This repository was archived by the owner on Nov 17, 2022. It is now read-only.

Commit 906c897

Browse files
authored
Merge pull request #657 from ice-lab/release-next
Release-rc.6
2 parents d6d27af + e8ad84c commit 906c897

File tree

168 files changed

+2529
-697
lines changed

Some content is hidden

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

168 files changed

+2529
-697
lines changed

examples/basic-project/ice.config.mts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { defineConfig } from '@ice/app';
22
import SpeedMeasurePlugin from 'speed-measure-webpack-plugin';
3-
import auth from '@ice/plugin-auth';
43
import custom from './plugin';
54

65
export default defineConfig({
@@ -23,7 +22,6 @@ export default defineConfig({
2322
},
2423
dropLogLevel: 'warn',
2524
plugins: [
26-
auth(),
2725
custom,
2826
],
2927
eslint: true,

examples/basic-project/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"license": "MIT",
1212
"dependencies": {
1313
"@ice/app": "workspace:*",
14-
"@ice/plugin-auth": "workspace:*",
1514
"@ice/plugin-rax-compat": "workspace:*",
1615
"@ice/runtime": "workspace:*",
1716
"@uni/env": "^1.1.0",

examples/basic-project/src/app.tsx

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { defineAppConfig } from 'ice';
2-
import { defineAuthConfig } from '@ice/plugin-auth/esm/types';
32
import { isWeb, isNode } from '@uni/env';
43
import type { GetAppData } from 'ice';
54

@@ -11,6 +10,7 @@ console.log('__LOG__');
1110
console.warn('__WARN__');
1211
console.error('__ERROR__');
1312
console.log('process.env.HAHA', process.env.HAHA);
13+
console.log('process.env.undefinedEnv', process.env.undefinedEnv);
1414

1515
if (isWeb) {
1616
console.error('__IS_WEB__');
@@ -20,15 +20,6 @@ if (isNode) {
2020
console.error('__IS_NODE__');
2121
}
2222

23-
export const auth = defineAuthConfig((data) => {
24-
// fetch auth data
25-
return {
26-
initialAuth: {
27-
admin: data?.auth?.admin,
28-
},
29-
};
30-
});
31-
3223
export default defineAppConfig({
3324
app: {
3425
rootId: 'app',
@@ -39,9 +30,6 @@ export const getAppData: GetAppData = () => {
3930
return new Promise((resolve) => {
4031
resolve({
4132
title: 'gogogogo',
42-
auth: {
43-
admin: true,
44-
},
4533
});
4634
});
4735
};

examples/basic-project/src/pages/about.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ export function getConfig(): RouteConfig {
4141
scripts: [{
4242
src: 'https://cdn.jsdelivr.net/npm/lodash@2.4.1/dist/lodash.min.js',
4343
}],
44-
auth: ['admin'],
4544
};
4645
}
4746

examples/basic-project/src/pages/blog.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,5 @@ export default function Blog() {
1717
export const getConfig = defineGetConfig(() => {
1818
return {
1919
title: 'Blog',
20-
auth: ['guest'],
2120
};
2221
});

examples/basic-project/src/pages/index.tsx

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Suspense, lazy } from 'react';
2-
import { Link, useData, useAppData, useConfig, ClientOnly, useMounted } from 'ice';
2+
import { Link, useData, useAppData, useConfig } from 'ice';
33
// not recommended but works
44
import { useAppContext } from '@ice/runtime';
55
import { useRequest } from 'ahooks';
@@ -16,8 +16,6 @@ export default function Home(props) {
1616
const appData = useAppData<AppData>();
1717
const data = useData();
1818
const config = useConfig();
19-
const mounted = useMounted();
20-
2119
if (typeof window !== 'undefined') {
2220
console.log('render Home', props);
2321
console.log('get AppData', appData);
@@ -42,19 +40,6 @@ export default function Home(props) {
4240
<div>userInfo: {JSON.stringify(userInfo)}</div>
4341
<div>data from: <span id="data-from">{data.from}</span></div>
4442
</div>
45-
<p>
46-
<div>{mounted ? 'Client' : 'Server'}</div>
47-
<ClientOnly>
48-
{() => {
49-
const PageUrl = lazy(() => import('@/components/PageUrl'));
50-
return (
51-
<Suspense>
52-
<PageUrl />
53-
</Suspense>
54-
);
55-
}}
56-
</ClientOnly>
57-
</p>
5843
</>
5944
);
6045
}
@@ -72,7 +57,6 @@ export function getConfig() {
7257
content: '#f00',
7358
},
7459
],
75-
auth: ['admin'],
7660
};
7761
}
7862

examples/basic-project/src/pages/layout.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Outlet, useData, useConfig } from 'ice';
22

3-
export default () => {
3+
export default function Layout() {
44
const data = useData();
55
const config = useConfig();
66

@@ -12,7 +12,7 @@ export default () => {
1212
<Outlet />
1313
</div>
1414
);
15-
};
15+
}
1616

1717
export function getConfig() {
1818
return {
@@ -23,7 +23,6 @@ export function getConfig() {
2323
content: '#f00',
2424
},
2525
],
26-
auth: ['admin'],
2726
};
2827
}
2928

examples/miniapp-project/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"dependencies": {
1515
"@ice/app": "workspace:*",
1616
"@ice/runtime": "workspace:*",
17+
"@ice/miniapp-html-styles": "workspace:*",
1718
"@ice/plugin-miniapp": "workspace:*",
1819
"@ice/miniapp-runtime": "workspace:*",
1920
"ahooks": "^3.3.8",
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@import '@ice/miniapp-html-styles/html';
2+
13
.global {
24
font-size: 14px;
35
}

examples/with-auth/ice.config.mts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { defineConfig } from '@ice/app';
2+
import auth from '@ice/plugin-auth';
3+
4+
export default defineConfig({
5+
plugins: [
6+
auth(),
7+
],
8+
});

0 commit comments

Comments
 (0)