weex-rax-framework
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -111,4 +111,5 @@ 'use strict'; | ||
module.exports = function (nativeInstanceWrap) { | ||
module.exports = function (__weex_require__) { | ||
return function (config) { | ||
var nativeInstanceWrap = __weex_require__('@weex-module/instanceWrap'); | ||
var result = check(config); | ||
@@ -115,0 +116,0 @@ if (result.isDowngrade) { |
'use strict'; | ||
module.exports = function (Promise, nativeFetch) { | ||
module.exports = function (__weex_require__, Promise) { | ||
function normalizeName(name) { | ||
@@ -232,2 +232,3 @@ if (typeof name !== 'string') { | ||
params.type = init && init.dataType ? init.dataType : 'json'; | ||
var nativeFetch = __weex_require__('@weex-module/stream').fetch; | ||
nativeFetch(params, function (response) { | ||
@@ -234,0 +235,0 @@ try { |
@@ -256,6 +256,7 @@ 'use strict'; | ||
var emitter = new _emitter2.default(); | ||
var weexNavigator = req('@weex-module/navigator'); | ||
var window = { | ||
devicePixelRatio: ENV.scale, | ||
open: function open(url) { | ||
var weexNavigator = req('@weex-module/navigator'); | ||
weexNavigator.push({ | ||
@@ -315,4 +316,3 @@ url: url, | ||
var timer = req('@weex-module/timer'); | ||
var timerModuleName = '@weex-module/timer'; | ||
var setTimeout = function setTimeout() { | ||
@@ -323,2 +323,3 @@ for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
var timer = req(timerModuleName); | ||
var handler = function handler() { | ||
@@ -336,2 +337,3 @@ args[0].apply(args, _toConsumableArray(args.slice(2))); | ||
var timer = req(timerModuleName); | ||
var handler = function handler() { | ||
@@ -345,2 +347,3 @@ args[0].apply(args, _toConsumableArray(args.slice(2))); | ||
var clearTimeout = function clearTimeout(n) { | ||
var timer = req(timerModuleName); | ||
timer.clearTimeout(n); | ||
@@ -350,2 +353,3 @@ }; | ||
var clearInterval = function clearInterval(n) { | ||
var timer = req(timerModuleName); | ||
timer.clearInterval(n); | ||
@@ -355,2 +359,3 @@ }; | ||
var requestAnimationFrame = function requestAnimationFrame(callback) { | ||
var timer = req(timerModuleName); | ||
timer.setTimeout(callback, 16); | ||
@@ -361,7 +366,8 @@ return instance.uid.toString(); | ||
var cancelAnimationFrame = function cancelAnimationFrame(n) { | ||
var timer = req(timerModuleName); | ||
timer.clearTimeout(n); | ||
}; | ||
var modal = req('@weex-module/modal'); | ||
var alert = function alert(message) { | ||
var modal = req('@weex-module/modal'); | ||
modal.alert({ | ||
@@ -372,7 +378,4 @@ message: message | ||
var instanceWrap = req('@weex-module/instanceWrap'); | ||
var downgrade = require('./downgrade.weex')(instanceWrap); | ||
var stream = req('@weex-module/stream'); | ||
var fetch = require('./fetch.weex')(Promise, stream.fetch); | ||
var downgrade = require('./downgrade.weex')(req); | ||
var fetch = require('./fetch.weex')(req, Promise); | ||
var Headers = fetch.Headers, | ||
@@ -379,0 +382,0 @@ Request = fetch.Request, |
{ | ||
"name": "weex-rax-framework", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "Rax framework for weex.", | ||
@@ -19,4 +19,4 @@ "license": "BSD-3-Clause", | ||
"dependencies": { | ||
"runtime-shared": "^0.0.6", | ||
"rax": "^0.0.6" | ||
"runtime-shared": "^0.0.7", | ||
"rax": "^0.0.7" | ||
}, | ||
@@ -23,0 +23,0 @@ "devDependencies": { |
@@ -108,4 +108,5 @@ /* global WXEnvironment */ | ||
module.exports = function(nativeInstanceWrap) { | ||
module.exports = function(__weex_require__) { | ||
return (config) => { | ||
let nativeInstanceWrap = __weex_require__('@weex-module/instanceWrap'); | ||
let result = check(config); | ||
@@ -112,0 +113,0 @@ if (result.isDowngrade) { |
@@ -1,2 +0,2 @@ | ||
module.exports = function(Promise, nativeFetch) { | ||
module.exports = function(__weex_require__, Promise) { | ||
function normalizeName(name) { | ||
@@ -230,2 +230,3 @@ if (typeof name !== 'string') { | ||
params.type = init && init.dataType ? init.dataType : 'json'; | ||
var nativeFetch = __weex_require__('@weex-module/stream').fetch; | ||
nativeFetch(params, (response) => { | ||
@@ -232,0 +233,0 @@ try { |
@@ -272,6 +272,7 @@ import {BuiltinModulesFactory} from './builtin'; | ||
const emitter = new EventEmitter(); | ||
const weexNavigator = req('@weex-module/navigator'); | ||
const window = { | ||
devicePixelRatio: ENV.scale, | ||
open: (url) => { | ||
const weexNavigator = req('@weex-module/navigator'); | ||
weexNavigator.push({ | ||
@@ -335,5 +336,5 @@ url, | ||
const timer = req('@weex-module/timer'); | ||
const timerModuleName = '@weex-module/timer'; | ||
const setTimeout = (...args) => { | ||
const timer = req(timerModuleName); | ||
const handler = function() { | ||
@@ -347,2 +348,3 @@ args[0](...args.slice(2)); | ||
const setInterval = (...args) => { | ||
const timer = req(timerModuleName); | ||
const handler = function() { | ||
@@ -356,2 +358,3 @@ args[0](...args.slice(2)); | ||
const clearTimeout = (n) => { | ||
const timer = req(timerModuleName); | ||
timer.clearTimeout(n); | ||
@@ -361,2 +364,3 @@ }; | ||
const clearInterval = (n) => { | ||
const timer = req(timerModuleName); | ||
timer.clearInterval(n); | ||
@@ -366,2 +370,3 @@ }; | ||
const requestAnimationFrame = (callback) => { | ||
const timer = req(timerModuleName); | ||
timer.setTimeout(callback, 16); | ||
@@ -372,7 +377,8 @@ return instance.uid.toString(); | ||
const cancelAnimationFrame = (n) => { | ||
const timer = req(timerModuleName); | ||
timer.clearTimeout(n); | ||
}; | ||
const modal = req('@weex-module/modal'); | ||
const alert = (message) => { | ||
const modal = req('@weex-module/modal'); | ||
modal.alert({ | ||
@@ -383,7 +389,4 @@ message | ||
const instanceWrap = req('@weex-module/instanceWrap'); | ||
const downgrade = require('./downgrade.weex')(instanceWrap); | ||
const stream = req('@weex-module/stream'); | ||
const fetch = require('./fetch.weex')(Promise, stream.fetch); | ||
const downgrade = require('./downgrade.weex')(req); | ||
const fetch = require('./fetch.weex')(req, Promise); | ||
const {Headers, Request, Response} = fetch; | ||
@@ -390,0 +393,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
457338
6906
+ Addedrax@0.0.7(transitive)
+ Addedruntime-shared@0.0.7(transitive)
+ Addeduniversal-env@0.0.7(transitive)
- Removedrax@0.0.6(transitive)
- Removedruntime-shared@0.0.6(transitive)
- Removeduniversal-env@0.0.6(transitive)
Updatedrax@^0.0.7
Updatedruntime-shared@^0.0.7