Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 3.4.4 #6799

Merged
merged 11 commits into from
Feb 26, 2024
3 changes: 3 additions & 0 deletions examples/with-keep-alive-react/ice.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { defineConfig } from '@ice/app';

export default defineConfig(() => ({}));
21 changes: 21 additions & 0 deletions examples/with-keep-alive-react/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "@examples/with-keep-alive-react",
"private": true,
"version": "1.0.0",
"scripts": {
"start": "ice start",
"build": "ice build"
},
"dependencies": {
"react": "0.0.0-experimental-0cdfef19b-20231211",
"react-dom": "0.0.0-experimental-0cdfef19b-20231211"
},
"devDependencies": {
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.2"
},
"resolutions": {
"react": "0.0.0-experimental-0cdfef19b-20231211",
"react-dom": "0.0.0-experimental-0cdfef19b-20231211"
}
}
3 changes: 3 additions & 0 deletions examples/with-keep-alive-react/src/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { defineAppConfig } from 'ice';

export default defineAppConfig(() => ({}));
22 changes: 22 additions & 0 deletions examples/with-keep-alive-react/src/document.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Meta, Title, Links, Main, Scripts } from 'ice';

function Document() {
return (
<html>
<head>
<meta charSet="utf-8" />
<meta name="description" content="ICE Demo" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<Meta />
<Title />
<Links />
</head>
<body>
<Main />
<Scripts />
</body>
</html>
);
}

export default Document;
18 changes: 18 additions & 0 deletions examples/with-keep-alive-react/src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Link } from 'ice';
import Counter from '@/components/Counter';

export default function Home() {
return (
<main>
<h2>Home</h2>
<Counter />
<Link to="/about">About</Link>
</main>
);
}

export function pageConfig() {
return {
title: 'Home',
};
}
10 changes: 10 additions & 0 deletions examples/with-keep-alive-react/src/pages/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { KeepAliveOutlet } from 'ice';

export default function Layout() {
return (
<>
<h1>I'm Keep Alive</h1>
<KeepAliveOutlet />
</>
);
}
32 changes: 32 additions & 0 deletions examples/with-keep-alive-react/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"compileOnSave": false,
"buildOnSave": false,
"compilerOptions": {
"baseUrl": ".",
"outDir": "build",
"module": "esnext",
"target": "es6",
"jsx": "react-jsx",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"lib": ["es6", "dom"],
"sourceMap": true,
"allowJs": true,
"rootDir": "./",
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": false,
"importHelpers": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true,
"skipLibCheck": true,
"paths": {
"@/*": ["./src/*"],
"ice": [".ice"]
}
},
"include": ["src", ".ice", "ice.config.*"],
"exclude": ["build", "public"]
}
10 changes: 4 additions & 6 deletions examples/with-keep-alive/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@
"build": "ice build"
},
"dependencies": {
"react": "0.0.0-experimental-0cdfef19b-20231211",
"react-dom": "0.0.0-experimental-0cdfef19b-20231211"
"@ice/app": "workspace:*",
"@ice/runtime": "workspace:*",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
"devDependencies": {
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.2"
},
"resolutions": {
"react": "0.0.0-experimental-0cdfef19b-20231211",
"react-dom": "0.0.0-experimental-0cdfef19b-20231211"
}
}
11 changes: 11 additions & 0 deletions examples/with-keep-alive/src/components/Count.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { useState } from 'react';

export default function Count() {
const [count, setCount] = useState(0);
return (
<div>
<p>count: {count}</p>
<button onClick={() => setCount(count + 1)}>add</button>
</div>
);
}
12 changes: 12 additions & 0 deletions examples/with-keep-alive/src/pages/home.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Link } from 'ice';
import Count from '@/components/Count';

export default function Home() {
return (
<div>
<h4>Home</h4>
<Count />
<Link to="/">Index</Link>
</div>
);
}
31 changes: 18 additions & 13 deletions examples/with-keep-alive/src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
import { Link } from 'ice';
import Counter from '@/components/Counter';
import { useEffect } from 'react';
import { useActive, Link } from 'ice';
import Count from '@/components/Count';

export default function Home() {
const active = useActive();

useEffect(() => {
if (active) {
console.log('Page Index is actived');
} else {
console.log('Page Index is deactived');
}
}, [active]);

return (
<main>
<h2>Home</h2>
<Counter />
<Link to="/about">About</Link>
</main>
<div>
<h4>Index</h4>
<Count />
<Link to="/home">Home</Link>
</div>
);
}

export function pageConfig() {
return {
title: 'Home',
};
}
6 changes: 3 additions & 3 deletions examples/with-keep-alive/src/pages/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { KeepAliveOutlet } from 'ice';

export default function Layout() {
return (
<>
<h1>I'm Keep Alive</h1>
<div>
<h2>Layout</h2>
<KeepAliveOutlet />
</>
</div>
);
}
3 changes: 1 addition & 2 deletions examples/with-keep-alive/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"noImplicitAny": false,
"importHelpers": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true,
"skipLibCheck": true,
"paths": {
Expand All @@ -29,4 +28,4 @@
},
"include": ["src", ".ice", "ice.config.*"],
"exclude": ["build", "public"]
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"packageManager": "pnpm@8.9.2",
"pnpm": {
"patchedDependencies": {
"@rspack/core@0.5.1": "patches/@rspack__core@0.5.1.patch"
"@rspack/core@0.5.4": "patches/@rspack__core@0.5.4.patch"
}
}
}
6 changes: 6 additions & 0 deletions packages/bundles/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 0.2.4

### Patch Changes

- 4bce5d79: fix: bump rspack version

## 0.2.3

### Patch Changes
Expand Down
10 changes: 5 additions & 5 deletions packages/bundles/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ice/bundles",
"version": "0.2.3",
"version": "0.2.4",
"license": "MIT",
"author": "ICE",
"description": "Basic dependencies for ice.",
Expand Down Expand Up @@ -45,13 +45,13 @@
"zod": "^3.22.3",
"zod-validation-error": "1.2.0",
"terminal-link": "^2.1.1",
"@ice/pack-binding": "0.0.9",
"@ice/pack-binding": "0.0.11",
"mime-types": "2.1.35"
},
"devDependencies": {
"@rspack/plugin-react-refresh": "0.5.1",
"@rspack/dev-server": "0.5.1",
"@rspack/core": "0.5.1",
"@rspack/plugin-react-refresh": "0.5.4",
"@rspack/dev-server": "0.5.4",
"@rspack/core": "0.5.4",
"@types/less": "^3.0.3",
"@types/lodash": "^4.14.181",
"@types/webpack-bundle-analyzer": "^4.4.1",
Expand Down
4 changes: 3 additions & 1 deletion packages/bundles/scripts/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,9 @@ const tasks = [
const fileContent = fs.readFileSync(sourcePath, 'utf8');
fs.writeFileSync(targetPath,
replaceDeps(fileContent, webpackDevServerDeps.concat([...commonDeps, '@rspack/core', 'webpack-dev-server']))
.replace(/webpack-dev-server\/client\/clients/g, '@ice/bundles/compiled/webpack-dev-server/client/clients'),
.replace(/webpack-dev-server\//g, '@ice/bundles/compiled/webpack-dev-server/')
.replace(/@rspack\/core\//g, '@ice/bundles/compiled/@rspack/core/')
.replace(/@rspack\/dev-server\//g, '@ice/bundles/compiled/@rspack/dev-server/'),
);
} else {
fs.copyFileSync(sourcePath, targetPath);
Expand Down
Loading
Loading