Skip to content

Commit

Permalink
feat(alita): 修改转化的babel配置
Browse files Browse the repository at this point in the history
修改转化的babel配置
  • Loading branch information
ykforerlang committed Jul 1, 2019
1 parent 710d810 commit b2eddd7
Show file tree
Hide file tree
Showing 42 changed files with 2,050 additions and 914 deletions.
22 changes: 20 additions & 2 deletions examples/HelloWorldExpoWP/src/a/MyChildComp.comp.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
})
} else {
obj[key] = value
}
return obj
}

import React, { h } from "@areslabs/wx-react"
import { View } from "@areslabs/wx-react-native"
export default class MyChildComp extends React.Component {
constructor(...args) {
super(...args)

_defineProperty(this, "__stateless__", true)
}

render() {
return h(
"block",
Expand All @@ -23,6 +43,4 @@ export default class MyChildComp extends React.Component {
})
)
}

__stateless__ = true
}
26 changes: 22 additions & 4 deletions examples/HelloWorldExpoWP/src/a/MyContext.comp.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
})
} else {
obj[key] = value
}
return obj
}

import React, { Component, h } from "@areslabs/wx-react"
import PropTypes from "@areslabs/wx-prop-types"
import { View, Text } from "@areslabs/wx-react-native"
import styles from "./styles"
export default class MyContext extends Component {
static contextTypes = {
color: PropTypes.string
constructor(...args) {
super(...args)

_defineProperty(this, "__stateless__", true)
}

render() {
Expand Down Expand Up @@ -52,6 +68,8 @@ export default class MyContext extends Component {
)
)
}

__stateless__ = true
}

_defineProperty(MyContext, "contextTypes", {
color: PropTypes.string
})
22 changes: 20 additions & 2 deletions examples/HelloWorldExpoWP/src/a/MyForceUpdate.comp.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
})
} else {
obj[key] = value
}
return obj
}

import React, { Component, h } from "@areslabs/wx-react"
import { TouchableOpacity, View } from "@areslabs/wx-react-native"
import MyForceUpdateInner from "./MyForceUpdateInner.comp"
export default class MyForceUpdate extends Component {
constructor(...args) {
super(...args)

_defineProperty(this, "__stateless__", false)
}

shouldComponentUpdate() {
console.log("MyForceUpdate shouldComponentUpdate")
return true
Expand Down Expand Up @@ -36,6 +56,4 @@ export default class MyForceUpdate extends Component {
)
)
}

__stateless__ = false
}
22 changes: 20 additions & 2 deletions examples/HelloWorldExpoWP/src/a/MyForceUpdateInner.comp.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
})
} else {
obj[key] = value
}
return obj
}

import React, { Component, h } from "@areslabs/wx-react"
import MyForceUpdateInnerInner from "./MyForceUpdateInnerInner.comp"
export default class MyForceUpdateInner extends Component {
constructor(...args) {
super(...args)

_defineProperty(this, "__stateless__", true)
}

shouldComponentUpdate() {
console.log("MyForceUpdateInner shouldComponentUpdate")
return true
Expand All @@ -12,6 +32,4 @@ export default class MyForceUpdateInner extends Component {
tempName: "ITNP00002"
})
}

__stateless__ = true
}
22 changes: 20 additions & 2 deletions examples/HelloWorldExpoWP/src/a/MyForceUpdateInnerInner.comp.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
})
} else {
obj[key] = value
}
return obj
}

import React, { Component, h } from "@areslabs/wx-react"
import { View, Text } from "@areslabs/wx-react-native"
import styles from "./styles"
export default class MyForceUpdateInnerInner extends Component {
constructor(...args) {
super(...args)

_defineProperty(this, "__stateless__", true)
}

shouldComponentUpdate() {
console.log("MyForceUpdateInnerInner shouldComponentUpdate")
return true
Expand Down Expand Up @@ -34,6 +54,4 @@ export default class MyForceUpdateInnerInner extends Component {
)
)
}

