Skip to content

Commit

Permalink
feat(weex): remove __weex_require_module__ api
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanks10100 authored and yyx990803 committed Aug 29, 2017
1 parent 9bded22 commit a8146c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
4 changes: 1 addition & 3 deletions src/platforms/weex/entry-framework.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ export function createInstance (
// It will declare some instance variables like `Vue`, HTML5 Timer APIs etc.
const instanceVars = Object.assign({
Vue,
weex: weexInstanceVar,
// deprecated
__weex_require_module__: weexInstanceVar.requireModule // eslint-disable-line
weex: weexInstanceVar
}, timerAPIs, env.services)

if (!callFunctionNative(instanceVars, appCode)) {
Expand Down
12 changes: 6 additions & 6 deletions test/weex/runtime/framework.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ describe('framework APIs', () => {

const instance = new Instance(runtime)
framework.createInstance(instance.id, `
const moduleFoo = __weex_require_module__('foo')
const moduleFoo = weex.requireModule('foo')
new Vue({
data: {
x: 'Hello'
Expand Down Expand Up @@ -361,9 +361,9 @@ describe('framework APIs', () => {

const instance = new Instance(runtime)
framework.createInstance(instance.id, `
const moduleFoo = __weex_require_module__('foo')
const moduleBar = __weex_require_module__('bar')
const moduleBaz = __weex_require_module__('baz')
const moduleFoo = weex.requireModule('foo')
const moduleBar = weex.requireModule('bar')
const moduleBaz = weex.requireModule('baz')
new Vue({
render: function (createElement) {
const value = []
Expand Down Expand Up @@ -592,7 +592,7 @@ describe('framework APIs', () => {

const instance = new Instance(runtime)
framework.createInstance(instance.id, `
const moduleFoo = __weex_require_module__('foo')
const moduleFoo = weex.requireModule('foo')
new Vue({
mounted: function () {
moduleFoo.a(a => a + 1)
Expand Down Expand Up @@ -624,7 +624,7 @@ describe('framework APIs', () => {

const instance = new Instance(runtime)
framework.createInstance(instance.id, `
const moduleFoo = __weex_require_module__('foo')
const moduleFoo = weex.requireModule('foo')
new Vue({
mounted: function () {
moduleFoo.a(this.$refs.x)
Expand Down

0 comments on commit a8146c0

Please sign in to comment.