From 51dd277e5cd579c7fda524a0a0972e2972d04ab8 Mon Sep 17 00:00:00 2001 From: Hanks Date: Fri, 29 Dec 2017 20:37:26 +0800 Subject: [PATCH 1/2] * [jsfm] Adjust the file structure of js framework 1. Rename `html5/` to `runtime/` and move api, bridge, vdom out: rename: html5/frameworks -> runtime/frameworks rename: html5/runtime/api -> runtime/api rename: html5/runtime/bridge -> runtime/bridge rename: html5/runtime/vdom -> runtime/vdom rename: html5/runtime/utils.js -> runtime/shared/utils.js rename: html5/services -> runtime/services rename: html5/shared -> runtime/shared 2. Delete `html5/render/`, move it to `entries`: delete: html5/render/ rename: html5/runtime/index.js -> runtime/entries/runtime.js rename: html5/render/native/index.js -> runtime/entries/index.js rename: html5/render/native/setup.js -> runtime/entries/setup.js 3. Move `html5/test` into `test/` folder: rename: html5/test -> test/js-framework --- html5/render/vue/README.md | 3 --- .../runtime => runtime}/api/WeexInstance.js | 0 {html5/runtime => runtime}/api/component.js | 0 {html5/runtime => runtime}/api/config.js | 0 {html5/runtime => runtime/api}/index.js | 21 +++-------------- {html5/runtime => runtime}/api/init.js | 0 {html5/runtime => runtime}/api/module.js | 0 {html5/runtime => runtime}/api/service.js | 0 .../bridge/CallbackManager.js | 0 {html5/runtime => runtime}/bridge/Handler.js | 0 {html5/runtime => runtime}/bridge/Listener.js | 0 .../runtime => runtime}/bridge/TaskCenter.js | 2 +- {html5/runtime => runtime}/bridge/debug.js | 0 .../runtime => runtime}/bridge/normalize.js | 2 +- {html5/runtime => runtime}/bridge/receiver.js | 0 .../native => runtime/entries}/index.js | 3 ++- runtime/entries/rax.js | 23 +++++++++++++++++++ .../native => runtime/entries}/setup.js | 10 ++++---- runtime/entries/vue.js | 23 +++++++++++++++++++ {html5 => runtime}/frameworks/index.js | 0 .../frameworks/legacy/api/methods.js | 0 .../frameworks/legacy/api/modules.js | 0 .../frameworks/legacy/app/bundle/bootstrap.js | 0 .../frameworks/legacy/app/bundle/define.js | 0 .../frameworks/legacy/app/bundle/index.js | 0 .../frameworks/legacy/app/ctrl/index.js | 0 .../frameworks/legacy/app/ctrl/init.js | 0 .../frameworks/legacy/app/ctrl/misc.js | 0 .../frameworks/legacy/app/differ.js | 0 .../frameworks/legacy/app/downgrade.js | 0 .../frameworks/legacy/app/index.js | 0 .../frameworks/legacy/app/instance.js | 0 .../frameworks/legacy/app/register.js | 0 .../frameworks/legacy/app/viewport.js | 0 .../frameworks/legacy/config.js | 0 .../frameworks/legacy/core/LICENSE | 0 .../frameworks/legacy/core/array.js | 0 .../frameworks/legacy/core/dep.js | 0 .../frameworks/legacy/core/object.js | 0 .../frameworks/legacy/core/observer.js | 0 .../frameworks/legacy/core/state.js | 0 .../frameworks/legacy/core/watcher.js | 0 {html5 => runtime}/frameworks/legacy/index.js | 0 .../frameworks/legacy/static/bridge.js | 0 .../frameworks/legacy/static/create.js | 0 .../frameworks/legacy/static/life.js | 0 .../frameworks/legacy/static/map.js | 0 .../frameworks/legacy/static/misc.js | 0 .../frameworks/legacy/static/register.js | 0 .../frameworks/legacy/util/LICENSE | 0 .../frameworks/legacy/util/index.js | 0 .../frameworks/legacy/util/shared.js | 0 .../frameworks/legacy/vm/compiler.js | 0 .../frameworks/legacy/vm/directive.js | 0 .../frameworks/legacy/vm/dom-helper.js | 0 .../frameworks/legacy/vm/events.js | 0 .../frameworks/legacy/vm/index.js | 0 .../frameworks/vanilla/index.js | 0 {html5 => runtime}/services/amd/index.js | 0 .../services/broadcast-channel/index.js | 0 .../broadcast-channel/message-event.js | 0 {html5 => runtime}/services/index.js | 0 .../shared => runtime/shared/env}/console.js | 0 .../shared => runtime/shared/env}/freeze.js | 0 .../shared/env}/setTimeout.js | 0 {html5 => runtime}/shared/index.js | 15 ++++++------ .../shared/polyfill}/arrayFrom.js | 0 .../shared/polyfill}/objectAssign.js | 0 .../shared/polyfill}/objectSetPrototypeOf.js | 0 .../shared/polyfill}/promise.js | 0 {html5/runtime => runtime/shared}/utils.js | 0 {html5/runtime => runtime}/vdom/Comment.js | 2 +- {html5/runtime => runtime}/vdom/Document.js | 0 {html5/runtime => runtime}/vdom/Element.js | 2 +- {html5/runtime => runtime}/vdom/Node.js | 2 +- .../runtime => runtime}/vdom/WeexElement.js | 0 {html5/runtime => runtime}/vdom/index.js | 0 {html5/runtime => runtime}/vdom/operation.js | 0 .../test => test/js-framework}/case/.eslintrc | 0 .../case/basic/append-root.output.js | 0 .../case/basic/append-root.source.js | 0 .../js-framework}/case/basic/append.output.js | 0 .../js-framework}/case/basic/append.source.js | 0 .../case/basic/backward1.output.js | 0 .../case/basic/backward1.source.js | 0 .../case/basic/backward2.output.js | 0 .../case/basic/backward2.source.js | 0 .../case/basic/components.output.js | 0 .../case/basic/components.source.js | 0 .../case/basic/computed-in-repeat.output.js | 0 .../case/basic/computed-in-repeat.source.js | 0 .../case/basic/created.output.js | 0 .../case/basic/created.source.js | 0 .../case/basic/dynamic-id.output.js | 0 .../case/basic/dynamic-id.source.js | 0 .../case/basic/dynamic-property.output.js | 0 .../case/basic/dynamic-property.source.js | 0 .../case/basic/dynamic-type.output.js | 0 .../case/basic/dynamic-type.source.js | 0 .../js-framework}/case/basic/foo.output.js | 0 .../js-framework}/case/basic/foo.source.js | 0 .../js-framework}/case/basic/foo2.output.js | 0 .../js-framework}/case/basic/foo2.source.js | 0 .../js-framework}/case/basic/foo3.output.js | 0 .../js-framework}/case/basic/foo3.source.js | 0 .../js-framework}/case/basic/foo4.output.js | 0 .../js-framework}/case/basic/foo4.source.js | 0 .../js-framework}/case/basic/foo5.output.js | 0 .../js-framework}/case/basic/foo5.source.js | 0 .../js-framework}/case/basic/foo6.output.js | 0 .../js-framework}/case/basic/foo6.source.js | 0 .../js-framework}/case/basic/foo7.output.js | 0 .../js-framework}/case/basic/foo7.source.js | 0 .../js-framework}/case/basic/foo8.output.js | 0 .../js-framework}/case/basic/foo8.source.js | 0 .../js-framework}/case/basic/foo9.output.js | 0 .../js-framework}/case/basic/foo9.source.js | 0 .../case/basic/global-weex-object.output.js | 0 .../case/basic/global-weex-object.source.js | 0 .../js-framework}/case/basic/id.output.js | 0 .../js-framework}/case/basic/id.source.js | 0 .../case/basic/if-repeat.output.js | 0 .../case/basic/if-repeat.source.js | 0 .../case/basic/if-root.output.js | 0 .../case/basic/if-root.source.js | 0 .../js-framework}/case/basic/if.output.js | 0 .../js-framework}/case/basic/if.source.js | 0 .../case/basic/promise.output.js | 0 .../case/basic/promise.source.js | 0 .../js-framework}/case/basic/ready.output.js | 0 .../js-framework}/case/basic/ready.source.js | 0 .../case/basic/repeat-array-kv.output.js | 0 .../case/basic/repeat-array-kv.source.js | 0 .../case/basic/repeat-array-no-kv.output.js | 0 .../case/basic/repeat-array-no-kv.source.js | 0 .../case/basic/repeat-array-non-obj.output.js | 0 .../case/basic/repeat-array-non-obj.source.js | 0 .../case/basic/repeat-array-v.output.js | 0 .../case/basic/repeat-array-v.source.js | 0 .../case/basic/repeat-index.output.js | 0 .../case/basic/repeat-index.source.js | 0 .../case/basic/repeat-root.output.js | 0 .../case/basic/repeat-root.source.js | 0 .../case/basic/repeat-watch.output.js | 0 .../case/basic/repeat-watch.source.js | 0 .../case/basic/require.output.js | 0 .../case/basic/require.source.js | 0 .../case/basic/reset-style.output.js | 0 .../case/basic/reset-style.source.js | 0 .../case/basic/static1.output.js | 0 .../case/basic/static1.source.js | 0 .../case/basic/static2.output.js | 0 .../case/basic/static2.source.js | 0 .../case/basic/static3.output.js | 0 .../case/basic/static3.source.js | 0 .../case/basic/static4.output.js | 0 .../case/basic/static4.source.js | 0 .../js-framework}/case/basic/subvm.output.js | 0 .../js-framework}/case/basic/subvm.source.js | 0 .../case/basic/transformer1.output.js | 0 .../case/basic/transformer1.source.js | 0 .../case/complex/append-root-event.output.js | 0 .../case/complex/append-root-event.source.js | 0 .../case/complex/click.output.js | 0 .../case/complex/click.source.js | 0 .../complex/component-append-tree.output.js | 0 .../complex/component-append-tree.source.js | 0 .../case/complex/computed.output.js | 0 .../case/complex/computed.source.js | 0 .../case/complex/if-refresh.output.js | 0 .../case/complex/if-refresh.source.js | 0 .../case/complex/if-repeat-refresh.output.js | 0 .../case/complex/if-repeat-refresh.source.js | 0 .../case/complex/inline-click.output.js | 0 .../case/complex/inline-click.source.js | 0 .../case/complex/input-binding.output.js | 0 .../case/complex/input-binding.source.js | 0 .../case/complex/refresh2.output.js | 0 .../case/complex/refresh2.source.js | 0 .../case/complex/repeat-track-by.output.js | 0 .../case/complex/repeat-track-by.source.js | 0 .../case/complex/transformer2.output.js | 0 .../case/complex/transformer2.source.js | 0 .../case/complex/transformer3.output.js | 0 .../case/complex/transformer3.source.js | 0 .../multi/clear-dep-target-error.source.js | 0 .../multi/clear-dep-target-fine.output.js | 0 .../multi/clear-dep-target-fine.source.js | 0 .../case/multi/clear-moduleA.output.js | 0 .../case/multi/clear-moduleA.source.js | 0 .../case/multi/clear-moduleB.output.js | 0 .../case/multi/clear-moduleB.source.js | 0 .../js-framework}/case/prepare.js | 10 ++++---- .../case/signals/modal.output.js | 0 .../case/signals/modal.source.js | 0 .../case/signals/signals-long.source.js | 0 .../case/signals/signals.source.js | 0 .../case/signals/timer.output.js | 0 .../case/signals/timer.source.js | 0 .../test => test/js-framework}/case/tester.js | 0 .../case/throws/global-variable1.source.js | 0 .../case/throws/global-variable2.source.js | 0 .../case/throws/global-variable3.source.js | 0 .../js-framework}/unit/default/api/methods.js | 10 ++++---- .../js-framework}/unit/default/api/modules.js | 4 ++-- .../js-framework}/unit/default/app/bundle.js | 10 ++++---- .../js-framework}/unit/default/app/ctrl.js | 6 ++--- .../unit/default/app/downgrade.js | 2 +- .../js-framework}/unit/default/app/index.js | 4 ++-- .../unit/default/app/register.js | 2 +- .../unit/default/app/viewport.js | 2 +- .../js-framework}/unit/default/util/index.js | 2 +- .../js-framework}/unit/default/util/shared.js | 2 +- .../unit/default/vm/directive.js | 6 ++--- .../unit/default/vm/dom-helper.js | 6 ++--- .../js-framework}/unit/default/vm/events.js | 4 ++-- .../js-framework}/unit/default/vm/vm.js | 8 +++---- .../unit/runtime/legacy-framework.js | 12 +++++----- .../unit/runtime/runner/helper.js | 6 ++--- .../unit/runtime/runner/vanilla.js | 0 .../js-framework}/unit/runtime/runner/vue.js | 0 .../js-framework}/unit/runtime/utils.js | 2 +- .../js-framework}/unit/runtime/vdom/index.js | 2 +- .../unit/runtime/vdom/listener.js | 4 ++-- .../js-framework}/unit/runtime/vdom/node.js | 2 +- .../unit/shared/BroadcastChannel.js | 4 ++-- .../js-framework}/unit/shared/arrayFrom.js | 2 +- .../js-framework}/unit/shared/console.js | 5 +++- .../js-framework}/unit/shared/index.js | 2 +- .../js-framework}/unit/shared/objectAssign.js | 2 +- .../unit/shared/objectSetPrototypeOf.js | 2 +- .../js-framework}/unit/vanilla/index.js | 4 ++-- 232 files changed, 135 insertions(+), 100 deletions(-) delete mode 100644 html5/render/vue/README.md rename {html5/runtime => runtime}/api/WeexInstance.js (100%) rename {html5/runtime => runtime}/api/component.js (100%) rename {html5/runtime => runtime}/api/config.js (100%) rename {html5/runtime => runtime/api}/index.js (68%) rename {html5/runtime => runtime}/api/init.js (100%) rename {html5/runtime => runtime}/api/module.js (100%) rename {html5/runtime => runtime}/api/service.js (100%) rename {html5/runtime => runtime}/bridge/CallbackManager.js (100%) rename {html5/runtime => runtime}/bridge/Handler.js (100%) rename {html5/runtime => runtime}/bridge/Listener.js (100%) rename {html5/runtime => runtime}/bridge/TaskCenter.js (99%) rename {html5/runtime => runtime}/bridge/debug.js (100%) rename {html5/runtime => runtime}/bridge/normalize.js (96%) rename {html5/runtime => runtime}/bridge/receiver.js (100%) rename {html5/render/native => runtime/entries}/index.js (94%) create mode 100644 runtime/entries/rax.js rename {html5/render/native => runtime/entries}/setup.js (89%) create mode 100644 runtime/entries/vue.js rename {html5 => runtime}/frameworks/index.js (100%) rename {html5 => runtime}/frameworks/legacy/api/methods.js (100%) rename {html5 => runtime}/frameworks/legacy/api/modules.js (100%) rename {html5 => runtime}/frameworks/legacy/app/bundle/bootstrap.js (100%) rename {html5 => runtime}/frameworks/legacy/app/bundle/define.js (100%) rename {html5 => runtime}/frameworks/legacy/app/bundle/index.js (100%) rename {html5 => runtime}/frameworks/legacy/app/ctrl/index.js (100%) rename {html5 => runtime}/frameworks/legacy/app/ctrl/init.js (100%) rename {html5 => runtime}/frameworks/legacy/app/ctrl/misc.js (100%) rename {html5 => runtime}/frameworks/legacy/app/differ.js (100%) rename {html5 => runtime}/frameworks/legacy/app/downgrade.js (100%) rename {html5 => runtime}/frameworks/legacy/app/index.js (100%) rename {html5 => runtime}/frameworks/legacy/app/instance.js (100%) rename {html5 => runtime}/frameworks/legacy/app/register.js (100%) rename {html5 => runtime}/frameworks/legacy/app/viewport.js (100%) rename {html5 => runtime}/frameworks/legacy/config.js (100%) rename {html5 => runtime}/frameworks/legacy/core/LICENSE (100%) rename {html5 => runtime}/frameworks/legacy/core/array.js (100%) rename {html5 => runtime}/frameworks/legacy/core/dep.js (100%) rename {html5 => runtime}/frameworks/legacy/core/object.js (100%) rename {html5 => runtime}/frameworks/legacy/core/observer.js (100%) rename {html5 => runtime}/frameworks/legacy/core/state.js (100%) rename {html5 => runtime}/frameworks/legacy/core/watcher.js (100%) rename {html5 => runtime}/frameworks/legacy/index.js (100%) rename {html5 => runtime}/frameworks/legacy/static/bridge.js (100%) rename {html5 => runtime}/frameworks/legacy/static/create.js (100%) rename {html5 => runtime}/frameworks/legacy/static/life.js (100%) rename {html5 => runtime}/frameworks/legacy/static/map.js (100%) rename {html5 => runtime}/frameworks/legacy/static/misc.js (100%) rename {html5 => runtime}/frameworks/legacy/static/register.js (100%) rename {html5 => runtime}/frameworks/legacy/util/LICENSE (100%) rename {html5 => runtime}/frameworks/legacy/util/index.js (100%) rename {html5 => runtime}/frameworks/legacy/util/shared.js (100%) rename {html5 => runtime}/frameworks/legacy/vm/compiler.js (100%) rename {html5 => runtime}/frameworks/legacy/vm/directive.js (100%) rename {html5 => runtime}/frameworks/legacy/vm/dom-helper.js (100%) rename {html5 => runtime}/frameworks/legacy/vm/events.js (100%) rename {html5 => runtime}/frameworks/legacy/vm/index.js (100%) rename {html5 => runtime}/frameworks/vanilla/index.js (100%) rename {html5 => runtime}/services/amd/index.js (100%) rename {html5 => runtime}/services/broadcast-channel/index.js (100%) rename {html5 => runtime}/services/broadcast-channel/message-event.js (100%) rename {html5 => runtime}/services/index.js (100%) rename {html5/shared => runtime/shared/env}/console.js (100%) rename {html5/shared => runtime/shared/env}/freeze.js (100%) rename {html5/shared => runtime/shared/env}/setTimeout.js (100%) rename {html5 => runtime}/shared/index.js (81%) rename {html5/shared => runtime/shared/polyfill}/arrayFrom.js (100%) rename {html5/shared => runtime/shared/polyfill}/objectAssign.js (100%) rename {html5/shared => runtime/shared/polyfill}/objectSetPrototypeOf.js (100%) rename {html5/shared => runtime/shared/polyfill}/promise.js (100%) rename {html5/runtime => runtime/shared}/utils.js (100%) rename {html5/runtime => runtime}/vdom/Comment.js (96%) rename {html5/runtime => runtime}/vdom/Document.js (100%) rename {html5/runtime => runtime}/vdom/Element.js (99%) rename {html5/runtime => runtime}/vdom/Node.js (96%) rename {html5/runtime => runtime}/vdom/WeexElement.js (100%) rename {html5/runtime => runtime}/vdom/index.js (100%) rename {html5/runtime => runtime}/vdom/operation.js (100%) rename {html5/test => test/js-framework}/case/.eslintrc (100%) rename {html5/test => test/js-framework}/case/basic/append-root.output.js (100%) rename {html5/test => test/js-framework}/case/basic/append-root.source.js (100%) rename {html5/test => test/js-framework}/case/basic/append.output.js (100%) rename {html5/test => test/js-framework}/case/basic/append.source.js (100%) rename {html5/test => test/js-framework}/case/basic/backward1.output.js (100%) rename {html5/test => test/js-framework}/case/basic/backward1.source.js (100%) rename {html5/test => test/js-framework}/case/basic/backward2.output.js (100%) rename {html5/test => test/js-framework}/case/basic/backward2.source.js (100%) rename {html5/test => test/js-framework}/case/basic/components.output.js (100%) rename {html5/test => test/js-framework}/case/basic/components.source.js (100%) rename {html5/test => test/js-framework}/case/basic/computed-in-repeat.output.js (100%) rename {html5/test => test/js-framework}/case/basic/computed-in-repeat.source.js (100%) rename {html5/test => test/js-framework}/case/basic/created.output.js (100%) rename {html5/test => test/js-framework}/case/basic/created.source.js (100%) rename {html5/test => test/js-framework}/case/basic/dynamic-id.output.js (100%) rename {html5/test => test/js-framework}/case/basic/dynamic-id.source.js (100%) rename {html5/test => test/js-framework}/case/basic/dynamic-property.output.js (100%) rename {html5/test => test/js-framework}/case/basic/dynamic-property.source.js (100%) rename {html5/test => test/js-framework}/case/basic/dynamic-type.output.js (100%) rename {html5/test => test/js-framework}/case/basic/dynamic-type.source.js (100%) rename {html5/test => test/js-framework}/case/basic/foo.output.js (100%) rename {html5/test => test/js-framework}/case/basic/foo.source.js (100%) rename {html5/test => test/js-framework}/case/basic/foo2.output.js (100%) rename {html5/test => test/js-framework}/case/basic/foo2.source.js (100%) rename {html5/test => test/js-framework}/case/basic/foo3.output.js (100%) rename {html5/test => test/js-framework}/case/basic/foo3.source.js (100%) rename {html5/test => test/js-framework}/case/basic/foo4.output.js (100%) rename {html5/test => test/js-framework}/case/basic/foo4.source.js (100%) rename {html5/test => test/js-framework}/case/basic/foo5.output.js (100%) rename {html5/test => test/js-framework}/case/basic/foo5.source.js (100%) rename {html5/test => test/js-framework}/case/basic/foo6.output.js (100%) rename {html5/test => test/js-framework}/case/basic/foo6.source.js (100%) rename {html5/test => test/js-framework}/case/basic/foo7.output.js (100%) rename {html5/test => test/js-framework}/case/basic/foo7.source.js (100%) rename {html5/test => test/js-framework}/case/basic/foo8.output.js (100%) rename {html5/test => test/js-framework}/case/basic/foo8.source.js (100%) rename {html5/test => test/js-framework}/case/basic/foo9.output.js (100%) rename {html5/test => test/js-framework}/case/basic/foo9.source.js (100%) rename {html5/test => test/js-framework}/case/basic/global-weex-object.output.js (100%) rename {html5/test => test/js-framework}/case/basic/global-weex-object.source.js (100%) rename {html5/test => test/js-framework}/case/basic/id.output.js (100%) rename {html5/test => test/js-framework}/case/basic/id.source.js (100%) rename {html5/test => test/js-framework}/case/basic/if-repeat.output.js (100%) rename {html5/test => test/js-framework}/case/basic/if-repeat.source.js (100%) rename {html5/test => test/js-framework}/case/basic/if-root.output.js (100%) rename {html5/test => test/js-framework}/case/basic/if-root.source.js (100%) rename {html5/test => test/js-framework}/case/basic/if.output.js (100%) rename {html5/test => test/js-framework}/case/basic/if.source.js (100%) rename {html5/test => test/js-framework}/case/basic/promise.output.js (100%) rename {html5/test => test/js-framework}/case/basic/promise.source.js (100%) rename {html5/test => test/js-framework}/case/basic/ready.output.js (100%) rename {html5/test => test/js-framework}/case/basic/ready.source.js (100%) rename {html5/test => test/js-framework}/case/basic/repeat-array-kv.output.js (100%) rename {html5/test => test/js-framework}/case/basic/repeat-array-kv.source.js (100%) rename {html5/test => test/js-framework}/case/basic/repeat-array-no-kv.output.js (100%) rename {html5/test => test/js-framework}/case/basic/repeat-array-no-kv.source.js (100%) rename {html5/test => test/js-framework}/case/basic/repeat-array-non-obj.output.js (100%) rename {html5/test => test/js-framework}/case/basic/repeat-array-non-obj.source.js (100%) rename {html5/test => test/js-framework}/case/basic/repeat-array-v.output.js (100%) rename {html5/test => test/js-framework}/case/basic/repeat-array-v.source.js (100%) rename {html5/test => test/js-framework}/case/basic/repeat-index.output.js (100%) rename {html5/test => test/js-framework}/case/basic/repeat-index.source.js (100%) rename {html5/test => test/js-framework}/case/basic/repeat-root.output.js (100%) rename {html5/test => test/js-framework}/case/basic/repeat-root.source.js (100%) rename {html5/test => test/js-framework}/case/basic/repeat-watch.output.js (100%) rename {html5/test => test/js-framework}/case/basic/repeat-watch.source.js (100%) rename {html5/test => test/js-framework}/case/basic/require.output.js (100%) rename {html5/test => test/js-framework}/case/basic/require.source.js (100%) rename {html5/test => test/js-framework}/case/basic/reset-style.output.js (100%) rename {html5/test => test/js-framework}/case/basic/reset-style.source.js (100%) rename {html5/test => test/js-framework}/case/basic/static1.output.js (100%) rename {html5/test => test/js-framework}/case/basic/static1.source.js (100%) rename {html5/test => test/js-framework}/case/basic/static2.output.js (100%) rename {html5/test => test/js-framework}/case/basic/static2.source.js (100%) rename {html5/test => test/js-framework}/case/basic/static3.output.js (100%) rename {html5/test => test/js-framework}/case/basic/static3.source.js (100%) rename {html5/test => test/js-framework}/case/basic/static4.output.js (100%) rename {html5/test => test/js-framework}/case/basic/static4.source.js (100%) rename {html5/test => test/js-framework}/case/basic/subvm.output.js (100%) rename {html5/test => test/js-framework}/case/basic/subvm.source.js (100%) rename {html5/test => test/js-framework}/case/basic/transformer1.output.js (100%) rename {html5/test => test/js-framework}/case/basic/transformer1.source.js (100%) rename {html5/test => test/js-framework}/case/complex/append-root-event.output.js (100%) rename {html5/test => test/js-framework}/case/complex/append-root-event.source.js (100%) rename {html5/test => test/js-framework}/case/complex/click.output.js (100%) rename {html5/test => test/js-framework}/case/complex/click.source.js (100%) rename {html5/test => test/js-framework}/case/complex/component-append-tree.output.js (100%) rename {html5/test => test/js-framework}/case/complex/component-append-tree.source.js (100%) rename {html5/test => test/js-framework}/case/complex/computed.output.js (100%) rename {html5/test => test/js-framework}/case/complex/computed.source.js (100%) rename {html5/test => test/js-framework}/case/complex/if-refresh.output.js (100%) rename {html5/test => test/js-framework}/case/complex/if-refresh.source.js (100%) rename {html5/test => test/js-framework}/case/complex/if-repeat-refresh.output.js (100%) rename {html5/test => test/js-framework}/case/complex/if-repeat-refresh.source.js (100%) rename {html5/test => test/js-framework}/case/complex/inline-click.output.js (100%) rename {html5/test => test/js-framework}/case/complex/inline-click.source.js (100%) rename {html5/test => test/js-framework}/case/complex/input-binding.output.js (100%) rename {html5/test => test/js-framework}/case/complex/input-binding.source.js (100%) rename {html5/test => test/js-framework}/case/complex/refresh2.output.js (100%) rename {html5/test => test/js-framework}/case/complex/refresh2.source.js (100%) rename {html5/test => test/js-framework}/case/complex/repeat-track-by.output.js (100%) rename {html5/test => test/js-framework}/case/complex/repeat-track-by.source.js (100%) rename {html5/test => test/js-framework}/case/complex/transformer2.output.js (100%) rename {html5/test => test/js-framework}/case/complex/transformer2.source.js (100%) rename {html5/test => test/js-framework}/case/complex/transformer3.output.js (100%) rename {html5/test => test/js-framework}/case/complex/transformer3.source.js (100%) rename {html5/test => test/js-framework}/case/multi/clear-dep-target-error.source.js (100%) rename {html5/test => test/js-framework}/case/multi/clear-dep-target-fine.output.js (100%) rename {html5/test => test/js-framework}/case/multi/clear-dep-target-fine.source.js (100%) rename {html5/test => test/js-framework}/case/multi/clear-moduleA.output.js (100%) rename {html5/test => test/js-framework}/case/multi/clear-moduleA.source.js (100%) rename {html5/test => test/js-framework}/case/multi/clear-moduleB.output.js (100%) rename {html5/test => test/js-framework}/case/multi/clear-moduleB.source.js (100%) rename {html5/test => test/js-framework}/case/prepare.js (87%) rename {html5/test => test/js-framework}/case/signals/modal.output.js (100%) rename {html5/test => test/js-framework}/case/signals/modal.source.js (100%) rename {html5/test => test/js-framework}/case/signals/signals-long.source.js (100%) rename {html5/test => test/js-framework}/case/signals/signals.source.js (100%) rename {html5/test => test/js-framework}/case/signals/timer.output.js (100%) rename {html5/test => test/js-framework}/case/signals/timer.source.js (100%) rename {html5/test => test/js-framework}/case/tester.js (100%) rename {html5/test => test/js-framework}/case/throws/global-variable1.source.js (100%) rename {html5/test => test/js-framework}/case/throws/global-variable2.source.js (100%) rename {html5/test => test/js-framework}/case/throws/global-variable3.source.js (100%) rename {html5/test => test/js-framework}/unit/default/api/methods.js (93%) rename {html5/test => test/js-framework}/unit/default/api/modules.js (91%) rename {html5/test => test/js-framework}/unit/default/app/bundle.js (96%) rename {html5/test => test/js-framework}/unit/default/app/ctrl.js (96%) rename {html5/test => test/js-framework}/unit/default/app/downgrade.js (98%) rename {html5/test => test/js-framework}/unit/default/app/index.js (96%) rename {html5/test => test/js-framework}/unit/default/app/register.js (98%) rename {html5/test => test/js-framework}/unit/default/app/viewport.js (96%) rename {html5/test => test/js-framework}/unit/default/util/index.js (98%) rename {html5/test => test/js-framework}/unit/default/util/shared.js (98%) rename {html5/test => test/js-framework}/unit/default/vm/directive.js (96%) rename {html5/test => test/js-framework}/unit/default/vm/dom-helper.js (98%) rename {html5/test => test/js-framework}/unit/default/vm/events.js (98%) rename {html5/test => test/js-framework}/unit/default/vm/vm.js (99%) rename {html5/test => test/js-framework}/unit/runtime/legacy-framework.js (95%) rename {html5/test => test/js-framework}/unit/runtime/runner/helper.js (93%) rename {html5/test => test/js-framework}/unit/runtime/runner/vanilla.js (100%) rename {html5/test => test/js-framework}/unit/runtime/runner/vue.js (100%) rename {html5/test => test/js-framework}/unit/runtime/utils.js (96%) rename {html5/test => test/js-framework}/unit/runtime/vdom/index.js (99%) rename {html5/test => test/js-framework}/unit/runtime/vdom/listener.js (98%) rename {html5/test => test/js-framework}/unit/runtime/vdom/node.js (97%) rename {html5/test => test/js-framework}/unit/shared/BroadcastChannel.js (97%) rename {html5/test => test/js-framework}/unit/shared/arrayFrom.js (98%) rename {html5/test => test/js-framework}/unit/shared/console.js (98%) rename {html5/test => test/js-framework}/unit/shared/index.js (97%) rename {html5/test => test/js-framework}/unit/shared/objectAssign.js (95%) rename {html5/test => test/js-framework}/unit/shared/objectSetPrototypeOf.js (95%) rename {html5/test => test/js-framework}/unit/vanilla/index.js (97%) diff --git a/html5/render/vue/README.md b/html5/render/vue/README.md deleted file mode 100644 index a8bf32e015..0000000000 --- a/html5/render/vue/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# weex-vue-render - -This project has been moved to [weexteam group](https://github.com/weexteam/weex-vue-render) diff --git a/html5/runtime/api/WeexInstance.js b/runtime/api/WeexInstance.js similarity index 100% rename from html5/runtime/api/WeexInstance.js rename to runtime/api/WeexInstance.js diff --git a/html5/runtime/api/component.js b/runtime/api/component.js similarity index 100% rename from html5/runtime/api/component.js rename to runtime/api/component.js diff --git a/html5/runtime/api/config.js b/runtime/api/config.js similarity index 100% rename from html5/runtime/api/config.js rename to runtime/api/config.js diff --git a/html5/runtime/index.js b/runtime/api/index.js similarity index 68% rename from html5/runtime/index.js rename to runtime/api/index.js index 90c425e953..a024db752f 100644 --- a/html5/runtime/index.js +++ b/runtime/api/index.js @@ -17,23 +17,12 @@ * under the License. */ -/** - * @fileOverview - * Register framework(s) in JS runtime. Weex supply two layers for 3rd-party - * framework(s): one is the instance management layer, another is the - * virtual-DOM layer. - */ - -import * as shared from '../shared' - -import init from './api/init' -import config from './api/config' -import { register, unregister, has } from './api/service' +import init from './init' +import config from './config' +import { register, unregister, has } from './service' /* istanbul ignore next */ function freezePrototype () { - shared.freezePrototype() - // Object.freeze(config.Element) Object.freeze(config.Comment) Object.freeze(config.Listener) @@ -44,10 +33,6 @@ function freezePrototype () { } export default { - setNativeConsole: shared.setNativeConsole, - resetNativeConsole: shared.resetNativeConsole, - setNativeTimer: shared.setNativeTimer, - resetNativeTimer: shared.resetNativeTimer, service: { register, unregister, has }, freezePrototype, init, diff --git a/html5/runtime/api/init.js b/runtime/api/init.js similarity index 100% rename from html5/runtime/api/init.js rename to runtime/api/init.js diff --git a/html5/runtime/api/module.js b/runtime/api/module.js similarity index 100% rename from html5/runtime/api/module.js rename to runtime/api/module.js diff --git a/html5/runtime/api/service.js b/runtime/api/service.js similarity index 100% rename from html5/runtime/api/service.js rename to runtime/api/service.js diff --git a/html5/runtime/bridge/CallbackManager.js b/runtime/bridge/CallbackManager.js similarity index 100% rename from html5/runtime/bridge/CallbackManager.js rename to runtime/bridge/CallbackManager.js diff --git a/html5/runtime/bridge/Handler.js b/runtime/bridge/Handler.js similarity index 100% rename from html5/runtime/bridge/Handler.js rename to runtime/bridge/Handler.js diff --git a/html5/runtime/bridge/Listener.js b/runtime/bridge/Listener.js similarity index 100% rename from html5/runtime/bridge/Listener.js rename to runtime/bridge/Listener.js diff --git a/html5/runtime/bridge/TaskCenter.js b/runtime/bridge/TaskCenter.js similarity index 99% rename from html5/runtime/bridge/TaskCenter.js rename to runtime/bridge/TaskCenter.js index defee6fff4..c2652c0735 100644 --- a/html5/runtime/bridge/TaskCenter.js +++ b/runtime/bridge/TaskCenter.js @@ -19,7 +19,7 @@ import CallbackManager from './CallbackManager' import Element from '../vdom/Element' -import { typof } from '../utils' +import { typof } from '../shared/utils' import { normalizePrimitive } from './normalize' let fallback = function () {} diff --git a/html5/runtime/bridge/debug.js b/runtime/bridge/debug.js similarity index 100% rename from html5/runtime/bridge/debug.js rename to runtime/bridge/debug.js diff --git a/html5/runtime/bridge/normalize.js b/runtime/bridge/normalize.js similarity index 96% rename from html5/runtime/bridge/normalize.js rename to runtime/bridge/normalize.js index d7f2450c1b..4c6a058eb2 100644 --- a/html5/runtime/bridge/normalize.js +++ b/runtime/bridge/normalize.js @@ -17,7 +17,7 @@ * under the License. */ -import { typof, bufferToBase64, base64ToBuffer } from '../utils' +import { typof, bufferToBase64, base64ToBuffer } from '../shared/utils' /** * Normalize a primitive value. diff --git a/html5/runtime/bridge/receiver.js b/runtime/bridge/receiver.js similarity index 100% rename from html5/runtime/bridge/receiver.js rename to runtime/bridge/receiver.js diff --git a/html5/render/native/index.js b/runtime/entries/index.js similarity index 94% rename from html5/render/native/index.js rename to runtime/entries/index.js index c692995b2c..9d590b6a78 100644 --- a/html5/render/native/index.js +++ b/runtime/entries/index.js @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ + import setup from './setup' -import frameworks from '../../frameworks/index' +import frameworks from '../frameworks' setup(frameworks) diff --git a/runtime/entries/rax.js b/runtime/entries/rax.js new file mode 100644 index 0000000000..2aa17fdef4 --- /dev/null +++ b/runtime/entries/rax.js @@ -0,0 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import setup from './setup' +import * as Rax from 'weex-rax-framework' + +setup({ Rax }) diff --git a/html5/render/native/setup.js b/runtime/entries/setup.js similarity index 89% rename from html5/render/native/setup.js rename to runtime/entries/setup.js index d7404cbaf5..7c597122d3 100644 --- a/html5/render/native/setup.js +++ b/runtime/entries/setup.js @@ -17,9 +17,10 @@ * under the License. */ -import { subversion } from '../../../package.json' -import runtime from '../../runtime' -import services from '../../services/index' +import { subversion } from '../../package.json' +import * as shared from '../shared' +import runtime from '../api' +import services from '../services' /** * Setup frameworks with runtime. @@ -35,8 +36,9 @@ export default function (frameworks) { runtime.service.register(serviceName, services[serviceName]) } + shared.freezePrototype() + shared.setNativeConsole() runtime.freezePrototype() - runtime.setNativeConsole() // register framework meta info global.frameworkVersion = native diff --git a/runtime/entries/vue.js b/runtime/entries/vue.js new file mode 100644 index 0000000000..3cc816b667 --- /dev/null +++ b/runtime/entries/vue.js @@ -0,0 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import setup from './setup' +import * as Vue from 'weex-vue-framework' + +setup({ Vue }) diff --git a/html5/frameworks/index.js b/runtime/frameworks/index.js similarity index 100% rename from html5/frameworks/index.js rename to runtime/frameworks/index.js diff --git a/html5/frameworks/legacy/api/methods.js b/runtime/frameworks/legacy/api/methods.js similarity index 100% rename from html5/frameworks/legacy/api/methods.js rename to runtime/frameworks/legacy/api/methods.js diff --git a/html5/frameworks/legacy/api/modules.js b/runtime/frameworks/legacy/api/modules.js similarity index 100% rename from html5/frameworks/legacy/api/modules.js rename to runtime/frameworks/legacy/api/modules.js diff --git a/html5/frameworks/legacy/app/bundle/bootstrap.js b/runtime/frameworks/legacy/app/bundle/bootstrap.js similarity index 100% rename from html5/frameworks/legacy/app/bundle/bootstrap.js rename to runtime/frameworks/legacy/app/bundle/bootstrap.js diff --git a/html5/frameworks/legacy/app/bundle/define.js b/runtime/frameworks/legacy/app/bundle/define.js similarity index 100% rename from html5/frameworks/legacy/app/bundle/define.js rename to runtime/frameworks/legacy/app/bundle/define.js diff --git a/html5/frameworks/legacy/app/bundle/index.js b/runtime/frameworks/legacy/app/bundle/index.js similarity index 100% rename from html5/frameworks/legacy/app/bundle/index.js rename to runtime/frameworks/legacy/app/bundle/index.js diff --git a/html5/frameworks/legacy/app/ctrl/index.js b/runtime/frameworks/legacy/app/ctrl/index.js similarity index 100% rename from html5/frameworks/legacy/app/ctrl/index.js rename to runtime/frameworks/legacy/app/ctrl/index.js diff --git a/html5/frameworks/legacy/app/ctrl/init.js b/runtime/frameworks/legacy/app/ctrl/init.js similarity index 100% rename from html5/frameworks/legacy/app/ctrl/init.js rename to runtime/frameworks/legacy/app/ctrl/init.js diff --git a/html5/frameworks/legacy/app/ctrl/misc.js b/runtime/frameworks/legacy/app/ctrl/misc.js similarity index 100% rename from html5/frameworks/legacy/app/ctrl/misc.js rename to runtime/frameworks/legacy/app/ctrl/misc.js diff --git a/html5/frameworks/legacy/app/differ.js b/runtime/frameworks/legacy/app/differ.js similarity index 100% rename from html5/frameworks/legacy/app/differ.js rename to runtime/frameworks/legacy/app/differ.js diff --git a/html5/frameworks/legacy/app/downgrade.js b/runtime/frameworks/legacy/app/downgrade.js similarity index 100% rename from html5/frameworks/legacy/app/downgrade.js rename to runtime/frameworks/legacy/app/downgrade.js diff --git a/html5/frameworks/legacy/app/index.js b/runtime/frameworks/legacy/app/index.js similarity index 100% rename from html5/frameworks/legacy/app/index.js rename to runtime/frameworks/legacy/app/index.js diff --git a/html5/frameworks/legacy/app/instance.js b/runtime/frameworks/legacy/app/instance.js similarity index 100% rename from html5/frameworks/legacy/app/instance.js rename to runtime/frameworks/legacy/app/instance.js diff --git a/html5/frameworks/legacy/app/register.js b/runtime/frameworks/legacy/app/register.js similarity index 100% rename from html5/frameworks/legacy/app/register.js rename to runtime/frameworks/legacy/app/register.js diff --git a/html5/frameworks/legacy/app/viewport.js b/runtime/frameworks/legacy/app/viewport.js similarity index 100% rename from html5/frameworks/legacy/app/viewport.js rename to runtime/frameworks/legacy/app/viewport.js diff --git a/html5/frameworks/legacy/config.js b/runtime/frameworks/legacy/config.js similarity index 100% rename from html5/frameworks/legacy/config.js rename to runtime/frameworks/legacy/config.js diff --git a/html5/frameworks/legacy/core/LICENSE b/runtime/frameworks/legacy/core/LICENSE similarity index 100% rename from html5/frameworks/legacy/core/LICENSE rename to runtime/frameworks/legacy/core/LICENSE diff --git a/html5/frameworks/legacy/core/array.js b/runtime/frameworks/legacy/core/array.js similarity index 100% rename from html5/frameworks/legacy/core/array.js rename to runtime/frameworks/legacy/core/array.js diff --git a/html5/frameworks/legacy/core/dep.js b/runtime/frameworks/legacy/core/dep.js similarity index 100% rename from html5/frameworks/legacy/core/dep.js rename to runtime/frameworks/legacy/core/dep.js diff --git a/html5/frameworks/legacy/core/object.js b/runtime/frameworks/legacy/core/object.js similarity index 100% rename from html5/frameworks/legacy/core/object.js rename to runtime/frameworks/legacy/core/object.js diff --git a/html5/frameworks/legacy/core/observer.js b/runtime/frameworks/legacy/core/observer.js similarity index 100% rename from html5/frameworks/legacy/core/observer.js rename to runtime/frameworks/legacy/core/observer.js diff --git a/html5/frameworks/legacy/core/state.js b/runtime/frameworks/legacy/core/state.js similarity index 100% rename from html5/frameworks/legacy/core/state.js rename to runtime/frameworks/legacy/core/state.js diff --git a/html5/frameworks/legacy/core/watcher.js b/runtime/frameworks/legacy/core/watcher.js similarity index 100% rename from html5/frameworks/legacy/core/watcher.js rename to runtime/frameworks/legacy/core/watcher.js diff --git a/html5/frameworks/legacy/index.js b/runtime/frameworks/legacy/index.js similarity index 100% rename from html5/frameworks/legacy/index.js rename to runtime/frameworks/legacy/index.js diff --git a/html5/frameworks/legacy/static/bridge.js b/runtime/frameworks/legacy/static/bridge.js similarity index 100% rename from html5/frameworks/legacy/static/bridge.js rename to runtime/frameworks/legacy/static/bridge.js diff --git a/html5/frameworks/legacy/static/create.js b/runtime/frameworks/legacy/static/create.js similarity index 100% rename from html5/frameworks/legacy/static/create.js rename to runtime/frameworks/legacy/static/create.js diff --git a/html5/frameworks/legacy/static/life.js b/runtime/frameworks/legacy/static/life.js similarity index 100% rename from html5/frameworks/legacy/static/life.js rename to runtime/frameworks/legacy/static/life.js diff --git a/html5/frameworks/legacy/static/map.js b/runtime/frameworks/legacy/static/map.js similarity index 100% rename from html5/frameworks/legacy/static/map.js rename to runtime/frameworks/legacy/static/map.js diff --git a/html5/frameworks/legacy/static/misc.js b/runtime/frameworks/legacy/static/misc.js similarity index 100% rename from html5/frameworks/legacy/static/misc.js rename to runtime/frameworks/legacy/static/misc.js diff --git a/html5/frameworks/legacy/static/register.js b/runtime/frameworks/legacy/static/register.js similarity index 100% rename from html5/frameworks/legacy/static/register.js rename to runtime/frameworks/legacy/static/register.js diff --git a/html5/frameworks/legacy/util/LICENSE b/runtime/frameworks/legacy/util/LICENSE similarity index 100% rename from html5/frameworks/legacy/util/LICENSE rename to runtime/frameworks/legacy/util/LICENSE diff --git a/html5/frameworks/legacy/util/index.js b/runtime/frameworks/legacy/util/index.js similarity index 100% rename from html5/frameworks/legacy/util/index.js rename to runtime/frameworks/legacy/util/index.js diff --git a/html5/frameworks/legacy/util/shared.js b/runtime/frameworks/legacy/util/shared.js similarity index 100% rename from html5/frameworks/legacy/util/shared.js rename to runtime/frameworks/legacy/util/shared.js diff --git a/html5/frameworks/legacy/vm/compiler.js b/runtime/frameworks/legacy/vm/compiler.js similarity index 100% rename from html5/frameworks/legacy/vm/compiler.js rename to runtime/frameworks/legacy/vm/compiler.js diff --git a/html5/frameworks/legacy/vm/directive.js b/runtime/frameworks/legacy/vm/directive.js similarity index 100% rename from html5/frameworks/legacy/vm/directive.js rename to runtime/frameworks/legacy/vm/directive.js diff --git a/html5/frameworks/legacy/vm/dom-helper.js b/runtime/frameworks/legacy/vm/dom-helper.js similarity index 100% rename from html5/frameworks/legacy/vm/dom-helper.js rename to runtime/frameworks/legacy/vm/dom-helper.js diff --git a/html5/frameworks/legacy/vm/events.js b/runtime/frameworks/legacy/vm/events.js similarity index 100% rename from html5/frameworks/legacy/vm/events.js rename to runtime/frameworks/legacy/vm/events.js diff --git a/html5/frameworks/legacy/vm/index.js b/runtime/frameworks/legacy/vm/index.js similarity index 100% rename from html5/frameworks/legacy/vm/index.js rename to runtime/frameworks/legacy/vm/index.js diff --git a/html5/frameworks/vanilla/index.js b/runtime/frameworks/vanilla/index.js similarity index 100% rename from html5/frameworks/vanilla/index.js rename to runtime/frameworks/vanilla/index.js diff --git a/html5/services/amd/index.js b/runtime/services/amd/index.js similarity index 100% rename from html5/services/amd/index.js rename to runtime/services/amd/index.js diff --git a/html5/services/broadcast-channel/index.js b/runtime/services/broadcast-channel/index.js similarity index 100% rename from html5/services/broadcast-channel/index.js rename to runtime/services/broadcast-channel/index.js diff --git a/html5/services/broadcast-channel/message-event.js b/runtime/services/broadcast-channel/message-event.js similarity index 100% rename from html5/services/broadcast-channel/message-event.js rename to runtime/services/broadcast-channel/message-event.js diff --git a/html5/services/index.js b/runtime/services/index.js similarity index 100% rename from html5/services/index.js rename to runtime/services/index.js diff --git a/html5/shared/console.js b/runtime/shared/env/console.js similarity index 100% rename from html5/shared/console.js rename to runtime/shared/env/console.js diff --git a/html5/shared/freeze.js b/runtime/shared/env/freeze.js similarity index 100% rename from html5/shared/freeze.js rename to runtime/shared/env/freeze.js diff --git a/html5/shared/setTimeout.js b/runtime/shared/env/setTimeout.js similarity index 100% rename from html5/shared/setTimeout.js rename to runtime/shared/env/setTimeout.js diff --git a/html5/shared/index.js b/runtime/shared/index.js similarity index 81% rename from html5/shared/index.js rename to runtime/shared/index.js index 27b95c3feb..a478b86db3 100644 --- a/html5/shared/index.js +++ b/runtime/shared/index.js @@ -16,17 +16,18 @@ * specific language governing permissions and limitations * under the License. */ -import './arrayFrom' -import './objectAssign' -import './objectSetPrototypeOf' + +import './polyfill/arrayFrom' +import './polyfill/objectAssign' +import './polyfill/objectSetPrototypeOf' // import promise hack and polyfills -import './promise' +import './polyfill/promise' import 'core-js/modules/es6.object.to-string' import 'core-js/modules/es6.string.iterator' import 'core-js/modules/web.dom.iterable' import 'core-js/modules/es6.promise' -export * from './console' -export * from './setTimeout' -export * from './freeze' +export * from './env/console' +export * from './env/setTimeout' +export * from './env/freeze' diff --git a/html5/shared/arrayFrom.js b/runtime/shared/polyfill/arrayFrom.js similarity index 100% rename from html5/shared/arrayFrom.js rename to runtime/shared/polyfill/arrayFrom.js diff --git a/html5/shared/objectAssign.js b/runtime/shared/polyfill/objectAssign.js similarity index 100% rename from html5/shared/objectAssign.js rename to runtime/shared/polyfill/objectAssign.js diff --git a/html5/shared/objectSetPrototypeOf.js b/runtime/shared/polyfill/objectSetPrototypeOf.js similarity index 100% rename from html5/shared/objectSetPrototypeOf.js rename to runtime/shared/polyfill/objectSetPrototypeOf.js diff --git a/html5/shared/promise.js b/runtime/shared/polyfill/promise.js similarity index 100% rename from html5/shared/promise.js rename to runtime/shared/polyfill/promise.js diff --git a/html5/runtime/utils.js b/runtime/shared/utils.js similarity index 100% rename from html5/runtime/utils.js rename to runtime/shared/utils.js diff --git a/html5/runtime/vdom/Comment.js b/runtime/vdom/Comment.js similarity index 96% rename from html5/runtime/vdom/Comment.js rename to runtime/vdom/Comment.js index d7ab115d56..79f9e153c8 100644 --- a/html5/runtime/vdom/Comment.js +++ b/runtime/vdom/Comment.js @@ -18,7 +18,7 @@ */ import Node from './Node' -import { uniqueId } from '../utils' +import { uniqueId } from '../shared/utils' export default class Comment extends Node { constructor (value) { diff --git a/html5/runtime/vdom/Document.js b/runtime/vdom/Document.js similarity index 100% rename from html5/runtime/vdom/Document.js rename to runtime/vdom/Document.js diff --git a/html5/runtime/vdom/Element.js b/runtime/vdom/Element.js similarity index 99% rename from html5/runtime/vdom/Element.js rename to runtime/vdom/Element.js index 5ba05ba05c..3160b6d958 100644 --- a/html5/runtime/vdom/Element.js +++ b/runtime/vdom/Element.js @@ -28,7 +28,7 @@ import { moveIndex, removeIndex } from './operation' -import { uniqueId, isEmpty } from '../utils' +import { uniqueId, isEmpty } from '../shared/utils' import { getWeexElement, setElement } from './WeexElement' const DEFAULT_TAG_NAME = 'div' diff --git a/html5/runtime/vdom/Node.js b/runtime/vdom/Node.js similarity index 96% rename from html5/runtime/vdom/Node.js rename to runtime/vdom/Node.js index 645f7df73c..4f13edb246 100644 --- a/html5/runtime/vdom/Node.js +++ b/runtime/vdom/Node.js @@ -17,7 +17,7 @@ * under the License. */ -import { uniqueId } from '../utils' +import { uniqueId } from '../shared/utils' import { getDoc } from './operation' export default class Node { diff --git a/html5/runtime/vdom/WeexElement.js b/runtime/vdom/WeexElement.js similarity index 100% rename from html5/runtime/vdom/WeexElement.js rename to runtime/vdom/WeexElement.js diff --git a/html5/runtime/vdom/index.js b/runtime/vdom/index.js similarity index 100% rename from html5/runtime/vdom/index.js rename to runtime/vdom/index.js diff --git a/html5/runtime/vdom/operation.js b/runtime/vdom/operation.js similarity index 100% rename from html5/runtime/vdom/operation.js rename to runtime/vdom/operation.js diff --git a/html5/test/case/.eslintrc b/test/js-framework/case/.eslintrc similarity index 100% rename from html5/test/case/.eslintrc rename to test/js-framework/case/.eslintrc diff --git a/html5/test/case/basic/append-root.output.js b/test/js-framework/case/basic/append-root.output.js similarity index 100% rename from html5/test/case/basic/append-root.output.js rename to test/js-framework/case/basic/append-root.output.js diff --git a/html5/test/case/basic/append-root.source.js b/test/js-framework/case/basic/append-root.source.js similarity index 100% rename from html5/test/case/basic/append-root.source.js rename to test/js-framework/case/basic/append-root.source.js diff --git a/html5/test/case/basic/append.output.js b/test/js-framework/case/basic/append.output.js similarity index 100% rename from html5/test/case/basic/append.output.js rename to test/js-framework/case/basic/append.output.js diff --git a/html5/test/case/basic/append.source.js b/test/js-framework/case/basic/append.source.js similarity index 100% rename from html5/test/case/basic/append.source.js rename to test/js-framework/case/basic/append.source.js diff --git a/html5/test/case/basic/backward1.output.js b/test/js-framework/case/basic/backward1.output.js similarity index 100% rename from html5/test/case/basic/backward1.output.js rename to test/js-framework/case/basic/backward1.output.js diff --git a/html5/test/case/basic/backward1.source.js b/test/js-framework/case/basic/backward1.source.js similarity index 100% rename from html5/test/case/basic/backward1.source.js rename to test/js-framework/case/basic/backward1.source.js diff --git a/html5/test/case/basic/backward2.output.js b/test/js-framework/case/basic/backward2.output.js similarity index 100% rename from html5/test/case/basic/backward2.output.js rename to test/js-framework/case/basic/backward2.output.js diff --git a/html5/test/case/basic/backward2.source.js b/test/js-framework/case/basic/backward2.source.js similarity index 100% rename from html5/test/case/basic/backward2.source.js rename to test/js-framework/case/basic/backward2.source.js diff --git a/html5/test/case/basic/components.output.js b/test/js-framework/case/basic/components.output.js similarity index 100% rename from html5/test/case/basic/components.output.js rename to test/js-framework/case/basic/components.output.js diff --git a/html5/test/case/basic/components.source.js b/test/js-framework/case/basic/components.source.js similarity index 100% rename from html5/test/case/basic/components.source.js rename to test/js-framework/case/basic/components.source.js diff --git a/html5/test/case/basic/computed-in-repeat.output.js b/test/js-framework/case/basic/computed-in-repeat.output.js similarity index 100% rename from html5/test/case/basic/computed-in-repeat.output.js rename to test/js-framework/case/basic/computed-in-repeat.output.js diff --git a/html5/test/case/basic/computed-in-repeat.source.js b/test/js-framework/case/basic/computed-in-repeat.source.js similarity index 100% rename from html5/test/case/basic/computed-in-repeat.source.js rename to test/js-framework/case/basic/computed-in-repeat.source.js diff --git a/html5/test/case/basic/created.output.js b/test/js-framework/case/basic/created.output.js similarity index 100% rename from html5/test/case/basic/created.output.js rename to test/js-framework/case/basic/created.output.js diff --git a/html5/test/case/basic/created.source.js b/test/js-framework/case/basic/created.source.js similarity index 100% rename from html5/test/case/basic/created.source.js rename to test/js-framework/case/basic/created.source.js diff --git a/html5/test/case/basic/dynamic-id.output.js b/test/js-framework/case/basic/dynamic-id.output.js similarity index 100% rename from html5/test/case/basic/dynamic-id.output.js rename to test/js-framework/case/basic/dynamic-id.output.js diff --git a/html5/test/case/basic/dynamic-id.source.js b/test/js-framework/case/basic/dynamic-id.source.js similarity index 100% rename from html5/test/case/basic/dynamic-id.source.js rename to test/js-framework/case/basic/dynamic-id.source.js diff --git a/html5/test/case/basic/dynamic-property.output.js b/test/js-framework/case/basic/dynamic-property.output.js similarity index 100% rename from html5/test/case/basic/dynamic-property.output.js rename to test/js-framework/case/basic/dynamic-property.output.js diff --git a/html5/test/case/basic/dynamic-property.source.js b/test/js-framework/case/basic/dynamic-property.source.js similarity index 100% rename from html5/test/case/basic/dynamic-property.source.js rename to test/js-framework/case/basic/dynamic-property.source.js diff --git a/html5/test/case/basic/dynamic-type.output.js b/test/js-framework/case/basic/dynamic-type.output.js similarity index 100% rename from html5/test/case/basic/dynamic-type.output.js rename to test/js-framework/case/basic/dynamic-type.output.js diff --git a/html5/test/case/basic/dynamic-type.source.js b/test/js-framework/case/basic/dynamic-type.source.js similarity index 100% rename from html5/test/case/basic/dynamic-type.source.js rename to test/js-framework/case/basic/dynamic-type.source.js diff --git a/html5/test/case/basic/foo.output.js b/test/js-framework/case/basic/foo.output.js similarity index 100% rename from html5/test/case/basic/foo.output.js rename to test/js-framework/case/basic/foo.output.js diff --git a/html5/test/case/basic/foo.source.js b/test/js-framework/case/basic/foo.source.js similarity index 100% rename from html5/test/case/basic/foo.source.js rename to test/js-framework/case/basic/foo.source.js diff --git a/html5/test/case/basic/foo2.output.js b/test/js-framework/case/basic/foo2.output.js similarity index 100% rename from html5/test/case/basic/foo2.output.js rename to test/js-framework/case/basic/foo2.output.js diff --git a/html5/test/case/basic/foo2.source.js b/test/js-framework/case/basic/foo2.source.js similarity index 100% rename from html5/test/case/basic/foo2.source.js rename to test/js-framework/case/basic/foo2.source.js diff --git a/html5/test/case/basic/foo3.output.js b/test/js-framework/case/basic/foo3.output.js similarity index 100% rename from html5/test/case/basic/foo3.output.js rename to test/js-framework/case/basic/foo3.output.js diff --git a/html5/test/case/basic/foo3.source.js b/test/js-framework/case/basic/foo3.source.js similarity index 100% rename from html5/test/case/basic/foo3.source.js rename to test/js-framework/case/basic/foo3.source.js diff --git a/html5/test/case/basic/foo4.output.js b/test/js-framework/case/basic/foo4.output.js similarity index 100% rename from html5/test/case/basic/foo4.output.js rename to test/js-framework/case/basic/foo4.output.js diff --git a/html5/test/case/basic/foo4.source.js b/test/js-framework/case/basic/foo4.source.js similarity index 100% rename from html5/test/case/basic/foo4.source.js rename to test/js-framework/case/basic/foo4.source.js diff --git a/html5/test/case/basic/foo5.output.js b/test/js-framework/case/basic/foo5.output.js similarity index 100% rename from html5/test/case/basic/foo5.output.js rename to test/js-framework/case/basic/foo5.output.js diff --git a/html5/test/case/basic/foo5.source.js b/test/js-framework/case/basic/foo5.source.js similarity index 100% rename from html5/test/case/basic/foo5.source.js rename to test/js-framework/case/basic/foo5.source.js diff --git a/html5/test/case/basic/foo6.output.js b/test/js-framework/case/basic/foo6.output.js similarity index 100% rename from html5/test/case/basic/foo6.output.js rename to test/js-framework/case/basic/foo6.output.js diff --git a/html5/test/case/basic/foo6.source.js b/test/js-framework/case/basic/foo6.source.js similarity index 100% rename from html5/test/case/basic/foo6.source.js rename to test/js-framework/case/basic/foo6.source.js diff --git a/html5/test/case/basic/foo7.output.js b/test/js-framework/case/basic/foo7.output.js similarity index 100% rename from html5/test/case/basic/foo7.output.js rename to test/js-framework/case/basic/foo7.output.js diff --git a/html5/test/case/basic/foo7.source.js b/test/js-framework/case/basic/foo7.source.js similarity index 100% rename from html5/test/case/basic/foo7.source.js rename to test/js-framework/case/basic/foo7.source.js diff --git a/html5/test/case/basic/foo8.output.js b/test/js-framework/case/basic/foo8.output.js similarity index 100% rename from html5/test/case/basic/foo8.output.js rename to test/js-framework/case/basic/foo8.output.js diff --git a/html5/test/case/basic/foo8.source.js b/test/js-framework/case/basic/foo8.source.js similarity index 100% rename from html5/test/case/basic/foo8.source.js rename to test/js-framework/case/basic/foo8.source.js diff --git a/html5/test/case/basic/foo9.output.js b/test/js-framework/case/basic/foo9.output.js similarity index 100% rename from html5/test/case/basic/foo9.output.js rename to test/js-framework/case/basic/foo9.output.js diff --git a/html5/test/case/basic/foo9.source.js b/test/js-framework/case/basic/foo9.source.js similarity index 100% rename from html5/test/case/basic/foo9.source.js rename to test/js-framework/case/basic/foo9.source.js diff --git a/html5/test/case/basic/global-weex-object.output.js b/test/js-framework/case/basic/global-weex-object.output.js similarity index 100% rename from html5/test/case/basic/global-weex-object.output.js rename to test/js-framework/case/basic/global-weex-object.output.js diff --git a/html5/test/case/basic/global-weex-object.source.js b/test/js-framework/case/basic/global-weex-object.source.js similarity index 100% rename from html5/test/case/basic/global-weex-object.source.js rename to test/js-framework/case/basic/global-weex-object.source.js diff --git a/html5/test/case/basic/id.output.js b/test/js-framework/case/basic/id.output.js similarity index 100% rename from html5/test/case/basic/id.output.js rename to test/js-framework/case/basic/id.output.js diff --git a/html5/test/case/basic/id.source.js b/test/js-framework/case/basic/id.source.js similarity index 100% rename from html5/test/case/basic/id.source.js rename to test/js-framework/case/basic/id.source.js diff --git a/html5/test/case/basic/if-repeat.output.js b/test/js-framework/case/basic/if-repeat.output.js similarity index 100% rename from html5/test/case/basic/if-repeat.output.js rename to test/js-framework/case/basic/if-repeat.output.js diff --git a/html5/test/case/basic/if-repeat.source.js b/test/js-framework/case/basic/if-repeat.source.js similarity index 100% rename from html5/test/case/basic/if-repeat.source.js rename to test/js-framework/case/basic/if-repeat.source.js diff --git a/html5/test/case/basic/if-root.output.js b/test/js-framework/case/basic/if-root.output.js similarity index 100% rename from html5/test/case/basic/if-root.output.js rename to test/js-framework/case/basic/if-root.output.js diff --git a/html5/test/case/basic/if-root.source.js b/test/js-framework/case/basic/if-root.source.js similarity index 100% rename from html5/test/case/basic/if-root.source.js rename to test/js-framework/case/basic/if-root.source.js diff --git a/html5/test/case/basic/if.output.js b/test/js-framework/case/basic/if.output.js similarity index 100% rename from html5/test/case/basic/if.output.js rename to test/js-framework/case/basic/if.output.js diff --git a/html5/test/case/basic/if.source.js b/test/js-framework/case/basic/if.source.js similarity index 100% rename from html5/test/case/basic/if.source.js rename to test/js-framework/case/basic/if.source.js diff --git a/html5/test/case/basic/promise.output.js b/test/js-framework/case/basic/promise.output.js similarity index 100% rename from html5/test/case/basic/promise.output.js rename to test/js-framework/case/basic/promise.output.js diff --git a/html5/test/case/basic/promise.source.js b/test/js-framework/case/basic/promise.source.js similarity index 100% rename from html5/test/case/basic/promise.source.js rename to test/js-framework/case/basic/promise.source.js diff --git a/html5/test/case/basic/ready.output.js b/test/js-framework/case/basic/ready.output.js similarity index 100% rename from html5/test/case/basic/ready.output.js rename to test/js-framework/case/basic/ready.output.js diff --git a/html5/test/case/basic/ready.source.js b/test/js-framework/case/basic/ready.source.js similarity index 100% rename from html5/test/case/basic/ready.source.js rename to test/js-framework/case/basic/ready.source.js diff --git a/html5/test/case/basic/repeat-array-kv.output.js b/test/js-framework/case/basic/repeat-array-kv.output.js similarity index 100% rename from html5/test/case/basic/repeat-array-kv.output.js rename to test/js-framework/case/basic/repeat-array-kv.output.js diff --git a/html5/test/case/basic/repeat-array-kv.source.js b/test/js-framework/case/basic/repeat-array-kv.source.js similarity index 100% rename from html5/test/case/basic/repeat-array-kv.source.js rename to test/js-framework/case/basic/repeat-array-kv.source.js diff --git a/html5/test/case/basic/repeat-array-no-kv.output.js b/test/js-framework/case/basic/repeat-array-no-kv.output.js similarity index 100% rename from html5/test/case/basic/repeat-array-no-kv.output.js rename to test/js-framework/case/basic/repeat-array-no-kv.output.js diff --git a/html5/test/case/basic/repeat-array-no-kv.source.js b/test/js-framework/case/basic/repeat-array-no-kv.source.js similarity index 100% rename from html5/test/case/basic/repeat-array-no-kv.source.js rename to test/js-framework/case/basic/repeat-array-no-kv.source.js diff --git a/html5/test/case/basic/repeat-array-non-obj.output.js b/test/js-framework/case/basic/repeat-array-non-obj.output.js similarity index 100% rename from html5/test/case/basic/repeat-array-non-obj.output.js rename to test/js-framework/case/basic/repeat-array-non-obj.output.js diff --git a/html5/test/case/basic/repeat-array-non-obj.source.js b/test/js-framework/case/basic/repeat-array-non-obj.source.js similarity index 100% rename from html5/test/case/basic/repeat-array-non-obj.source.js rename to test/js-framework/case/basic/repeat-array-non-obj.source.js diff --git a/html5/test/case/basic/repeat-array-v.output.js b/test/js-framework/case/basic/repeat-array-v.output.js similarity index 100% rename from html5/test/case/basic/repeat-array-v.output.js rename to test/js-framework/case/basic/repeat-array-v.output.js diff --git a/html5/test/case/basic/repeat-array-v.source.js b/test/js-framework/case/basic/repeat-array-v.source.js similarity index 100% rename from html5/test/case/basic/repeat-array-v.source.js rename to test/js-framework/case/basic/repeat-array-v.source.js diff --git a/html5/test/case/basic/repeat-index.output.js b/test/js-framework/case/basic/repeat-index.output.js similarity index 100% rename from html5/test/case/basic/repeat-index.output.js rename to test/js-framework/case/basic/repeat-index.output.js diff --git a/html5/test/case/basic/repeat-index.source.js b/test/js-framework/case/basic/repeat-index.source.js similarity index 100% rename from html5/test/case/basic/repeat-index.source.js rename to test/js-framework/case/basic/repeat-index.source.js diff --git a/html5/test/case/basic/repeat-root.output.js b/test/js-framework/case/basic/repeat-root.output.js similarity index 100% rename from html5/test/case/basic/repeat-root.output.js rename to test/js-framework/case/basic/repeat-root.output.js diff --git a/html5/test/case/basic/repeat-root.source.js b/test/js-framework/case/basic/repeat-root.source.js similarity index 100% rename from html5/test/case/basic/repeat-root.source.js rename to test/js-framework/case/basic/repeat-root.source.js diff --git a/html5/test/case/basic/repeat-watch.output.js b/test/js-framework/case/basic/repeat-watch.output.js similarity index 100% rename from html5/test/case/basic/repeat-watch.output.js rename to test/js-framework/case/basic/repeat-watch.output.js diff --git a/html5/test/case/basic/repeat-watch.source.js b/test/js-framework/case/basic/repeat-watch.source.js similarity index 100% rename from html5/test/case/basic/repeat-watch.source.js rename to test/js-framework/case/basic/repeat-watch.source.js diff --git a/html5/test/case/basic/require.output.js b/test/js-framework/case/basic/require.output.js similarity index 100% rename from html5/test/case/basic/require.output.js rename to test/js-framework/case/basic/require.output.js diff --git a/html5/test/case/basic/require.source.js b/test/js-framework/case/basic/require.source.js similarity index 100% rename from html5/test/case/basic/require.source.js rename to test/js-framework/case/basic/require.source.js diff --git a/html5/test/case/basic/reset-style.output.js b/test/js-framework/case/basic/reset-style.output.js similarity index 100% rename from html5/test/case/basic/reset-style.output.js rename to test/js-framework/case/basic/reset-style.output.js diff --git a/html5/test/case/basic/reset-style.source.js b/test/js-framework/case/basic/reset-style.source.js similarity index 100% rename from html5/test/case/basic/reset-style.source.js rename to test/js-framework/case/basic/reset-style.source.js diff --git a/html5/test/case/basic/static1.output.js b/test/js-framework/case/basic/static1.output.js similarity index 100% rename from html5/test/case/basic/static1.output.js rename to test/js-framework/case/basic/static1.output.js diff --git a/html5/test/case/basic/static1.source.js b/test/js-framework/case/basic/static1.source.js similarity index 100% rename from html5/test/case/basic/static1.source.js rename to test/js-framework/case/basic/static1.source.js diff --git a/html5/test/case/basic/static2.output.js b/test/js-framework/case/basic/static2.output.js similarity index 100% rename from html5/test/case/basic/static2.output.js rename to test/js-framework/case/basic/static2.output.js diff --git a/html5/test/case/basic/static2.source.js b/test/js-framework/case/basic/static2.source.js similarity index 100% rename from html5/test/case/basic/static2.source.js rename to test/js-framework/case/basic/static2.source.js diff --git a/html5/test/case/basic/static3.output.js b/test/js-framework/case/basic/static3.output.js similarity index 100% rename from html5/test/case/basic/static3.output.js rename to test/js-framework/case/basic/static3.output.js diff --git a/html5/test/case/basic/static3.source.js b/test/js-framework/case/basic/static3.source.js similarity index 100% rename from html5/test/case/basic/static3.source.js rename to test/js-framework/case/basic/static3.source.js diff --git a/html5/test/case/basic/static4.output.js b/test/js-framework/case/basic/static4.output.js similarity index 100% rename from html5/test/case/basic/static4.output.js rename to test/js-framework/case/basic/static4.output.js diff --git a/html5/test/case/basic/static4.source.js b/test/js-framework/case/basic/static4.source.js similarity index 100% rename from html5/test/case/basic/static4.source.js rename to test/js-framework/case/basic/static4.source.js diff --git a/html5/test/case/basic/subvm.output.js b/test/js-framework/case/basic/subvm.output.js similarity index 100% rename from html5/test/case/basic/subvm.output.js rename to test/js-framework/case/basic/subvm.output.js diff --git a/html5/test/case/basic/subvm.source.js b/test/js-framework/case/basic/subvm.source.js similarity index 100% rename from html5/test/case/basic/subvm.source.js rename to test/js-framework/case/basic/subvm.source.js diff --git a/html5/test/case/basic/transformer1.output.js b/test/js-framework/case/basic/transformer1.output.js similarity index 100% rename from html5/test/case/basic/transformer1.output.js rename to test/js-framework/case/basic/transformer1.output.js diff --git a/html5/test/case/basic/transformer1.source.js b/test/js-framework/case/basic/transformer1.source.js similarity index 100% rename from html5/test/case/basic/transformer1.source.js rename to test/js-framework/case/basic/transformer1.source.js diff --git a/html5/test/case/complex/append-root-event.output.js b/test/js-framework/case/complex/append-root-event.output.js similarity index 100% rename from html5/test/case/complex/append-root-event.output.js rename to test/js-framework/case/complex/append-root-event.output.js diff --git a/html5/test/case/complex/append-root-event.source.js b/test/js-framework/case/complex/append-root-event.source.js similarity index 100% rename from html5/test/case/complex/append-root-event.source.js rename to test/js-framework/case/complex/append-root-event.source.js diff --git a/html5/test/case/complex/click.output.js b/test/js-framework/case/complex/click.output.js similarity index 100% rename from html5/test/case/complex/click.output.js rename to test/js-framework/case/complex/click.output.js diff --git a/html5/test/case/complex/click.source.js b/test/js-framework/case/complex/click.source.js similarity index 100% rename from html5/test/case/complex/click.source.js rename to test/js-framework/case/complex/click.source.js diff --git a/html5/test/case/complex/component-append-tree.output.js b/test/js-framework/case/complex/component-append-tree.output.js similarity index 100% rename from html5/test/case/complex/component-append-tree.output.js rename to test/js-framework/case/complex/component-append-tree.output.js diff --git a/html5/test/case/complex/component-append-tree.source.js b/test/js-framework/case/complex/component-append-tree.source.js similarity index 100% rename from html5/test/case/complex/component-append-tree.source.js rename to test/js-framework/case/complex/component-append-tree.source.js diff --git a/html5/test/case/complex/computed.output.js b/test/js-framework/case/complex/computed.output.js similarity index 100% rename from html5/test/case/complex/computed.output.js rename to test/js-framework/case/complex/computed.output.js diff --git a/html5/test/case/complex/computed.source.js b/test/js-framework/case/complex/computed.source.js similarity index 100% rename from html5/test/case/complex/computed.source.js rename to test/js-framework/case/complex/computed.source.js diff --git a/html5/test/case/complex/if-refresh.output.js b/test/js-framework/case/complex/if-refresh.output.js similarity index 100% rename from html5/test/case/complex/if-refresh.output.js rename to test/js-framework/case/complex/if-refresh.output.js diff --git a/html5/test/case/complex/if-refresh.source.js b/test/js-framework/case/complex/if-refresh.source.js similarity index 100% rename from html5/test/case/complex/if-refresh.source.js rename to test/js-framework/case/complex/if-refresh.source.js diff --git a/html5/test/case/complex/if-repeat-refresh.output.js b/test/js-framework/case/complex/if-repeat-refresh.output.js similarity index 100% rename from html5/test/case/complex/if-repeat-refresh.output.js rename to test/js-framework/case/complex/if-repeat-refresh.output.js diff --git a/html5/test/case/complex/if-repeat-refresh.source.js b/test/js-framework/case/complex/if-repeat-refresh.source.js similarity index 100% rename from html5/test/case/complex/if-repeat-refresh.source.js rename to test/js-framework/case/complex/if-repeat-refresh.source.js diff --git a/html5/test/case/complex/inline-click.output.js b/test/js-framework/case/complex/inline-click.output.js similarity index 100% rename from html5/test/case/complex/inline-click.output.js rename to test/js-framework/case/complex/inline-click.output.js diff --git a/html5/test/case/complex/inline-click.source.js b/test/js-framework/case/complex/inline-click.source.js similarity index 100% rename from html5/test/case/complex/inline-click.source.js rename to test/js-framework/case/complex/inline-click.source.js diff --git a/html5/test/case/complex/input-binding.output.js b/test/js-framework/case/complex/input-binding.output.js similarity index 100% rename from html5/test/case/complex/input-binding.output.js rename to test/js-framework/case/complex/input-binding.output.js diff --git a/html5/test/case/complex/input-binding.source.js b/test/js-framework/case/complex/input-binding.source.js similarity index 100% rename from html5/test/case/complex/input-binding.source.js rename to test/js-framework/case/complex/input-binding.source.js diff --git a/html5/test/case/complex/refresh2.output.js b/test/js-framework/case/complex/refresh2.output.js similarity index 100% rename from html5/test/case/complex/refresh2.output.js rename to test/js-framework/case/complex/refresh2.output.js diff --git a/html5/test/case/complex/refresh2.source.js b/test/js-framework/case/complex/refresh2.source.js similarity index 100% rename from html5/test/case/complex/refresh2.source.js rename to test/js-framework/case/complex/refresh2.source.js diff --git a/html5/test/case/complex/repeat-track-by.output.js b/test/js-framework/case/complex/repeat-track-by.output.js similarity index 100% rename from html5/test/case/complex/repeat-track-by.output.js rename to test/js-framework/case/complex/repeat-track-by.output.js diff --git a/html5/test/case/complex/repeat-track-by.source.js b/test/js-framework/case/complex/repeat-track-by.source.js similarity index 100% rename from html5/test/case/complex/repeat-track-by.source.js rename to test/js-framework/case/complex/repeat-track-by.source.js diff --git a/html5/test/case/complex/transformer2.output.js b/test/js-framework/case/complex/transformer2.output.js similarity index 100% rename from html5/test/case/complex/transformer2.output.js rename to test/js-framework/case/complex/transformer2.output.js diff --git a/html5/test/case/complex/transformer2.source.js b/test/js-framework/case/complex/transformer2.source.js similarity index 100% rename from html5/test/case/complex/transformer2.source.js rename to test/js-framework/case/complex/transformer2.source.js diff --git a/html5/test/case/complex/transformer3.output.js b/test/js-framework/case/complex/transformer3.output.js similarity index 100% rename from html5/test/case/complex/transformer3.output.js rename to test/js-framework/case/complex/transformer3.output.js diff --git a/html5/test/case/complex/transformer3.source.js b/test/js-framework/case/complex/transformer3.source.js similarity index 100% rename from html5/test/case/complex/transformer3.source.js rename to test/js-framework/case/complex/transformer3.source.js diff --git a/html5/test/case/multi/clear-dep-target-error.source.js b/test/js-framework/case/multi/clear-dep-target-error.source.js similarity index 100% rename from html5/test/case/multi/clear-dep-target-error.source.js rename to test/js-framework/case/multi/clear-dep-target-error.source.js diff --git a/html5/test/case/multi/clear-dep-target-fine.output.js b/test/js-framework/case/multi/clear-dep-target-fine.output.js similarity index 100% rename from html5/test/case/multi/clear-dep-target-fine.output.js rename to test/js-framework/case/multi/clear-dep-target-fine.output.js diff --git a/html5/test/case/multi/clear-dep-target-fine.source.js b/test/js-framework/case/multi/clear-dep-target-fine.source.js similarity index 100% rename from html5/test/case/multi/clear-dep-target-fine.source.js rename to test/js-framework/case/multi/clear-dep-target-fine.source.js diff --git a/html5/test/case/multi/clear-moduleA.output.js b/test/js-framework/case/multi/clear-moduleA.output.js similarity index 100% rename from html5/test/case/multi/clear-moduleA.output.js rename to test/js-framework/case/multi/clear-moduleA.output.js diff --git a/html5/test/case/multi/clear-moduleA.source.js b/test/js-framework/case/multi/clear-moduleA.source.js similarity index 100% rename from html5/test/case/multi/clear-moduleA.source.js rename to test/js-framework/case/multi/clear-moduleA.source.js diff --git a/html5/test/case/multi/clear-moduleB.output.js b/test/js-framework/case/multi/clear-moduleB.output.js similarity index 100% rename from html5/test/case/multi/clear-moduleB.output.js rename to test/js-framework/case/multi/clear-moduleB.output.js diff --git a/html5/test/case/multi/clear-moduleB.source.js b/test/js-framework/case/multi/clear-moduleB.source.js similarity index 100% rename from html5/test/case/multi/clear-moduleB.source.js rename to test/js-framework/case/multi/clear-moduleB.source.js diff --git a/html5/test/case/prepare.js b/test/js-framework/case/prepare.js similarity index 87% rename from html5/test/case/prepare.js rename to test/js-framework/case/prepare.js index d787c427f6..03d21be464 100644 --- a/html5/test/case/prepare.js +++ b/test/js-framework/case/prepare.js @@ -26,13 +26,13 @@ import { } from 'weex-vdom-tester' // load env -import shared from '../../shared' -import { Document, Element, Comment } from '../../runtime/vdom' -import Listener from '../../runtime/bridge/Listener' -import { TaskCenter, init } from '../../runtime/bridge/TaskCenter' +import shared from '../../../runtime/shared' +import { Document, Element, Comment } from '../../../runtime/vdom' +import Listener from '../../../runtime/bridge/Listener' +import { TaskCenter, init } from '../../../runtime/bridge/TaskCenter' // load framework -import * as defaultFramework from '../../frameworks/legacy' +import * as defaultFramework from '../../../runtime/frameworks/legacy' import { subversion } from '../../../package.json' shared.setNativeConsole() diff --git a/html5/test/case/signals/modal.output.js b/test/js-framework/case/signals/modal.output.js similarity index 100% rename from html5/test/case/signals/modal.output.js rename to test/js-framework/case/signals/modal.output.js diff --git a/html5/test/case/signals/modal.source.js b/test/js-framework/case/signals/modal.source.js similarity index 100% rename from html5/test/case/signals/modal.source.js rename to test/js-framework/case/signals/modal.source.js diff --git a/html5/test/case/signals/signals-long.source.js b/test/js-framework/case/signals/signals-long.source.js similarity index 100% rename from html5/test/case/signals/signals-long.source.js rename to test/js-framework/case/signals/signals-long.source.js diff --git a/html5/test/case/signals/signals.source.js b/test/js-framework/case/signals/signals.source.js similarity index 100% rename from html5/test/case/signals/signals.source.js rename to test/js-framework/case/signals/signals.source.js diff --git a/html5/test/case/signals/timer.output.js b/test/js-framework/case/signals/timer.output.js similarity index 100% rename from html5/test/case/signals/timer.output.js rename to test/js-framework/case/signals/timer.output.js diff --git a/html5/test/case/signals/timer.source.js b/test/js-framework/case/signals/timer.source.js similarity index 100% rename from html5/test/case/signals/timer.source.js rename to test/js-framework/case/signals/timer.source.js diff --git a/html5/test/case/tester.js b/test/js-framework/case/tester.js similarity index 100% rename from html5/test/case/tester.js rename to test/js-framework/case/tester.js diff --git a/html5/test/case/throws/global-variable1.source.js b/test/js-framework/case/throws/global-variable1.source.js similarity index 100% rename from html5/test/case/throws/global-variable1.source.js rename to test/js-framework/case/throws/global-variable1.source.js diff --git a/html5/test/case/throws/global-variable2.source.js b/test/js-framework/case/throws/global-variable2.source.js similarity index 100% rename from html5/test/case/throws/global-variable2.source.js rename to test/js-framework/case/throws/global-variable2.source.js diff --git a/html5/test/case/throws/global-variable3.source.js b/test/js-framework/case/throws/global-variable3.source.js similarity index 100% rename from html5/test/case/throws/global-variable3.source.js rename to test/js-framework/case/throws/global-variable3.source.js diff --git a/html5/test/unit/default/api/methods.js b/test/js-framework/unit/default/api/methods.js similarity index 93% rename from html5/test/unit/default/api/methods.js rename to test/js-framework/unit/default/api/methods.js index ec458fffa5..83f6586109 100644 --- a/html5/test/unit/default/api/methods.js +++ b/test/js-framework/unit/default/api/methods.js @@ -22,11 +22,11 @@ import sinonChai from 'sinon-chai' const { expect } = chai chai.use(sinonChai) -import '../../../../shared/console' -import * as modules from '../../../../frameworks/legacy/api/modules' -import * as methods from '../../../../frameworks/legacy/api/methods' -import Differ from '../../../../frameworks/legacy/app/differ' -import { initModules, requireModule, clearModules, initMethods } from '../../../../frameworks/legacy/app/register' +import '../../../../../runtime/shared/env/console' +import * as modules from '../../../../../runtime/frameworks/legacy/api/modules' +import * as methods from '../../../../../runtime/frameworks/legacy/api/methods' +import Differ from '../../../../../runtime/frameworks/legacy/app/differ' +import { initModules, requireModule, clearModules, initMethods } from '../../../../../runtime/frameworks/legacy/app/register' function Vm () { } diff --git a/html5/test/unit/default/api/modules.js b/test/js-framework/unit/default/api/modules.js similarity index 91% rename from html5/test/unit/default/api/modules.js rename to test/js-framework/unit/default/api/modules.js index 1adf66b4b1..5545337cd3 100644 --- a/html5/test/unit/default/api/modules.js +++ b/test/js-framework/unit/default/api/modules.js @@ -19,8 +19,8 @@ import chai from 'chai' const { expect } = chai -import * as modules from '../../../../frameworks/legacy/api/modules' -import { initModules, requireModule, clearModules } from '../../../../frameworks/legacy/app/register' +import * as modules from '../../../../../runtime/frameworks/legacy/api/modules' +import { initModules, requireModule, clearModules } from '../../../../../runtime/frameworks/legacy/app/register' describe('built-in modules', () => { before(() => { diff --git a/html5/test/unit/default/app/bundle.js b/test/js-framework/unit/default/app/bundle.js similarity index 96% rename from html5/test/unit/default/app/bundle.js rename to test/js-framework/unit/default/app/bundle.js index f44b2f691f..8ee6ae6ecc 100644 --- a/html5/test/unit/default/app/bundle.js +++ b/test/js-framework/unit/default/app/bundle.js @@ -22,11 +22,11 @@ import sinonChai from 'sinon-chai' const { expect } = chai chai.use(sinonChai) -import * as bundle from '../../../../frameworks/legacy/app/bundle' -import * as register from '../../../../frameworks/legacy/app/register' -import { removeWeexPrefix } from '../../../../frameworks/legacy/util' -import { Document } from '../../../../runtime/vdom' -import Listener from '../../../../runtime/bridge/Listener' +import * as bundle from '../../../../../runtime/frameworks/legacy/app/bundle' +import * as register from '../../../../../runtime/frameworks/legacy/app/register' +import { removeWeexPrefix } from '../../../../../runtime/frameworks/legacy/util' +import { Document } from '../../../../../runtime/vdom' +import Listener from '../../../../../runtime/bridge/Listener' describe('parsing a bundle file', () => { const componentTemplate = { diff --git a/html5/test/unit/default/app/ctrl.js b/test/js-framework/unit/default/app/ctrl.js similarity index 96% rename from html5/test/unit/default/app/ctrl.js rename to test/js-framework/unit/default/app/ctrl.js index 4e3163bcf2..993762643c 100644 --- a/html5/test/unit/default/app/ctrl.js +++ b/test/js-framework/unit/default/app/ctrl.js @@ -22,9 +22,9 @@ import sinonChai from 'sinon-chai' const { expect } = chai chai.use(sinonChai) -import * as ctrl from '../../../../frameworks/legacy/app/ctrl' -import Differ from '../../../../frameworks/legacy/app/differ' -import { Document } from '../../../../runtime/vdom' +import * as ctrl from '../../../../../runtime/frameworks/legacy/app/ctrl' +import Differ from '../../../../../runtime/frameworks/legacy/app/differ' +import { Document } from '../../../../../runtime/vdom' describe('the api of app', () => { let app diff --git a/html5/test/unit/default/app/downgrade.js b/test/js-framework/unit/default/app/downgrade.js similarity index 98% rename from html5/test/unit/default/app/downgrade.js rename to test/js-framework/unit/default/app/downgrade.js index 562d0d7485..6c843789d9 100644 --- a/html5/test/unit/default/app/downgrade.js +++ b/test/js-framework/unit/default/app/downgrade.js @@ -19,7 +19,7 @@ import chai from 'chai' const { expect } = chai -import * as Downgrade from '../../../../frameworks/legacy/app/downgrade' +import * as Downgrade from '../../../../../runtime/frameworks/legacy/app/downgrade' describe('downgrade', () => { describe('normalizeVersion', () => { diff --git a/html5/test/unit/default/app/index.js b/test/js-framework/unit/default/app/index.js similarity index 96% rename from html5/test/unit/default/app/index.js rename to test/js-framework/unit/default/app/index.js index e0e2c3f809..fdfb9acbce 100644 --- a/html5/test/unit/default/app/index.js +++ b/test/js-framework/unit/default/app/index.js @@ -22,8 +22,8 @@ import sinonChai from 'sinon-chai' const { expect } = chai chai.use(sinonChai) -import App from '../../../../frameworks/legacy/app' -import { Element, Document } from '../../../../runtime/vdom' +import App from '../../../../../runtime/frameworks/legacy/app' +import { Element, Document } from '../../../../../runtime/vdom' describe('App Instance', () => { const oriDocumentHandler = Document.handler diff --git a/html5/test/unit/default/app/register.js b/test/js-framework/unit/default/app/register.js similarity index 98% rename from html5/test/unit/default/app/register.js rename to test/js-framework/unit/default/app/register.js index 6c239823ef..853b428781 100644 --- a/html5/test/unit/default/app/register.js +++ b/test/js-framework/unit/default/app/register.js @@ -30,7 +30,7 @@ import { requireModule, requireCustomComponent, registerCustomComponent -} from '../../../../frameworks/legacy/app/register' +} from '../../../../../runtime/frameworks/legacy/app/register' function Ctx () { this.customComponentMap = {} diff --git a/html5/test/unit/default/app/viewport.js b/test/js-framework/unit/default/app/viewport.js similarity index 96% rename from html5/test/unit/default/app/viewport.js rename to test/js-framework/unit/default/app/viewport.js index 0b0d122970..2caf37c30d 100644 --- a/html5/test/unit/default/app/viewport.js +++ b/test/js-framework/unit/default/app/viewport.js @@ -22,7 +22,7 @@ import sinonChai from 'sinon-chai' const { expect } = chai chai.use(sinonChai) -import * as viewport from '../../../../frameworks/legacy/app/viewport' +import * as viewport from '../../../../../runtime/frameworks/legacy/app/viewport' describe('viewport', function () { const originalCallNative = global.callNative diff --git a/html5/test/unit/default/util/index.js b/test/js-framework/unit/default/util/index.js similarity index 98% rename from html5/test/unit/default/util/index.js rename to test/js-framework/unit/default/util/index.js index a33be2785c..0d778f7606 100644 --- a/html5/test/unit/default/util/index.js +++ b/test/js-framework/unit/default/util/index.js @@ -19,7 +19,7 @@ import chai from 'chai' const { expect } = chai -import * as util from '../../../../frameworks/legacy/util' +import * as util from '../../../../../runtime/frameworks/legacy/util' describe('Util', () => { describe('isReserved', () => { diff --git a/html5/test/unit/default/util/shared.js b/test/js-framework/unit/default/util/shared.js similarity index 98% rename from html5/test/unit/default/util/shared.js rename to test/js-framework/unit/default/util/shared.js index bf24684960..6778206117 100644 --- a/html5/test/unit/default/util/shared.js +++ b/test/js-framework/unit/default/util/shared.js @@ -18,7 +18,7 @@ */ import { expect } from 'chai' -import * as utils from '../../../../frameworks/legacy/util/shared' +import * as utils from '../../../../../runtime/frameworks/legacy/util/shared' describe('test util functions', () => { it('extend', () => { diff --git a/html5/test/unit/default/vm/directive.js b/test/js-framework/unit/default/vm/directive.js similarity index 96% rename from html5/test/unit/default/vm/directive.js rename to test/js-framework/unit/default/vm/directive.js index fa219692d7..451b310650 100644 --- a/html5/test/unit/default/vm/directive.js +++ b/test/js-framework/unit/default/vm/directive.js @@ -26,12 +26,12 @@ import { applyNaitveComponentOptions, bindSubVm, bindSubVmAfterInitialized -} from '../../../../frameworks/legacy/vm/directive' +} from '../../../../../runtime/frameworks/legacy/vm/directive' import { initState -} from '../../../../frameworks/legacy/core/state' -import config from '../../../../frameworks/legacy/config' +} from '../../../../../runtime/frameworks/legacy/core/state' +import config from '../../../../../runtime/frameworks/legacy/config' const { nativeComponentMap } = config const directive = {} diff --git a/html5/test/unit/default/vm/dom-helper.js b/test/js-framework/unit/default/vm/dom-helper.js similarity index 98% rename from html5/test/unit/default/vm/dom-helper.js rename to test/js-framework/unit/default/vm/dom-helper.js index 48c0a87f9e..d0e5a54577 100644 --- a/html5/test/unit/default/vm/dom-helper.js +++ b/test/js-framework/unit/default/vm/dom-helper.js @@ -26,9 +26,9 @@ import { attachTarget, moveTarget, removeTarget -} from '../../../../frameworks/legacy/vm/dom-helper' -import { Document } from '../../../../runtime/vdom' -import Listener from '../../../../runtime/bridge/Listener' +} from '../../../../../runtime/frameworks/legacy/vm/dom-helper' +import { Document } from '../../../../../runtime/vdom' +import Listener from '../../../../../runtime/bridge/Listener' describe('help create body', () => { let vm diff --git a/html5/test/unit/default/vm/events.js b/test/js-framework/unit/default/vm/events.js similarity index 98% rename from html5/test/unit/default/vm/events.js rename to test/js-framework/unit/default/vm/events.js index a3af0d249a..b43b016e30 100644 --- a/html5/test/unit/default/vm/events.js +++ b/test/js-framework/unit/default/vm/events.js @@ -22,8 +22,8 @@ import sinonChai from 'sinon-chai' const { expect } = chai chai.use(sinonChai) -import Vm from '../../../../frameworks/legacy/vm' -import { Document } from '../../../../runtime/vdom' +import Vm from '../../../../../runtime/frameworks/legacy/vm' +import { Document } from '../../../../../runtime/vdom' describe('bind and fire events', () => { let doc, customComponentMap, spy diff --git a/html5/test/unit/default/vm/vm.js b/test/js-framework/unit/default/vm/vm.js similarity index 99% rename from html5/test/unit/default/vm/vm.js rename to test/js-framework/unit/default/vm/vm.js index 1ce0db3efb..761c913da0 100644 --- a/html5/test/unit/default/vm/vm.js +++ b/test/js-framework/unit/default/vm/vm.js @@ -22,10 +22,10 @@ import sinonChai from 'sinon-chai' const { expect } = chai chai.use(sinonChai) -import Vm from '../../../../frameworks/legacy/vm' -import { Document } from '../../../../runtime/vdom' -import { init as resetTaskHandler } from '../../../../runtime/bridge/TaskCenter' -import Differ from '../../../../frameworks/legacy/app/differ' +import Vm from '../../../../../runtime/frameworks/legacy/vm' +import { Document } from '../../../../../runtime/vdom' +import { init as resetTaskHandler } from '../../../../../runtime/bridge/TaskCenter' +import Differ from '../../../../../runtime/frameworks/legacy/app/differ' const oriCallNative = global.callNative diff --git a/html5/test/unit/runtime/legacy-framework.js b/test/js-framework/unit/runtime/legacy-framework.js similarity index 95% rename from html5/test/unit/runtime/legacy-framework.js rename to test/js-framework/unit/runtime/legacy-framework.js index a82d23b1e7..c9e37d098b 100644 --- a/html5/test/unit/runtime/legacy-framework.js +++ b/test/js-framework/unit/runtime/legacy-framework.js @@ -24,17 +24,17 @@ const { } = chai chai.use(sinonChai) -import runtime from '../../../runtime' -import frameworks from '../../../frameworks' -import defaultConfig from '../../../frameworks/legacy/config' -import { init as resetTaskHandler } from '../../../runtime/bridge/TaskCenter' +import runtime from '../../../../runtime/api' +import frameworks from '../../../../runtime/frameworks' +import defaultConfig from '../../../../runtime/frameworks/legacy/config' +import { init as resetTaskHandler } from '../../../../runtime/bridge/TaskCenter' const { init, config } = runtime config.frameworks = frameworks runtime.setNativeConsole() -import Vm from '../../../frameworks/legacy/vm' -import { clearModules, getModule } from '../../../frameworks/legacy/app/register' +import Vm from '../../../../runtime/frameworks/legacy/vm' +import { clearModules, getModule } from '../../../../runtime/frameworks/legacy/app/register' const framework = init(config) diff --git a/html5/test/unit/runtime/runner/helper.js b/test/js-framework/unit/runtime/runner/helper.js similarity index 93% rename from html5/test/unit/runtime/runner/helper.js rename to test/js-framework/unit/runtime/runner/helper.js index dce81c7aa4..79714fc290 100644 --- a/html5/test/unit/runtime/runner/helper.js +++ b/test/js-framework/unit/runtime/runner/helper.js @@ -17,9 +17,9 @@ * under the License. */ -import runtime from '../../../../runtime' -import frameworks from '../../../../frameworks' -import services from '../../../../services' +import runtime from '../../../../../runtime/api' +import frameworks from '../../../../../runtime/frameworks' +import services from '../../../../../runtime/services' const defaultModules = { animation: ['transition'], diff --git a/html5/test/unit/runtime/runner/vanilla.js b/test/js-framework/unit/runtime/runner/vanilla.js similarity index 100% rename from html5/test/unit/runtime/runner/vanilla.js rename to test/js-framework/unit/runtime/runner/vanilla.js diff --git a/html5/test/unit/runtime/runner/vue.js b/test/js-framework/unit/runtime/runner/vue.js similarity index 100% rename from html5/test/unit/runtime/runner/vue.js rename to test/js-framework/unit/runtime/runner/vue.js diff --git a/html5/test/unit/runtime/utils.js b/test/js-framework/unit/runtime/utils.js similarity index 96% rename from html5/test/unit/runtime/utils.js rename to test/js-framework/unit/runtime/utils.js index 64807057c7..3b1e3b8465 100644 --- a/html5/test/unit/runtime/utils.js +++ b/test/js-framework/unit/runtime/utils.js @@ -18,7 +18,7 @@ */ import { expect } from 'chai' -import * as utils from '../../../runtime/utils' +import * as utils from '../../../../runtime/shared/utils' describe('utils', () => { it('isEmpty', () => { diff --git a/html5/test/unit/runtime/vdom/index.js b/test/js-framework/unit/runtime/vdom/index.js similarity index 99% rename from html5/test/unit/runtime/vdom/index.js rename to test/js-framework/unit/runtime/vdom/index.js index 5270014361..763b2026fa 100644 --- a/html5/test/unit/runtime/vdom/index.js +++ b/test/js-framework/unit/runtime/vdom/index.js @@ -29,7 +29,7 @@ import { isWeexElement, registerElement, clearWeexElements -} from '../../../../runtime/vdom' +} from '../../../../../runtime/vdom' describe('document constructor', () => { it('create & destroy document', () => { diff --git a/html5/test/unit/runtime/vdom/listener.js b/test/js-framework/unit/runtime/vdom/listener.js similarity index 98% rename from html5/test/unit/runtime/vdom/listener.js rename to test/js-framework/unit/runtime/vdom/listener.js index 1eab8d596b..dab4b7ef16 100644 --- a/html5/test/unit/runtime/vdom/listener.js +++ b/test/js-framework/unit/runtime/vdom/listener.js @@ -22,8 +22,8 @@ import sinonChai from 'sinon-chai' const { expect } = chai chai.use(sinonChai) -import { Document } from '../../../../runtime/vdom' -import Listener from '../../../../runtime/bridge/Listener' +import { Document } from '../../../../../runtime/vdom' +import Listener from '../../../../../runtime/bridge/Listener' describe('dom listener basic', () => { it('works with no id', () => { diff --git a/html5/test/unit/runtime/vdom/node.js b/test/js-framework/unit/runtime/vdom/node.js similarity index 97% rename from html5/test/unit/runtime/vdom/node.js rename to test/js-framework/unit/runtime/vdom/node.js index b05d277d02..172718f63c 100644 --- a/html5/test/unit/runtime/vdom/node.js +++ b/test/js-framework/unit/runtime/vdom/node.js @@ -21,7 +21,7 @@ const { expect } = chai import { Node -} from '../../../../runtime/vdom' +} from '../../../../../runtime/vdom' describe('Node', () => { it('create node', () => { diff --git a/html5/test/unit/shared/BroadcastChannel.js b/test/js-framework/unit/shared/BroadcastChannel.js similarity index 97% rename from html5/test/unit/shared/BroadcastChannel.js rename to test/js-framework/unit/shared/BroadcastChannel.js index 880ed6b2c6..608b65c50c 100644 --- a/html5/test/unit/shared/BroadcastChannel.js +++ b/test/js-framework/unit/shared/BroadcastChannel.js @@ -19,8 +19,8 @@ import { expect } from 'chai' import sinon from 'sinon' -import service from '../../../services/broadcast-channel/index' -import { MessageEvent } from '../../../services/broadcast-channel/message-event' +import service from '../../../../runtime/services/broadcast-channel/index' +import { MessageEvent } from '../../../../runtime/services/broadcast-channel/message-event' const { BroadcastChannel } = service.create('foo').instance describe('BroadcastChannel', () => { diff --git a/html5/test/unit/shared/arrayFrom.js b/test/js-framework/unit/shared/arrayFrom.js similarity index 98% rename from html5/test/unit/shared/arrayFrom.js rename to test/js-framework/unit/shared/arrayFrom.js index 99e9495302..c75ea5f9bd 100644 --- a/html5/test/unit/shared/arrayFrom.js +++ b/test/js-framework/unit/shared/arrayFrom.js @@ -22,7 +22,7 @@ const { expect } = chai // remove original Array.from // Array.from = null -import '../../../shared/arrayFrom' +import '../../../../runtime/shared/polyfill/arrayFrom' /* eslint-disable */ describe('Array.from', () => { diff --git a/html5/test/unit/shared/console.js b/test/js-framework/unit/shared/console.js similarity index 98% rename from html5/test/unit/shared/console.js rename to test/js-framework/unit/shared/console.js index 60eb28129b..dcf0b4e89f 100644 --- a/html5/test/unit/shared/console.js +++ b/test/js-framework/unit/shared/console.js @@ -22,7 +22,10 @@ import sinonChai from 'sinon-chai' const { expect } = chai chai.use(sinonChai) -import { setNativeConsole, resetNativeConsole } from '../../../shared/console' +import { + setNativeConsole, + resetNativeConsole +} from '../../../../runtime/shared/env/console' const oriEnv = global.WXEnvironment const oriConsole = global.console diff --git a/html5/test/unit/shared/index.js b/test/js-framework/unit/shared/index.js similarity index 97% rename from html5/test/unit/shared/index.js rename to test/js-framework/unit/shared/index.js index 337bdf1ee9..1a6f81531e 100644 --- a/html5/test/unit/shared/index.js +++ b/test/js-framework/unit/shared/index.js @@ -22,7 +22,7 @@ import sinonChai from 'sinon-chai' const { expect } = chai chai.use(sinonChai) -import * as shared from '../../../shared' +import * as shared from '../../../../runtime/shared/' describe('a polyfill of', () => { it('Promise', () => { diff --git a/html5/test/unit/shared/objectAssign.js b/test/js-framework/unit/shared/objectAssign.js similarity index 95% rename from html5/test/unit/shared/objectAssign.js rename to test/js-framework/unit/shared/objectAssign.js index 7c76a4aaf6..b20329f399 100644 --- a/html5/test/unit/shared/objectAssign.js +++ b/test/js-framework/unit/shared/objectAssign.js @@ -19,7 +19,7 @@ import chai from 'chai' const { expect } = chai -import '../../../shared/objectAssign' +import '../../../../runtime/shared/polyfill/objectAssign' describe('object.assign', () => { it('is a function', () => { diff --git a/html5/test/unit/shared/objectSetPrototypeOf.js b/test/js-framework/unit/shared/objectSetPrototypeOf.js similarity index 95% rename from html5/test/unit/shared/objectSetPrototypeOf.js rename to test/js-framework/unit/shared/objectSetPrototypeOf.js index 58056bc7d0..b6fe66ed33 100644 --- a/html5/test/unit/shared/objectSetPrototypeOf.js +++ b/test/js-framework/unit/shared/objectSetPrototypeOf.js @@ -19,7 +19,7 @@ import chai from 'chai' const { expect } = chai -import '../../../shared/objectSetPrototypeOf' +import '../../../../runtime/shared/polyfill/objectSetPrototypeOf' /* eslint-disable */ describe('Object.setPrototypeOf', () => { diff --git a/html5/test/unit/vanilla/index.js b/test/js-framework/unit/vanilla/index.js similarity index 97% rename from html5/test/unit/vanilla/index.js rename to test/js-framework/unit/vanilla/index.js index 6389c4cc18..49ea29aa1f 100644 --- a/html5/test/unit/vanilla/index.js +++ b/test/js-framework/unit/vanilla/index.js @@ -18,8 +18,8 @@ */ import { expect } from 'chai' -import vanilla from '../../../frameworks/vanilla' -import runtime from '../../../runtime' +import vanilla from '../../../../runtime/frameworks/vanilla' +import runtime from '../../../../runtime/api' // clear ref property in vdom function clearRefs (json) { From 9dd6cba1eb14fd3e629678635f7662670d472db7 Mon Sep 17 00:00:00 2001 From: Hanks Date: Fri, 29 Dec 2017 20:58:43 +0800 Subject: [PATCH 2/2] * [build] update build scripts of js framework --- .flowconfig | 17 ----- build/build.js | 118 +++++++++++---------------------- build/config.js | 143 +++++++++++++++++++++++----------------- dangerfile.js | 15 +++-- package.json | 31 +++++---- runtime/vdom/Element.js | 8 +-- 6 files changed, 147 insertions(+), 185 deletions(-) delete mode 100644 .flowconfig diff --git a/.flowconfig b/.flowconfig deleted file mode 100644 index d92b990d9a..0000000000 --- a/.flowconfig +++ /dev/null @@ -1,17 +0,0 @@ -[ignore] -.*/node_modules/.* -.*/test/.* -.*/build/.* -.*/examples/.* -.*/doc/.* -.*/android/.* -.*/ios/.* -.*/bin/.* -.*/scripts/.* -.*/dist/.* -.*/flow-typed/.* - -[include] - -[options] -experimental.strict_type_args=false diff --git a/build/build.js b/build/build.js index fb05e4b833..d845816330 100644 --- a/build/build.js +++ b/build/build.js @@ -16,23 +16,13 @@ * specific language governing permissions and limitations * under the License. */ -"use strict" const fs = require('fs') const path = require('path') -const gzip = require('zlib').createGzip() -const pkg = require('../package.json') const rollup = require('rollup') const watch = require('rollup-watch') -const webpack = require('webpack') - const getConfig = require('./config') -// create dist folder -if (!fs.existsSync('dist')) { - fs.mkdirSync('dist') -} - let isWatch = false if (process.argv[3]) { isWatch = process.argv[3] === '--watch' || process.argv[3] === '-w' @@ -46,100 +36,66 @@ else { console.log('\nPlease specify the package you want to build. [native, runtime, browser, vue]') } -function extend(to, ...froms) { - froms.forEach(function (from) { - for (const key in from) { - if (from.hasOwnProperty(key)) { - to[key] = from[key] - } - } - }) - return to -} - -function runRollupOnWatch(config) { +function runRollupOnWatch (config) { const watcher = watch(rollup, config) watcher.on('event', event => { - switch ( event.code ) { - case 'STARTING': - console.log('checking rollup-watch version...') - break - - case 'BUILD_START': - console.log('bundling...') - break - - case 'BUILD_END': + switch (event.code) { + case 'STARTING': console.log('checking rollup-watch version...'); break + case 'BUILD_START': console.log('bundling...'); break + case 'BUILD_END': { console.log('bundled in ' + path.relative(process.cwd(), config.dest) + ' (' + event.duration + 'ms)') - console.log('Watching for changes...' ) - break - - case 'ERROR': - console.error('ERROR: ', event.error) - break - - default: - console.error('unknown event', event) + console.log('Watching for changes...') + } break + case 'ERROR': console.error('ERROR: ', event.error); break + default: console.error('unknown event', event) } }) } -function runRollup (config) { - return new Promise((resolve, reject) => { - rollup.rollup(config).then(bundle => { - bundle.write(config).then(() => { - report(config.dest) - resolve() - }) - }) - }) +async function runRollup (config) { + const bundle = await rollup.rollup(config) + const outputOptions = config.output + if (Array.isArray(outputOptions)) { + for (let i = 0; i < outputOptions.length; ++i) { + await bundle.write(outputOptions[i]) + report(outputOptions[i].output.file) + } + } + else { + await bundle.write(outputOptions) + report(outputOptions.file) + } } -function build (name) { +async function build (name) { let pkgName = 'weex-js-framework' switch (name) { - case 'native': pkgName = 'weex-js-framework'; break; - case 'runtime': pkgName = 'weex-js-runtime'; break; - case 'legacy': pkgName = 'weex-legacy-framework'; break; - case 'vanilla': pkgName = 'weex-vanilla-framework'; break; + case 'native': pkgName = 'weex-js-framework'; break + case 'vue': pkgName = 'weex-vue'; break + case 'rax': pkgName = 'weex-rax'; break + case 'runtime': pkgName = 'weex-js-runtime'; break + case 'legacy': pkgName = 'weex-legacy-framework'; break + case 'vanilla': pkgName = 'weex-vanilla-framework'; break } const config = getConfig(pkgName) const minifyConfig = getConfig(pkgName, true) + const ES6Config = getConfig(pkgName, false, true) + const ES6MinifyConfig = getConfig(pkgName, true, true) if (isWatch) { - return runRollupOnWatch(config) + return await runRollupOnWatch(config) } else { - console.log(`\n => start to build ${name} (${pkgName})\n`) - return new Promise((resolve, reject) => { - return runRollup(config).then(() => { - let p = Promise.resolve() - return p.then(function () { - return runRollup(minifyConfig).then(() => { - zip(minifyConfig.dest, resolve) - }) - }) - }) - }) + console.log(`\n => start to build ${pkgName}\n`) + await runRollup(config) + await runRollup(minifyConfig) + await runRollup(ES6Config) + await runRollup(ES6MinifyConfig) } } -function zip (filePath, callback) { - const read = fs.createReadStream(filePath) - const write = fs.createWriteStream(filePath + '.gz') - read.pipe(gzip).pipe(write).on('close', () => { - report(filePath + '.gz') - callback && callback() - }) -} - -function now () { - const time = Date.now() - (new Date()).getTimezoneOffset() * 60000 - return (new Date(time)).toISOString().replace('T', ' ').substring(0, 16) -} - function report (filePath) { const size = (fs.statSync(filePath).size / 1024).toFixed(2) + 'KB' const file = path.relative(process.cwd(), filePath) diff --git a/build/config.js b/build/config.js index 5a75a74c31..6c3873bce5 100644 --- a/build/config.js +++ b/build/config.js @@ -1,4 +1,3 @@ - /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -17,106 +16,126 @@ * specific language governing permissions and limitations * under the License. */ + const path = require('path') const json = require('rollup-plugin-json') const eslint = require('rollup-plugin-eslint') const replace = require('rollup-plugin-replace') const nodeResolve = require('rollup-plugin-node-resolve') const uglify = require('rollup-plugin-uglify') +const uglifyES = require('uglify-es') const commonjs = require('rollup-plugin-commonjs') const buble = require('rollup-plugin-buble') -const subversion = require('../package.json').subversion +const packageJSON = require('../package.json') +const deps = packageJSON.dependencies +const subversion = packageJSON.subversion const frameworkBanner = `;(this.getJSFMVersion = function()` + `{return "${subversion.framework}"});\n` - + `var global = this, process = { env: {} };var setTimeout = global.setTimeout;\n` + + `var global = this; var process = {env:{}}; var setTimeout = global.setTimeout;\n` const configs = { 'weex-js-framework': { - moduleName: 'Weex', - entry: absolute('html5/render/native/index.js'), - dest: absolute('packages/weex-js-framework/index.js'), - banner: `(this.nativeLog || function(s) {console.log(s)})` - + `('START JS FRAMEWORK ${subversion.framework}, Build ${now()}.');\n` - + frameworkBanner, - format: 'umd', - plugins: [ - nodeResolve({ - jsnext: true, - main: true - }), - ] + input: absolute('runtime/entries/index.js'), + output: { + name: 'Weex', + file: absolute('pre-build/weex-js-framework'), + banner: `(this.nativeLog || function(s) {console.log(s)})` + + `('START JS FRAMEWORK ${subversion.framework}, Build ${now()}. ` + + `(Vue: ${deps['weex-vue-framework']}, Rax: ${deps['weex-rax-framework']})');\n` + + frameworkBanner + } + }, + 'weex-vue': { + input: absolute('runtime/entries/vue.js'), + output: { + name: 'WeexVue', + file: absolute('pre-build/weex-vue'), + banner: `(this.nativeLog || function(s) {console.log(s)})` + + `('Weex JS Framework ${subversion.framework}, Build ${now()}. ` + + `(Vue: ${deps['weex-vue-framework']})');\n` + + frameworkBanner + } + }, + 'weex-rax': { + input: absolute('runtime/entries/rax.js'), + output: { + name: 'WeexRax', + file: absolute('pre-build/weex-rax'), + banner: `(this.nativeLog || function(s) {console.log(s)})` + + `('Weex JS Framework ${subversion.framework}, Build ${now()}. ` + + `(Rax: ${deps['weex-rax-framework']})');\n` + + frameworkBanner + } }, 'weex-js-runtime': { - moduleName: 'WeexRuntime', - entry: absolute('html5/runtime/index.js'), - dest: absolute('packages/weex-js-runtime/index.js'), - banner: `/* WEEX JS RUNTIME ${subversion.framework}, Build ${now()}. */\n\n`, - format: 'umd', - plugins: [ - nodeResolve({ - jsnext: true, - main: true - }), - ] + input: absolute('runtime/api/index.js'), + output: { + name: 'WeexJSRuntime', + file: absolute('packages/weex-js-runtime/index'), + banner: `/* Weex JS Runtime ${subversion.framework}, Build ${now()}. */\n\n` + } }, 'weex-legacy-framework': { - moduleName: 'WeexLegacyFramework', - entry: absolute('html5/frameworks/legacy/index.js'), - dest: absolute('packages/weex-legacy-framework/index.js'), - banner: `/* Weex Legacy Framework ${subversion.framework}, Build ${now()}. */\n`, - format: 'umd', - plugins: [ - nodeResolve({ - jsnext: true, - main: true - }), - ] + input: absolute('runtime/frameworks/legacy/index.js'), + output: { + name: 'WeexLegacyFramework', + file: absolute('packages/weex-legacy-framework/index'), + banner: `/* Weex Legacy Framework ${subversion.framework}, Build ${now()}. */\n` + } }, 'weex-vanilla-framework': { - moduleName: 'WeexVanillaFramework', - entry: absolute('html5/frameworks/vanilla/index.js'), - dest: absolute('packages/weex-vanilla-framework/index.js'), - banner: `/* Weex Vanilla Framework ${subversion.framework}, Build ${now()}. */\n`, - format: 'umd', - plugins: [ - nodeResolve({ - jsnext: true, - main: true - }), - ] + input: absolute('runtime/frameworks/vanilla/index.js'), + output: { + name: 'WeexVanillaFramework', + file: absolute('packages/weex-vanilla-framework/index'), + banner: `/* Weex Vanilla Framework ${subversion.framework}, Build ${now()}. */\n` + } } } -function getConfig (name, minify) { +function getConfig (name, minify, es6) { const opt = configs[name] + if (!opt.plugins) { + opt.plugins = [] + } + const output = opt.output + const suffix = `${es6 ? '.es6' : ''}${minify ? '.min' : ''}.js` const config = { - moduleName: opt.moduleName, - entry: opt.entry, - dest: minify ? opt.dest && opt.dest.replace(/\.js$/, '.min.js') : opt.dest, - format: opt.format, - banner: opt.banner, + input: opt.input, + output: { + name: output.name, + file: output.file + suffix, + format: output.format || 'umd', + banner: output.banner + }, plugins: opt.plugins.concat([ + nodeResolve({ jsnext: true, main: true }), json(), replace({ - 'process.env.VIEWPORT_WIDTH': 750, + '__WEEX_VERSION__': JSON.stringify(subversion.framework), 'process.env.NODE_ENV': JSON.stringify(minify ? 'production' : 'development'), 'process.env.VUE_ENV': JSON.stringify('WEEX'), + 'process.env.SUPPORT_ES2015': !!es6, 'process.env.NODE_DEBUG': false }), - commonjs(), - buble() + commonjs() ]) } - + if (!es6) { + config.plugins.push(buble()) + } if (minify) { - config.plugins.push(uglify()) + config.output.sourcemap = true + config.plugins.push(es6 + ? uglify({ safari10: true, toplevel: true }, uglifyES.minify) + : uglify() + ) } else { - config.sourceMap = 'inline' + config.output.sourcemap = 'inline' config.plugins.unshift(eslint({ exclude: ['**/*.json', '**/*.css'] })) } - return config } diff --git a/dangerfile.js b/dangerfile.js index 40cbadbd7d..660c4af9ac 100644 --- a/dangerfile.js +++ b/dangerfile.js @@ -72,12 +72,12 @@ if (unFlowedFiles.length > 0) { // Error or Warn when delete public interface var isNotDanger = false; console.log('pr.title:'+danger.github.pr.title) -if(!isNotDanger && danger.github.pr.title +if(!isNotDanger && danger.github.pr.title && danger.github.pr.title.match(/@notdanger/i)){ isNotDanger = true; } console.log('pr.body:'+danger.github.pr.body) -if(!isNotDanger && danger.github.pr.body +if(!isNotDanger && danger.github.pr.body && danger.github.pr.body.match(/@notdanger/i)){ isNotDanger = true; } @@ -146,10 +146,10 @@ const getFileType = file => { } else if (file.match(/android\/sdk\/src\/main\/java\/.+\.java/)) { return type_android_sdk; } else if ( - file.match(/html5\/(shared|frameworks|render|runtime|services)\/.+\.js/) + file.match(/runtime\/.+\.js/) ) { return type_jsfm; - } else if (file.match(/html5\/test\/.+\.js/)) { + } else if (file.match(/test\/js-framework\/.+\.js/)) { return type_jsfm_test; } else if (file.match(/doc\/\.+\.md/)) { return type_doc; @@ -250,7 +250,8 @@ const ignoreCopyrightVerifyPath = [ 'test', 'packages', 'pre-build', - 'html5/test/case', + 'runtime/frameworks/legacy/core', + 'test/js\-framework/case', 'android/playground/app/src/main/assets', 'android/sdk/assets', 'ios/playground/bundlejs', @@ -275,7 +276,7 @@ filesToVerifySrcHeader.forEach(filepath => { } // check cn for source code - var reg = /[\u4e00-\u9FA5]+/; + var reg = /[\u4e00-\u9FA5]+/; var res = reg.test(content); if(res){ console.error("Code file "+ filepath +" has cn source code."); @@ -356,7 +357,7 @@ function getContent(url) { console.log('response:', response.statusCode) if (response.statusCode < 200 || response.statusCode > 299) { if (response.statusCode === 404 || response.statusCode === 502) { - // ignore this, probably a renamed file,or .so that can't blame + // ignore this, probably a renamed file,or .so that can't blame return resolve('') } reject(new Error('Failed to load page, status code: ' + response.statusCode + ', ' diff --git a/package.json b/package.json index 02822244cf..636a1f0545 100644 --- a/package.json +++ b/package.json @@ -32,11 +32,13 @@ "yunos" ], "engines": { - "node": ">=4" + "node": ">=8" }, "scripts": { "postinstall": "bash ./scripts/install-hooks.sh", "build:native": "node build/build.js native", + "build:vue": "node build/build.js vue", + "build:rax": "node build/build.js rax", "build:runtime": "node build/build.js runtime", "build:legacy": "node build/build.js legacy", "build:vanilla": "node build/build.js vanilla", @@ -58,8 +60,8 @@ "dev:examples:web": "webpack --watch --config build/webpack.examples.web.config.js", "dev:test": "webpack --watch --config build/webpack.test.config.js", "lint": "eslint html5", - "test:case": "mocha --require reify html5/test/case/tester.js", - "test:unit": "mocha --require reify html5/test/unit/**/*", + "test:case": "mocha --require reify test/js-framework/case/tester.js", + "test:unit": "mocha --require reify test/js-framework/unit/**/*", "test": "npm run lint && npm run test:unit && npm run test:case", "test:cover-html": "babel-istanbul cover --report html node_modules/mocha/bin/_mocha -- --require reify --reporter dot html5/test/unit/ && open coverage/index.html", "test:cover": "babel-istanbul cover --report text node_modules/mocha/bin/_mocha -- --require reify --reporter dot html5/test/unit/", @@ -100,6 +102,7 @@ "danger": "^0.18.0", "dateformat": "^2.0.0", "eslint": "^2.11.1", + "eslint-plugin-flowtype": "^2.40.1", "fs-extra": "^2.0.0", "github": "^9.2.0", "http-server": "^0.9.0", @@ -110,20 +113,21 @@ "parse-diff": "^0.4.0", "phantomjs-prebuilt": "^2.1.7", "reify": "^0.3.8", - "rollup": "^0.36.0", - "rollup-plugin-buble": "^0.14.0", - "rollup-plugin-commonjs": "^5.0.4", - "rollup-plugin-eslint": "^3.0.0", - "rollup-plugin-json": "^2.0.2", - "rollup-plugin-node-resolve": "^2.0.0", - "rollup-plugin-postcss": "^0.2.0", - "rollup-plugin-replace": "^1.1.1", + "rollup": "^0.53.2", + "rollup-plugin-buble": "^0.18.0", + "rollup-plugin-commonjs": "^8.2.6", + "rollup-plugin-eslint": "^4.0.0", + "rollup-plugin-json": "^2.3.0", + "rollup-plugin-node-resolve": "^3.0.0", + "rollup-plugin-replace": "^2.0.0", "rollup-plugin-uglify": "^2.0.1", - "rollup-watch": "^2.5.0", + "rollup-watch": "^4.3.1", "selenium-server": "2.53.1", "serve": "^1.4.0", + "shelljs": "^0.7.8", "sinon": "^2.1.0", "sinon-chai": "^2.8.0", + "uglify-es": "^3.3.4", "uglify-js": "^2.8.29", "vue": "2.4.3", "vue-loader": "^12.2.1", @@ -134,7 +138,6 @@ "weex-loader": "^0.5.3", "weex-vdom-tester": "^0.2.0", "weex-wd": "^1.0.23", - "xmldom": "^0.1.27", - "shelljs": "^0.7.8" + "xmldom": "^0.1.27" } } diff --git a/runtime/vdom/Element.js b/runtime/vdom/Element.js index 3160b6d958..8e7b5721e4 100644 --- a/runtime/vdom/Element.js +++ b/runtime/vdom/Element.js @@ -133,8 +133,8 @@ export default class Element extends Node { node, this.pureChildren, pureBefore - ? this.pureChildren.indexOf(pureBefore) - : this.pureChildren.length + ? this.pureChildren.indexOf(pureBefore) + : this.pureChildren.length ) const taskCenter = getTaskCenter(this.docId) if (taskCenter) { @@ -155,8 +155,8 @@ export default class Element extends Node { node, this.pureChildren, pureBefore - ? this.pureChildren.indexOf(pureBefore) - : this.pureChildren.length + ? this.pureChildren.indexOf(pureBefore) + : this.pureChildren.length ) const taskCenter = getTaskCenter(this.docId) if (taskCenter && index >= 0) {