__stateless__ = true
}
22 changes: 20 additions & 2 deletions examples/HelloWorldExpoWP/src/a/MyHoc.comp.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
})
} else {
obj[key] = value
}
return obj
}

import React, { Component, h } from "@areslabs/wx-react"
import { View, Text, WXButton } from "@areslabs/wx-react-native"
import Hoc1 from "./Hoc1"
Expand All @@ -6,6 +20,12 @@ import styles from "./styles"
let i = 6

class MyHoc extends Component {
constructor(...args) {
super(...args)

_defineProperty(this, "__stateless__", true)
}

componentDidMount() {
console.log("MyHoc componentDidMount")
}
Expand Down Expand Up @@ -75,8 +95,6 @@ class MyHoc extends Component {
)
)
}

__stateless__ = true
}

export default Hoc1(Hoc2(MyHoc))
1 change: 0 additions & 1 deletion examples/HelloWorldExpoWP/src/a/MyModalComp.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import CompMySelf from "./MyModalComp.comp"
import { WxNormalComp } from "@areslabs/wx-react"
import RNApp from "../../src/index.js"

Component(WxNormalComp(CompMySelf, RNApp))
22 changes: 20 additions & 2 deletions examples/HelloWorldExpoWP/src/a/MyPropComp.comp.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
})
} else {
obj[key] = value
}
return obj
}

import React, { Component, h } from "@areslabs/wx-react"
import { View } from "@areslabs/wx-react-native"
export default class MyPropComp extends Component {
constructor(...args) {
super(...args)

_defineProperty(this, "__stateless__", true)
}

render() {
return h(
"block",
Expand All @@ -19,6 +39,4 @@ export default class MyPropComp extends Component {
})
)
}

__stateless__ = true
}
35 changes: 27 additions & 8 deletions examples/HelloWorldExpoWP/src/a/MyRefComp.comp.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,35 @@
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
})
} else {
obj[key] = value
}
return obj
}

import React, { Component, h } from "@areslabs/wx-react"
import { View, Text } from "@areslabs/wx-react-native"
import styles from "./styles"
export default class MyRefComp extends Component {
state = {
count: 0
}
increCount = () => {
this.setState({
count: this.state.count + 1
constructor(...args) {
super(...args)

_defineProperty(this, "state", {
count: 0
})

_defineProperty(this, "increCount", () => {
this.setState({
count: this.state.count + 1
})
})

_defineProperty(this, "__stateless__", false)
}

render() {
Expand Down Expand Up @@ -37,6 +58,4 @@ export default class MyRefComp extends Component {
)
)
}

__stateless__ = false
}
22 changes: 20 additions & 2 deletions examples/HelloWorldExpoWP/src/a/MyStyleComp.comp.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
})
} else {
obj[key] = value
}
return obj
}

import React, { Component, h } from "@areslabs/wx-react"
import MyStyleCompComp from "./MyStyleCompComp.comp"
export default class MyStyleComp extends Component {
constructor(...args) {
super(...args)

_defineProperty(this, "__stateless__", true)
}

render() {
return h(MyStyleCompComp, {
diuu: "DIUU00001",
tempName: "ITNP00002"
})
}

__stateless__ = true
}
22 changes: 20 additions & 2 deletions examples/HelloWorldExpoWP/src/a/MyStyleCompComp.comp.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
})
} else {
obj[key] = value
}
return obj
}

import React, { Component, h } from "@areslabs/wx-react"
import MyStyleCompCompComp from "./MyStyleCompCompComp.comp"
export default class MyStyleCompComp extends Component {
constructor(...args) {
super(...args)

_defineProperty(this, "__stateless__", true)
}

render() {
return h(MyStyleCompCompComp, {
diuu: "DIUU00001",
tempName: "ITNP00002"
})
}

__stateless__ = true
}
Loading

0 comments on commit b2eddd7

Please sign in to comment.