-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4981 from alibaba/release-next
Release/2.3.0
- Loading branch information
Showing
105 changed files
with
1,432 additions
and
466 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
{ | ||
"router": false, | ||
"vite": true, | ||
"mpa": { | ||
"openPage": "Dashboard", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react'; | ||
import { runApp, IAppConfig } from 'ice'; | ||
import Index from './index'; | ||
|
||
const appConfig: IAppConfig = { | ||
router: { | ||
type: 'hash', | ||
routes: [{ path: '/', component: Index }], | ||
}, | ||
}; | ||
|
||
runApp(appConfig); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from 'react'; | ||
|
||
const About = () => { | ||
return ( | ||
<> | ||
<h2>About Page...</h2> | ||
</> | ||
); | ||
}; | ||
|
||
export default About; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import * as React from 'react'; | ||
import { runApp, IAppConfig } from 'ice'; | ||
import Page from './index'; | ||
import store from './store'; | ||
|
||
const Provider = store.Provider; | ||
|
||
const appConfig: IAppConfig = { | ||
app: { | ||
rootId: 'custom-container', | ||
renderComponent: Page, | ||
addProvider: ({ children }) => { | ||
return <Provider>{children}</Provider>; | ||
} | ||
}, | ||
}; | ||
|
||
runApp(appConfig); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export default { | ||
state: { | ||
count: 0 | ||
}, | ||
|
||
reducers: { | ||
increment (prevState) { | ||
return { count: prevState.count + 1 }; | ||
}, | ||
decrement (prevState) { | ||
return { count: prevState.count - 1 }; | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { createStore } from 'ice'; | ||
import counter from './models/counter'; | ||
|
||
const store = createStore({ counter }); | ||
|
||
export default store; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
// "router": false, | ||
"remoteRuntime": true, | ||
"polyfill": false, | ||
"ignoreHtmlTemplate": false, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import * as React from 'react'; | ||
|
||
export default function Home() { | ||
return <h2>Index Page</h2>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
// "vite": true, | ||
"store": true, | ||
"router": false, | ||
"plugins": [], | ||
"ssr": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "example-simple", | ||
"dependencies": { | ||
"react": "^16.4.1", | ||
"react-dom": "^16.4.1" | ||
}, | ||
"devDependencies": { | ||
"@types/react": "^16.9.20", | ||
"@types/react-dom": "^16.9.5" | ||
}, | ||
"scripts": { | ||
"start": "../../packages/icejs/bin/ice-cli.js start --mode dev", | ||
"build": "../../packages/icejs/bin/ice-cli.js build --mode prod" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta http-equiv="x-ua-compatible" content="ie=edge,chrome=1" /> | ||
<meta name="viewport" content="width=device-width" /> | ||
<title>icejs · icestark child example</title> | ||
</head> | ||
|
||
<body> | ||
<div id="ice-container"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"template": "node", | ||
"container": { | ||
"port": 3333 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import * as React from 'react'; | ||
import { getSearchParams } from 'ice'; | ||
import store from './store'; | ||
|
||
export default function Test(props) { | ||
console.log('Test props', props); | ||
console.log('search params', getSearchParams()); | ||
|
||
const [counterState, counterAction] = store.useModel('counter'); | ||
|
||
return <> | ||
Hello: {props.name} | ||
<div>Count: {counterState.count}</div> | ||
<div onClick={counterAction.increment}>+</div> | ||
<div onClick={counterAction.decrement}>-</div> | ||
</>; | ||
} | ||
|
||
Test.pageConfig = { | ||
title: '哈哈' | ||
}; | ||
|
||
Test.getInitialProps = async (ctx) => { | ||
return { | ||
name: 'React(getInitialProps)' | ||
}; | ||
}; |
7 changes: 4 additions & 3 deletions
7
examples/basic-mpa/src/pages/Profile/app.ts → examples/spa-renderComponent/src/app.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
import { runApp, IAppConfig } from 'ice'; | ||
import Page from './index'; | ||
import Test from './Test'; | ||
|
||
const appConfig: IAppConfig = { | ||
app: { | ||
rootId: 'custom-container', | ||
rootId: 'ice-container', | ||
renderComponent: Test, | ||
}, | ||
renderComponent: Page, | ||
// router: {} | ||
}; | ||
|
||
runApp(appConfig); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export default { | ||
state: { | ||
count: 0, | ||
}, | ||
|
||
reducers: { | ||
increment(prevState) { | ||
prevState.count += 1; | ||
}, | ||
decrement(prevState) { | ||
prevState.count -= 1; | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { createStore } from 'ice'; | ||
import counter from './models/counter'; | ||
|
||
const store = createStore({ counter }); | ||
|
||
export default store; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"compileOnSave": false, | ||
"buildOnSave": false, | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"outDir": "build", | ||
"module": "esnext", | ||
"target": "es6", | ||
"jsx": "react", | ||
"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, | ||
"types": ["node"], | ||
"paths": { | ||
"@/*": [ | ||
"./src/*" | ||
], | ||
"ice": [ | ||
".ice/index.ts" | ||
], | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.