sample-cross-fx 0.14.14 → 0.14.15-beta.3795

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -128654,8 +128654,9 @@ __webpack_require__.r(__webpack_exports__);
128654
128654
  /* harmony export */ "includeDependency": () => (/* binding */ includeDependency),
128655
128655
  /* harmony export */ "includeBundle": () => (/* binding */ includeBundle)
128656
128656
  /* harmony export */ });
128657
- function requireModule(name) {
128658
- const dependency = System.get(name);
128657
+ function requireModule(name, parent) {
128658
+ const moduleId = System.resolve(name, parent);
128659
+ const dependency = moduleId && System.get(moduleId);
128659
128660
 
128660
128661
  if (!dependency) {
128661
128662
  const error = new Error(`Cannot find module '${name}'`);
@@ -128701,7 +128702,11 @@ function evalDependency(name, content, link = '') {
128701
128702
  try {
128702
128703
  const sourceUrl = link && `\n//# sourceURL=${link}`;
128703
128704
  const importer = new Function('module', 'exports', 'require', content + sourceUrl);
128704
- importer(mod, mod.exports, requireModule);
128705
+ const parent = link || name;
128706
+
128707
+ const require = moduleId => requireModule(moduleId, parent);
128708
+
128709
+ importer(mod, mod.exports, require);
128705
128710
  } catch (e) {
128706
128711
  console.error(`Error while evaluating ${name}.`, e);
128707
128712
  }
@@ -128722,7 +128727,8 @@ function compileDependency(name, content, link = '') {
128722
128727
  }
128723
128728
 
128724
128729
  function includeScript(piletName, depName, link, integrity, crossOrigin) {
128725
- window[depName] = requireModule;
128730
+ window[depName] = moduleId => requireModule(moduleId, link);
128731
+
128726
128732
  return includeScriptDependency(link, integrity, crossOrigin).then(s => checkPiletAppAsync(piletName, s.app), () => checkPiletApp(piletName));
128727
128733
  }
128728
128734
  /**
@@ -131092,7 +131098,7 @@ function createInstance(config = {}) {
131092
131098
  const createApi = apiFactory(context, usedPlugins);
131093
131099
  const root = createApi({
131094
131100
  name: 'root',
131095
- version: "0.14.14" || 0,
131101
+ version: "0.14.15-beta.3795" || 0,
131096
131102
  spec: ''
131097
131103
  });
131098
131104
  const options = (0,_helpers__WEBPACK_IMPORTED_MODULE_6__.createPiletOptions)({
@@ -133470,19 +133476,32 @@ function installPiralDebug(options) {
133470
133476
  });
133471
133477
  };
133472
133478
 
133479
+ const activatePilet = pilet => {
133480
+ try {
133481
+ const {
133482
+ createApi
133483
+ } = options;
133484
+ const newApi = createApi(pilet);
133485
+ injectPilet(pilet);
133486
+ pilet.setup(newApi);
133487
+ } catch (error) {
133488
+ console.error(error);
133489
+ }
133490
+ };
133491
+
133473
133492
  const togglePilet = name => {
133474
133493
  const pilet = getPilets().find(m => m.name === name);
133475
133494
 
133476
- if (pilet.disabled) {
133477
- try {
133478
- const {
133479
- createApi
133480
- } = options;
133481
- const newApi = createApi(pilet);
133482
- injectPilet(pilet.original);
133483
- pilet.original.setup(newApi);
133484
- } catch (error) {
133485
- console.error(error);
133495
+ if (!pilet) {// nothing to do, obviously invalid call
133496
+ } else if (pilet.disabled) {
133497
+ if (pilet.original) {
133498
+ // everything is fine, let's use the cached version
133499
+ activatePilet(pilet.original);
133500
+ } else {
133501
+ // something fishy is going on - let's just try to activate the same pilet
133502
+ activatePilet(Object.assign(Object.assign({}, pilet), {
133503
+ disabled: false
133504
+ }));
133486
133505
  }
133487
133506
  } else {
133488
133507
  injectPilet({
@@ -133503,18 +133522,9 @@ function installPiralDebug(options) {
133503
133522
 
133504
133523
  const appendPilet = meta => {
133505
133524
  const {
133506
- createApi,
133507
133525
  loadPilet
133508
133526
  } = options;
133509
- loadPilet(meta).then(pilet => {
133510
- try {
133511
- const newApi = createApi(pilet);
133512
- injectPilet(pilet);
133513
- pilet.setup(newApi);
133514
- } catch (error) {
133515
- console.error(error);
133516
- }
133517
- });
133527
+ loadPilet(meta).then(activatePilet);
133518
133528
  };
133519
133529
 
133520
133530
  const toggleVisualize = () => {
@@ -133548,24 +133558,26 @@ function installPiralDebug(options) {
133548
133558
 
133549
133559
  System.constructor.prototype.resolve = function (...args) {
133550
133560
  const [url, parent] = args;
133561
+ const result = systemResolve.call(this, ...args);
133551
133562
 
133552
133563
  if (parent) {
133553
- depMap[parent] = depMap[parent] || {};
133554
- depMap[parent][url] = true;
133564
+ const deps = depMap[parent] || {};
133565
+ deps[url] = result;
133566
+ depMap[parent] = deps;
133555
133567
  }
133556
133568
 
133557
- return systemResolve.call(this, ...args);
133569
+ return result;
133558
133570
  };
133559
133571
 
133560
133572
  const debugApi = {
133561
133573
  debug: debugApiVersion,
133562
133574
  instance: {
133563
133575
  name: "sample-cross-fx",
133564
- version: "0.14.14",
133576
+ version: "0.14.15-beta.3795",
133565
133577
  dependencies: "@angular/common,@angular/compiler,@angular/core,@angular/platform-browser,@angular/platform-browser-dynamic,@webcomponents/webcomponentsjs,angular,aurelia-framework,aurelia-templating-binding,aurelia-templating-resources,aurelia-pal-browser,aurelia-event-aggregator,aurelia-history-browser,hyperapp,inferno,inferno-create-element,mithril,lit-element,solid-js,solid-js/dom,preact,riot,rxjs,vue,zone.js,react,react-dom,react-router,react-router-dom,history,tslib,path-to-regexp,@libre/atom,@dbeining/react-atom"
133566
133578
  },
133567
133579
  build: {
133568
- date: "2022-03-03T01:26:17.722Z",
133580
+ date: "2022-03-04T18:14:23.736Z",
133569
133581
  cli: "0.14.14",
133570
133582
  compat: "0.14"
133571
133583
  },
@@ -133618,11 +133630,18 @@ function installPiralDebug(options) {
133618
133630
  const dependencyMap = {};
133619
133631
 
133620
133632
  const addDeps = (pilet, dependencies) => {
133621
- if (!(pilet in dependencyMap)) {
133622
- dependencyMap[pilet] = [];
133633
+ const deps = dependencyMap[pilet] || [];
133634
+
133635
+ for (const depName of Object.keys(dependencies)) {
133636
+ if (!deps.some(m => m.demanded === depName)) {
133637
+ deps.push({
133638
+ demanded: depName,
133639
+ resolved: dependencies[depName]
133640
+ });
133641
+ }
133623
133642
  }
133624
133643
 
133625
- dependencyMap[pilet].push(...dependencies);
133644
+ dependencyMap[pilet] = deps;
133626
133645
  };
133627
133646
 
133628
133647
  const pilets = getPilets().map(pilet => ({
@@ -255727,4 +255746,4 @@ const app = React.createElement(piral_core_1.Piral, {
255727
255746
 
255728
255747
  /******/ })()
255729
255748
  ;
255730
- //# sourceMappingURL=index.22d3db.js.map
255749
+ //# sourceMappingURL=index.75ea39.js.map