-
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.
* chore: bump version * fix(miniapp): usePageShow not work in wechat (#1999) * fix(jsx2mp): usingComponents path error when disableCopyNpm (#1988) * fix(miniapp): judge __sharedEventNames * refactor: optimize miniapp runtime render (#2002) * fix: render error * fix: render error * refactor: optimize render * refactor: class * chore: refactor attribute * refactor(miniapp): getElement in document and element * refactor(miniapp): use BFS to replace resursion * refactor(miniapp): use map to replace object * fix(miniapp): lint error * refactor: native props * docs(miniapp): add get element example * fix(miniapp): exclude self node in element getelement * chore: remove tag props * fix(miniapp): separate nodeIdMap from idMap * refactor(miniapp): __eventHandlerMap * refactor(miniapp): style value * refactor: style * refactor: style * feat(miniapp): remove builtin components props * refactor(miniapp): node renderInfo * fix(miniapp): onchange not work in textarea * refactor: driver createElement * chore: bump version * chore: remove useless code * chore(example): add multipleSlots config in example * fix: custom component render * fix: custom component render * chore: remove lock file * fix(miniapp): input/textarea * fix(miniapp): test case (#2014) * fix(miniapp): test case * fix(miniapp): event process * fix(miniapp): dataset and classList * fix(miniapp): lint error * fix(miniapp): classList toggle * fix(miniapp): can't extend from Set * fix(miniapp): lint error * fix(miniapp): use contain to replace has Co-authored-by: 逆葵 <[email protected]> Co-authored-by: NK <[email protected]> * fix(miniapp): input/textarea focus-state not update * fix(miniapp): not trigger style update if node is not rendered Co-authored-by: NK <[email protected]> Co-authored-by: 逆葵 <[email protected]>
- Loading branch information
1 parent
714948f
commit 0f83651
Showing
96 changed files
with
1,511 additions
and
4,750 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,7 @@ | ||
{ | ||
"type": "rax", | ||
"builder": "@ali/builder-rax-v1", | ||
"info": { | ||
"raxVersion": "1.x" | ||
} | ||
} |
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": "runtime" | ||
}, | ||
"wechat-miniprogram": { | ||
"buildType": "runtime" | ||
} | ||
} | ||
] | ||
] | ||
} |
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,28 @@ | ||
import { runApp, useAppLaunch, useAppShow, useAppHide, useAppShare, useAppError } from 'rax-app'; | ||
import appConfig from './app.json'; | ||
|
||
useAppLaunch((options) => { | ||
console.log('app launch', options); | ||
}); | ||
|
||
useAppShow((options) => { | ||
console.log('app show', options); | ||
}); | ||
|
||
useAppHide(() => { | ||
console.log('app hide'); | ||
}); | ||
|
||
useAppShare(() => { | ||
return { | ||
title: '分享标题', | ||
desc: '分享详细说明', | ||
path: 'pages/Home/index' | ||
}; | ||
}); | ||
|
||
useAppError(() => { | ||
console.log('app error'); | ||
}); | ||
|
||
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; | ||
} |
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,61 @@ | ||
import { createElement, useEffect } from 'rax'; | ||
import View from 'rax-view'; | ||
import Text from 'rax-text'; | ||
|
||
import './index.css'; | ||
|
||
import Logo from '../../components/Logo'; | ||
|
||
export default function Home() { | ||
useEffect(() => { | ||
const father1 = document.getElementById('father'); | ||
const father2 = document.querySelector('#father'); | ||
const father3 = document.querySelectorAll('#father'); | ||
|
||
console.log('Home -> father1', father1); | ||
console.log('Home -> father2', father2); | ||
console.log('Home -> father3', father3); | ||
|
||
const home1 = document.getElementsByClassName('home'); | ||
const home2 = document.querySelector('.home'); | ||
const home3 = document.querySelectorAll('.home'); | ||
console.log('Home -> home1', home1); | ||
console.log('Home -> home2', home2); | ||
console.log('Home -> home3', home3); | ||
|
||
const div1 = document.getElementsByTagName('div'); | ||
const div2 = document.querySelector('div'); | ||
const div3 = document.querySelectorAll('div'); | ||
console.log('Home -> div1', div1); | ||
console.log('Home -> div2', div2); | ||
console.log('Home -> div3', div3); | ||
|
||
const child = document.getElementById('child1'); | ||
const subDiv1 = child.getElementsByTagName('div'); | ||
const subDiv2 = child.querySelector('div'); | ||
const subDiv3 = child.querySelectorAll('div'); | ||
console.log('Home -> subDiv1', subDiv1); | ||
console.log('Home -> subDiv2', subDiv2); | ||
console.log('Home -> subDiv3', subDiv3); | ||
|
||
const red1 = child.getElementsByClassName('red'); | ||
const red2 = child.querySelector('.red'); | ||
const red3 = child.querySelectorAll('.red'); | ||
console.log('Home -> red1', red1); | ||
console.log('Home -> red2', red2); | ||
console.log('Home -> red3', red3); | ||
}); | ||
return ( | ||
<View id="father" className="home"> | ||
<div id="child1" className="son"> | ||
<div className="red"></div> | ||
<div className="green"></div> | ||
<div className="red"></div> | ||
</div> | ||
<div id="child2" className="son"></div> | ||
<div id="child3" className="son"></div> | ||
<div id="child4" className="son"></div> | ||
<div id="child5" className="son"></div> | ||
</View> | ||
); | ||
} |
3 changes: 3 additions & 0 deletions
3
examples/with-miniapp-native-custom-component/src/public/WechatNativeComp/index.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 |
---|---|---|
@@ -1,4 +1,7 @@ | ||
Component({ | ||
options: { | ||
multipleSlots: true | ||
}, | ||
methods: { | ||
onClick() { | ||
this.triggerEvent('click'); | ||
|
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.