Skip to content

Commit

Permalink
Merge pull request #5784 from alibaba/release/3.0
Browse files Browse the repository at this point in the history
Release 3.0.6
  • Loading branch information
ClarkXia authored Jan 12, 2023
2 parents a48d8ce + ccb0d86 commit 8ef7703
Show file tree
Hide file tree
Showing 94 changed files with 1,325 additions and 253 deletions.
1 change: 1 addition & 0 deletions examples/basic-project/ice.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import SpeedMeasurePlugin from 'speed-measure-webpack-plugin';
import customPlugin from './plugin';

export default defineConfig(() => ({
ssr: true,
publicPath: '/',
polyfill: 'entry',
syntaxFeatures: {
Expand Down
11 changes: 11 additions & 0 deletions examples/memory-router/ice.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineConfig } from '@ice/app';

export default defineConfig(() => ({
publicPath: '/',
ssr: false,
ssg: false,
splitChunks: false,
routes: {
injectInitialEntry: true,
}
}));
22 changes: 22 additions & 0 deletions examples/memory-router/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "memory-router",
"version": "1.0.0",
"scripts": {
"start": "ice start",
"build": "ice build",
"build:optimization": "ice build --config optimization.config.mts"
},
"description": "",
"author": "",
"license": "MIT",
"dependencies": {
"@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.0"
}
}
7 changes: 7 additions & 0 deletions examples/memory-router/src/app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineAppConfig } from 'ice';

export default defineAppConfig(() => ({
router: {
type: 'memory',
},
}));
22 changes: 22 additions & 0 deletions examples/memory-router/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;
11 changes: 11 additions & 0 deletions examples/memory-router/src/pages/about.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { useState } from 'react';

export default function About() {
const [count, setCount] = useState(0);
return (
<div>
<h2>About: {count}</h2>
<div onClick={() => { setCount(count + 1); }}>+add</div>
</div>
);
}
11 changes: 11 additions & 0 deletions examples/memory-router/src/pages/dashboard/blog.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { useState } from 'react';

export default function Blog() {
const [count, setCount] = useState(0);
return (
<div>
<h2>Blog: {count}</h2>
<div onClick={() => { setCount(count + 1); }}>+add</div>
</div>
);
}
11 changes: 11 additions & 0 deletions examples/memory-router/src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { useState } from 'react';

export default function Home() {
const [count, setCount] = useState(0);
return (
<div>
<h2>Home: {count}</h2>
<div onClick={() => { setCount(count + 1); }}>+add</div>
</div>
);
}
32 changes: 32 additions & 0 deletions examples/memory-router/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": ["node_modules", "build", "public"]
}
6 changes: 3 additions & 3 deletions examples/miniapp-project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"version": "1.0.0",
"scripts": {
"start": "ice start",
"start:wechat": "ice start --platform wechat-miniprogram",
"start:ali": "ice start --platform ali-miniapp",
"start:wechat": "ice start --target wechat-miniprogram",
"start:ali": "ice start --target ali-miniapp",
"build": "ice build",
"build:wechat": "ice build --platform wechat-miniprogram"
"build:wechat": "ice build --target wechat-miniprogram"
},
"description": "",
"author": "",
Expand Down
1 change: 1 addition & 0 deletions examples/multi-target/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
chrome 55
9 changes: 9 additions & 0 deletions examples/multi-target/ice.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineConfig } from '@ice/app';

export default defineConfig(() => ({
ssr: true,
ssg: true,
define: {
'process.env.NODE_ENV': JSON.stringify(true),
},
}));
22 changes: 22 additions & 0 deletions examples/multi-target/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "multi-entry",
"version": "1.0.0",
"scripts": {
"start": "ice start",
"build": "ice build"
},
"description": "",
"author": "",
"license": "MIT",
"dependencies": {
"@ice/app": "workspace:*",
"@ice/plugin-rax-compat": "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"
}
}
Binary file added examples/multi-target/public/favicon.ico
Binary file not shown.
3 changes: 3 additions & 0 deletions examples/multi-target/src/app.tsx
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/multi-target/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;
3 changes: 3 additions & 0 deletions examples/multi-target/src/global.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
body {
font-size: 14px;
}
3 changes: 3 additions & 0 deletions examples/multi-target/src/pages/about.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function About() {
return (<div id="about">Target={import.meta.target} Renderer={import.meta.renderer}</div>);
}
4 changes: 4 additions & 0 deletions examples/multi-target/src/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface AppData {
title: string;
}

1 change: 1 addition & 0 deletions examples/multi-target/src/typings.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="@ice/app/types" />
32 changes: 32 additions & 0 deletions examples/multi-target/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": "ESNext",
"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"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export default function HybridReactComponent() {
return (
<div style={{
width: '400rpx',
height: '200rpx',
background: 'red',
}}
>HybridReactComponent in 400rpx * 200rpx red box.</div>
);
}
1 change: 0 additions & 1 deletion examples/rax-inline-style/src/document.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* @jsx createElement */
import { createElement } from 'rax';
import { Meta, Title, Links, Main, Scripts } from 'ice';

function Document() {
Expand Down
2 changes: 2 additions & 0 deletions examples/rax-inline-style/src/pages/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import View from 'rax-view';
import Text from 'rax-text';
import Logo from '@/components/Logo';
import Title from '@/components/Title';
import HybridReactComponent from '@/components/HybridReactComponent';
import './index.css';

export default function Home() {
Expand All @@ -25,6 +26,7 @@ export default function Home() {
<Title />
<Text className="homeInfo">More information about Rax</Text>
<Text className="homeInfo">Visit https://rax.js.org</Text>
<HybridReactComponent />
</View>
);
}
4 changes: 4 additions & 0 deletions packages/bundles/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.1.3

- [fix] Bump version of `@ice/swc-plugin-keep-export`(0.1.3 -> 0.1.4), https://github.com/ice-lab/swc-plugins/pull/8

## 0.1.2

- [fix] add esbuild and esbuild-register
Expand Down
4 changes: 2 additions & 2 deletions packages/bundles/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ice/bundles",
"version": "0.1.2",
"version": "0.1.3",
"license": "MIT",
"author": "ICE",
"description": "Basic dependencies for ice.",
Expand All @@ -17,7 +17,7 @@
"dependencies": {
"@swc/core": "1.3.19",
"@ice/swc-plugin-remove-export": "0.1.2",
"@ice/swc-plugin-keep-export": "0.1.3",
"@ice/swc-plugin-keep-export": "0.1.4",
"@ice/swc-plugin-keep-platform": "0.1.2",
"ansi-html-community": "^0.0.8",
"html-entities": "^2.3.2",
Expand Down
11 changes: 11 additions & 0 deletions packages/ice/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## v3.0.6

- [feat] support `import.meta.target`, `import.meta.renderer` and `import.meta.env`
- [feat] support config `routes.injectInitialEntry` for memory router
- [fix] cli option `--platform` change to `--target`
- [fix] remove code when dead code is `ObjectProperties`
- [fix] rebuild server entry when document changed
- [fix] set ssr default value to `false`
- [fix] server compiler options when bundle server entry
- [fix] support define expression of basename

## v3.0.5

- [fix] bump @swc/helpers version (0.4.12-> 0.4.14) for module cannot resolve of `@swc/helpers/src/_object_destructuring_empty.mjs`
Expand Down
13 changes: 0 additions & 13 deletions packages/ice/bin/checkNodeVersion.mjs

This file was deleted.

28 changes: 0 additions & 28 deletions packages/ice/bin/copy-dts-to-ice-temp.mjs

This file was deleted.

Loading

0 comments on commit 8ef7703

Please sign in to comment.