Skip to content

Commit

Permalink
Merge pull request #1213 from alibaba/fix-engineer-error
Browse files Browse the repository at this point in the history
Fix engineer error
  • Loading branch information
Orange-C authored Aug 7, 2019
2 parents d510203 + 9562f72 commit b1d6452
Show file tree
Hide file tree
Showing 30 changed files with 142 additions and 145 deletions.
2 changes: 1 addition & 1 deletion packages/rax-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rax-cli",
"version": "2.0.0-1",
"version": "2.0.0-7",
"license": "BSD-3-Clause",
"description": "Command line interface for Rax",
"main": "src/index.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/rax-cli/src/generator/api/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"universal-env": "^1.0.0"
},
"devDependencies": {
"rax-scripts": "^2.0.0-0",
"rax-plugin-api": "^0.1.0-1"
"rax-scripts": "^2.0.0-2",
"rax-plugin-api": "^0.1.0-2"
}
}
9 changes: 4 additions & 5 deletions packages/rax-cli/src/generator/app/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@
<%_ } -%>
"rax-view": "^1.0.0",
"rax-text": "^1.0.0",
"rax-view": "^1.0.0",
"universal-app-runtime": "^0.1.3"
"universal-app-runtime": "^0.1.5-0"
},
"devDependencies": {
<%_ if (projectFeatures.includes('ssr')) { -%>
"rax-plugin-ssr": "^0.1.0",
"rax-plugin-ssr": "^0.1.0-1",
<%_ } -%>
"rax-scripts": "^2.0.0-0",
"rax-plugin-app": "^0.1.0-1"
"rax-scripts": "^2.0.0-2",
"rax-plugin-app": "^0.1.0-4"
}
}
6 changes: 1 addition & 5 deletions packages/rax-cli/src/generator/app/src/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
"routes": [
{
"path": "/",
"component": "pages/home"
},
{
"path": "/about",
"component": "pages/about"
"component": "pages/Home/index"
}
],
<%_ if (isSSR) { -%>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.logo {
width: 200rpx;
height: 180rpx;
margin-bottom: 20rpx;
}
14 changes: 14 additions & 0 deletions packages/rax-cli/src/generator/app/src/components/Logo/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import styles from './index.css';
import { createElement } from 'rax';
import Image from 'rax-image';

export default (props) => {
return (
<Image
style={styles.logo}
source={{
uri: '//gw.alicdn.com/tfs/TB1MRC_cvb2gK0jSZK9XXaEgFXa-1701-1535.png',
}}
/>
);
};
28 changes: 0 additions & 28 deletions packages/rax-cli/src/generator/app/src/components/Main/index.css

This file was deleted.

39 changes: 0 additions & 39 deletions packages/rax-cli/src/generator/app/src/components/Main/index.js

This file was deleted.

16 changes: 16 additions & 0 deletions packages/rax-cli/src/generator/app/src/pages/home/index.css
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;
}
13 changes: 11 additions & 2 deletions packages/rax-cli/src/generator/app/src/pages/home/index.jsx
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
import styles from './index.css';
import { createElement } from 'rax';
import View from 'rax-view';
import Text from 'rax-text';

import Main from '../../components/Main';
import Logo from '../../components/Logo';

export default function Home() {
return (
<Main />
<View style={styles.home}>
<Logo />
<Text style={styles.title}>Welcome to Your Rax App</Text>

<Text style={styles.info}>More information about Rax</Text>
<Text style={styles.info}>Visit https://rax.js.org</Text>
</View>
);
}
4 changes: 2 additions & 2 deletions packages/rax-cli/src/generator/component/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"devDependencies": {
"driver-universal": "^1.0.0",
"rax": "^1.0.0",
"rax-scripts": "^2.0.0-0",
"rax-plugin-component": "^0.1.0-1"
"rax-scripts": "^2.0.0-2",
"rax-plugin-component": "^0.1.0-2"
}
}
4 changes: 2 additions & 2 deletions packages/rax-is-valid-element/src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default function isValidElement(object) {
return typeof object === 'object' && object !== null && object.type && object.props;
}
return typeof object === 'object' && object !== null && object.type && !!object.props;
}
2 changes: 1 addition & 1 deletion packages/rax-miniapp-renderer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rax-miniapp-renderer",
"version": "0.1.0-2",
"version": "0.1.1",
"description": "Rax renderer for miniapp.",
"license": "BSD-3-Clause",
"main": "dist/rax-miniapp-renderer.min.js",
Expand Down
7 changes: 6 additions & 1 deletion packages/rax-miniapp-renderer/src/EventHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ export default class EventHandler {

addNoBubblesEventListener(node, name) {
const listener = (evt) => {
const target = {$$id: node.$$id};
const target = { $$id: node.$$id };

if (node === document.body) {
target.nodeName = 'BODY';
}

this.postMessage({
type: 'event',
event: {
Expand Down
2 changes: 1 addition & 1 deletion packages/rax-miniapp-renderer/src/MutationHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class MutationHandler {
let sharedNodeMap = this.sharedNodeMap;
let vnode = target;

if (vnode && vnode.nodeName === 'BODY') {
if (vnode && vnode.nodeName === 'BODY' && vnode.$$id) {
this.mountNode.$$id = vnode.$$id;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/rax-plugin-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rax-plugin-api",
"version": "0.1.0-1",
"version": "0.1.0-2",
"description": "rax api base plugins",
"license": "BSD-3-Clause",
"main": "src/index.js",
Expand Down
6 changes: 3 additions & 3 deletions packages/rax-plugin-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rax-plugin-app",
"version": "0.1.0-3",
"version": "0.1.0-4",
"description": "rax app base plugins",
"license": "BSD-3-Clause",
"main": "src/index.js",
Expand Down Expand Up @@ -50,7 +50,7 @@
"deepmerge": "^4.0.0",
"fs-extra": "^8.1.0",
"image-source-loader": "^0.6.5",
"jsx2mp-cli": "^0.1.0-beta.1",
"jsx2mp-cli": "^0.1.0",
"less": "^3.9.0",
"less-loader": "^5.0.0",
"loader-utils": "^1.1.0",
Expand All @@ -66,7 +66,7 @@
"ts-loader": "^5.3.3",
"typescript": "^3.2.4",
"uglifyjs-webpack-plugin": "^2.1.2",
"universal-app-shell-loader": "^0.2.0-4",
"universal-app-shell-loader": "^0.2.0-5",
"webpack": "^4.27.1",
"webpack-bundle-analyzer": "^3.0.3",
"webpack-chain": "^6.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/rax-plugin-app/src/config/miniapp/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const jsx2mp = require('jsx2mp-cli');

const getOutputPath = require('./getOutputPath');

module.exports = (context) => {
module.exports = (context, cancelClear) => {
const outputPath = getOutputPath(context);
fs.removeSync(outputPath);

Expand Down
Loading

0 comments on commit b1d6452

Please sign in to comment.