seer-dynamic-component
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -1,29 +0,23 @@ | ||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
import "core-js/modules/es6.reflect.construct.js"; | ||
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator"; | ||
import _classCallCheck from "@babel/runtime/helpers/classCallCheck"; | ||
import _createClass from "@babel/runtime/helpers/createClass"; | ||
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized"; | ||
import _inherits from "@babel/runtime/helpers/inherits"; | ||
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn"; | ||
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf"; | ||
import _defineProperty from "@babel/runtime/helpers/defineProperty"; | ||
import _regeneratorRuntime from "@babel/runtime/regenerator"; | ||
import "core-js/modules/web.dom.iterable.js"; | ||
import "core-js/modules/es6.string.iterator.js"; | ||
import "core-js/modules/es6.object.to-string.js"; | ||
import "core-js/modules/es6.array.iterator.js"; | ||
import "core-js/modules/es6.promise.js"; | ||
import "core-js/modules/es6.array.find.js"; | ||
import "core-js/modules/es6.array.find-index.js"; | ||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } | ||
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
import React from "react"; | ||
@@ -60,12 +54,12 @@ import { getCompInfo, loadRealComponent } from "./utils"; | ||
key: "loadComponent", | ||
value: | ||
/** | ||
* 获取目标组件资源 | ||
*/ | ||
value: function () { | ||
var _loadComponent = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(id, relativePath) { | ||
function () { | ||
var _loadComponent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(id, relativePath) { | ||
var _this2 = this; | ||
var targetComp, injectReducer; | ||
return regeneratorRuntime.wrap(function _callee2$(_context2) { | ||
return _regeneratorRuntime.wrap(function _callee2$(_context2) { | ||
while (1) { | ||
@@ -93,6 +87,6 @@ switch (_context2.prev = _context2.next) { | ||
case 8: | ||
return _context2.delegateYield( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { | ||
return _context2.delegateYield( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() { | ||
var id, reducers, targetComponent, injectReducers, _loop, i; | ||
return regeneratorRuntime.wrap(function _callee$(_context) { | ||
return _regeneratorRuntime.wrap(function _callee$(_context) { | ||
while (1) { | ||
@@ -168,5 +162,5 @@ switch (_context.prev = _context.next) { | ||
value: function () { | ||
var _injectReducer2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(targetRoute, reducerId, _injectReducer, relativePath) { | ||
var _injectReducer2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(targetRoute, reducerId, _injectReducer, relativePath) { | ||
var reducerComp; | ||
return regeneratorRuntime.wrap(function _callee3$(_context3) { | ||
return _regeneratorRuntime.wrap(function _callee3$(_context3) { | ||
while (1) { | ||
@@ -173,0 +167,0 @@ switch (_context3.prev = _context3.next) { |
@@ -1,6 +0,19 @@ | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
import "core-js/modules/es6.object.keys.js"; | ||
import "core-js/modules/es6.symbol.js"; | ||
import "core-js/modules/es6.array.filter.js"; | ||
import "core-js/modules/es6.object.get-own-property-descriptor.js"; | ||
import "core-js/modules/es7.object.get-own-property-descriptors.js"; | ||
import _defineProperty from "@babel/runtime/helpers/defineProperty"; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
import "core-js/modules/es6.object.to-string.js"; | ||
import "core-js/modules/es6.promise.js"; | ||
import "core-js/modules/es6.array.find.js"; | ||
import "core-js/modules/es6.string.iterator.js"; | ||
import "core-js/modules/es6.array.iterator.js"; | ||
import "core-js/modules/web.dom.iterable.js"; | ||
import "core-js/modules/es6.regexp.replace.js"; | ||
@@ -24,7 +37,7 @@ /** | ||
return new Promise(function (resolve, reject) { | ||
window.System["import"]("".concat(relativePath + module, "/config.js?v=").concat(new Date().getTime())).then(function (res) { | ||
delete window["default"]; | ||
window.System.import("".concat(relativePath + module, "/config.js?v=").concat(new Date().getTime())).then(function (res) { | ||
delete window.default; | ||
if (res["default"]) { | ||
var config = res["default"]; | ||
if (res.default) { | ||
var config = res.default; | ||
config.components.forEach(function (item) { | ||
@@ -39,4 +52,4 @@ window.seerConfig.components.push(_objectSpread(_objectSpread({}, item), {}, { | ||
} | ||
})["catch"](function (e) { | ||
delete window["default"]; | ||
}).catch(function (e) { | ||
delete window.default; | ||
console.warn(e); | ||
@@ -91,9 +104,9 @@ resolve(); // reject(); | ||
var importModule = function importModule() { | ||
window.System["import"]("".concat(relativePath + module, "/js/").concat(jsName)).then(function (res) { | ||
delete window["default"]; | ||
window.System.import("".concat(relativePath + module, "/js/").concat(jsName)).then(function (res) { | ||
delete window.default; | ||
if (res && res["default"] && res["default"]["default"]) { | ||
window.seerConfig[key][module] = res["default"]["default"]; | ||
if (res && res.default && res.default.default) { | ||
window.seerConfig[key][module] = res.default.default; | ||
} else { | ||
window.seerConfig[key][module] = res["default"]; | ||
window.seerConfig[key][module] = res.default; | ||
} | ||
@@ -103,4 +116,4 @@ | ||
resolve(comp); | ||
})["catch"](function (e) { | ||
delete window["default"]; | ||
}).catch(function (e) { | ||
delete window.default; | ||
console.warn(e); | ||
@@ -115,3 +128,3 @@ reject(); | ||
var chunkUrl = "".concat(relativePath + module, "/js/").concat(splitChunkName, ".chunk.js"); | ||
window.System["import"](chunkUrl).then(function () { | ||
window.System.import(chunkUrl).then(function () { | ||
window.loadedSplitChunk[splitChunkName] = 1; | ||
@@ -118,0 +131,0 @@ importModule(); |
{ | ||
"name": "seer-dynamic-component", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "", | ||
@@ -18,9 +18,17 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"@babel/preset-env": "^7.9.5", | ||
"standard-version": "^7.1.0", | ||
"@babel/cli": "^7.8.4", | ||
"@babel/core": "^7.9.0", | ||
"@babel/plugin-proposal-class-properties": "^7.8.3", | ||
"@babel/preset-react": "^7.9.4" | ||
"@babel/cli": "^7.14.8", | ||
"@babel/core": "^7.4.4", | ||
"@babel/plugin-proposal-class-properties": "^7.4.4", | ||
"@babel/plugin-syntax-dynamic-import": "^7.2.0", | ||
"@babel/plugin-transform-runtime": "^7.6.2", | ||
"@babel/plugin-syntax-export-default-from": "^7.14.5", | ||
"@babel/plugin-syntax-import-meta": "^7.10.4", | ||
"@babel/polyfill": "^7.6.0", | ||
"@babel/preset-env": "^7.11.5", | ||
"@babel/preset-flow": "^7.13.13", | ||
"@babel/preset-react": "^7.10.4", | ||
"@babel/preset-typescript": "^7.13.0", | ||
"@babel/runtime": "^7.6.3", | ||
"standard-version": "^7.1.0" | ||
} | ||
} |
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
301
15443
14