-
Notifications
You must be signed in to change notification settings - Fork 624
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(jsx2mp): attributes transform in wechat&release 0.4.18 (#1933)
* fix(jsx2mp): attributes transform in wechat * fix(jsx2mp): lint error * feat(jsx2mp): finish event transform handle * refactor(jsx2mp): finish event handle * docs(jsx2mp): add event handler example * fix(example): lint error * chore(jsx2mp): remove useless code * docs(jsx2mp): update comment * build(jsx-compiler): publish version 0.4.18
- Loading branch information
1 parent
5eebec6
commit f3ead1d
Showing
26 changed files
with
328 additions
and
16 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
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,3 @@ | ||
module.exports = { | ||
extends: ['rax'] | ||
}; |
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,17 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
*~ | ||
*.swp | ||
*.log | ||
|
||
.DS_Store | ||
.idea/ | ||
.temp/ | ||
|
||
build/ | ||
dist/ | ||
lib/ | ||
coverage/ | ||
node_modules/ | ||
|
||
template.yml |
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 @@ | ||
# rax-materials-basic-app | ||
|
||
## Getting Started | ||
|
||
### `npm run start` | ||
|
||
Runs the app in development mode. | ||
|
||
Open [http://localhost:9999](http://localhost:9999) to view it in the browser. | ||
|
||
The page will reload if you make edits. | ||
|
||
### `npm run build` | ||
|
||
Builds the app for production to the `build` folder. |
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,20 @@ | ||
{ | ||
"inlineStyle": false, | ||
"plugins": [ | ||
[ | ||
"build-plugin-rax-app", | ||
{ | ||
"targets": [ | ||
"miniapp", | ||
"wechat-miniprogram" | ||
], | ||
"miniapp": { | ||
"buildType": "compile" | ||
}, | ||
"wechat-miniprogram": { | ||
"buildType": "compile" | ||
} | ||
} | ||
] | ||
] | ||
} |
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,33 @@ | ||
{ | ||
"name": "@rax-materials/scaffolds-app-js", | ||
"author": "rax", | ||
"description": "Rax 无线跨端应用工程,使用 JavaScript。", | ||
"version": "0.1.0", | ||
"scripts": { | ||
"build": "build-scripts build", | ||
"start": "build-scripts start", | ||
"lint": "eslint --ext .js --ext .jsx ./" | ||
}, | ||
"dependencies": { | ||
"rax": "^1.1.0", | ||
"rax-app": "^2.0.0", | ||
"driver-universal": "^3.0.0", | ||
"rax-image": "^2.0.0", | ||
"rax-link": "^1.0.1", | ||
"rax-text": "^1.0.0", | ||
"rax-view": "^1.0.0", | ||
"rax-document": "^0.1.0" | ||
}, | ||
"devDependencies": { | ||
"@alib/build-scripts": "^0.1.0", | ||
"babel-eslint": "^10.0.3", | ||
"build-plugin-rax-app": "^5.0.0", | ||
"eslint": "^6.8.0", | ||
"eslint-config-rax": "^0.1.0", | ||
"eslint-plugin-import": "^2.20.0", | ||
"eslint-plugin-module": "^0.1.0", | ||
"eslint-plugin-react": "^7.18.0" | ||
}, | ||
"private": true, | ||
"originTemplate": "@rax-materials/scaffolds-app-js" | ||
} |
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,4 @@ | ||
import { runApp } from 'rax-app'; | ||
import appConfig from './app.json'; | ||
|
||
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 @@ | ||
{ | ||
"routes": [ | ||
{ | ||
"path": "/", | ||
"source": "pages/Home/index" | ||
} | ||
], | ||
"window": { | ||
"title": "Rax App" | ||
} | ||
} |
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 @@ | ||
.logo { | ||
width: 200rpx; | ||
height: 180rpx; | ||
margin-bottom: 20rpx; | ||
} |
15 changes: 15 additions & 0 deletions
15
examples/event-handler/src/components/CustomComp/index.jsx
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 @@ | ||
import { createElement } from 'rax'; | ||
import Image from 'rax-image'; | ||
|
||
import './index.css'; | ||
|
||
export default (props) => { | ||
const { uri } = props; | ||
const source = { uri }; | ||
return ( | ||
<Image | ||
className="logo" | ||
source={source} | ||
/> | ||
); | ||
}; |
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,21 @@ | ||
import { createElement } from 'rax'; | ||
import { Root, Style, Script} from 'rax-document'; | ||
|
||
function Document() { | ||
return ( | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,viewport-fit=cover" /> | ||
<title>rax-materials-basic-app</title> | ||
<Style /> | ||
</head> | ||
<body> | ||
{/* root container */} | ||
<Root /> | ||
<Script /> | ||
</body> | ||
</html> | ||
); | ||
} | ||
export default Document; |
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,16 @@ | ||
.home { | ||
align-items: center; | ||
margin-top: 200rpx; | ||
} | ||
|
||
.title { | ||
font-size: 45rpx; | ||
font-weight: bold; | ||
margin: 20rpx 0; | ||
} | ||
|
||
.info { | ||
font-size: 36rpx; | ||
margin: 8rpx 0; | ||
color: #555; | ||
} |
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,21 @@ | ||
import { createElement } from 'rax'; | ||
import View from 'rax-view'; | ||
import Text from 'rax-text'; | ||
import Image from 'rax-image'; | ||
|
||
import './index.css'; | ||
|
||
import CustomComp from '../../components/CustomComp'; | ||
|
||
export default function Home() { | ||
function noop() {} | ||
return ( | ||
<View className="home"> | ||
<View className="test" onClick={noop}>onClick -> onTap (alibaba miniapp) && bindtap (wechat miniprogram) in rax-view</View> | ||
<Text className="test" onClick={noop}>onClick -> bindtap (wechat miniprogram) in rax-text</Text> | ||
<Image onClick={noop} onChange={noop}>onClick/onChange are not transformed (alibaba miniapp) && onClick -> bindonClick/onChange -> bindonChange (wechat miniprogram)</Image> | ||
<button className="test" style={{color: 'red'}} onClick={noop} onChange={noop}>onClick -> onTap (alibaba miniapp) && onClick -> bindtap (wechat miniprogram) && onChange -> bindchange (wechat miniprogram) </button> | ||
<CustomComp onClick={noop} onChange={noop}>not transformed</CustomComp> | ||
</View> | ||
); | ||
} |
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
1 change: 1 addition & 0 deletions
1
examples/with-miniapp-plugin-component/src/components/Test/index.ali.jsx
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
1 change: 1 addition & 0 deletions
1
examples/with-miniapp-plugin-component/src/components/Test/index.wechat.jsx
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
module.exports = [ | ||
'rax-text', | ||
'rax-scrollview', | ||
'rax-recyclerview', | ||
'rax-textinput', | ||
|
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.