Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 7F614200CF2 for ; Tue, 8 Aug 2017 10:55:27 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7E1AD166EC0; Tue, 8 Aug 2017 08:55:27 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6D2B8166EC6 for ; Tue, 8 Aug 2017 10:55:26 +0200 (CEST) Received: (qmail 20301 invoked by uid 500); 8 Aug 2017 08:55:25 -0000 Mailing-List: contact commits-help@weex.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@weex.incubator.apache.org Delivered-To: mailing list commits@weex.incubator.apache.org Received: (qmail 19800 invoked by uid 99); 8 Aug 2017 08:55:23 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Aug 2017 08:55:23 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 72900C036C for ; Tue, 8 Aug 2017 08:55:23 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.222 X-Spam-Level: X-Spam-Status: No, score=-4.222 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id vCLLo1MQNFNA for ; Tue, 8 Aug 2017 08:55:22 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 5A3A460E1B for ; Tue, 8 Aug 2017 08:55:21 +0000 (UTC) Received: (qmail 18880 invoked by uid 99); 8 Aug 2017 08:55:17 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Aug 2017 08:55:17 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BE5BDF68DD; Tue, 8 Aug 2017 08:55:13 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: acton393@apache.org To: commits@weex.incubator.apache.org Date: Tue, 08 Aug 2017 08:55:22 -0000 Message-Id: <7782531c1fc7423aa5603da34f108ee4@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [10/39] incubator-weex git commit: * [jsfm] use ES6 export in vanilla framework archived-at: Tue, 08 Aug 2017 08:55:27 -0000 * [jsfm] use ES6 export in vanilla framework Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/80b3eaed Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/80b3eaed Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/80b3eaed Branch: refs/heads/0.16-dev Commit: 80b3eaed2b664a38d230d7841ba94de5a5f992aa Parents: ac34854 Author: Hanks Authored: Fri Jul 28 13:53:16 2017 +0800 Committer: Hanks Committed: Fri Jul 28 13:53:16 2017 +0800 ---------------------------------------------------------------------- html5/frameworks/vanilla/index.js | 35 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/80b3eaed/html5/frameworks/vanilla/index.js ---------------------------------------------------------------------- diff --git a/html5/frameworks/vanilla/index.js b/html5/frameworks/vanilla/index.js index 95027a9..45a2e69 100644 --- a/html5/frameworks/vanilla/index.js +++ b/html5/frameworks/vanilla/index.js @@ -20,22 +20,22 @@ const config = {} const instanceMap = {} -function init (cfg) { +export function init (cfg) { config.Document = cfg.Document config.Element = cfg.Element config.Comment = cfg.Comment config.sendTasks = cfg.sendTasks } -function registerComponents (components) {} +export function registerComponents (components) {} -function registerModules (modules) {} +export function registerModules (modules) {} -function registerMethods (apis) {} +export function registerMethods (apis) {} -function prepareInstance (id, options, data) {} +export function prepareInstance (id, options, data) {} -function createInstance (id, code, options, data, serviceObjects) { +export function createInstance (id, code, options, data, serviceObjects) { const document = new config.Document(id, options.bundleUrl) const callbacks = {} @@ -71,20 +71,22 @@ function createInstance (id, code, options, data, serviceObjects) { globalKeys.push(code) const result = new Function(...globalKeys) - return result(...globalValues) + result(...globalValues) + + return { document } } -function refreshInstance (id, data) {} +export function refreshInstance (id, data) {} -function destroyInstance (id) { +export function destroyInstance (id) { delete instanceMap[id] } -function getRoot (id) { +export function getRoot (id) { return instanceMap[id].body.toJSON() } -function receiveTasks (id, tasks) { +export function receiveTasks (id, tasks) { const jsHandlers = { fireEvent: (id, ref, type, data, domChanges) => { const document = instanceMap[id] @@ -112,14 +114,3 @@ function receiveTasks (id, tasks) { return results } } - -exports.init = init -exports.registerComponents = registerComponents -exports.registerModules = registerModules -exports.registerMethods = registerMethods -exports.prepareInstance = prepareInstance -exports.createInstance = createInstance -exports.refreshInstance = refreshInstance -exports.destroyInstance = destroyInstance -exports.getRoot = getRoot -exports.receiveTasks = receiveTasks