sample-cross-fx 0.15.2-beta.4932 → 0.15.2-beta.4938

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.
@@ -54315,14 +54315,16 @@ function createConverter(lazy) {
54315
54315
  locals.state = 'fresh';
54316
54316
  locals.update = noop;
54317
54317
  locals.dispose = (0,_events__WEBPACK_IMPORTED_MODULE_2__.attachEvents)(el, ev => data.piral.renderHtmlExtension(ev.detail.target, ev.detail.props), ev => ev.detail.replace ? nav.replace(ev.detail.to, ev.detail.store) : nav.push(ev.detail.to, ev.detail.state));
54318
- (loader || (loader = boot())).then(root => dependency().then(() => (0,_interop__WEBPACK_IMPORTED_MODULE_1__.activate)(moduleName, props)).then(refId => {
54318
+ (loader || (loader = boot())).then(config => dependency(config).then(() => (0,_interop__WEBPACK_IMPORTED_MODULE_1__.activate)(moduleName, props)).then(refId => {
54319
+ const [root] = config;
54320
+
54319
54321
  if (locals.state === 'fresh') {
54320
54322
  locals.id = refId;
54321
54323
  locals.node = root.querySelector(`#${locals.id} > div`);
54322
54324
  project(locals.node, el, options);
54323
54325
  locals.state = 'mounted';
54324
54326
  locals.referenceId = refId;
54325
- locals.update(root);
54327
+ locals.update(config);
54326
54328
  locals.update = noop;
54327
54329
  }
54328
54330
  })).catch(err => console.error(err));
@@ -54339,7 +54341,7 @@ function createConverter(lazy) {
54339
54341
  (0,_events__WEBPACK_IMPORTED_MODULE_2__.removeGlobalEventListeners)(el);
54340
54342
  el.removeAttribute('data-blazor-pilet-root');
54341
54343
  locals.dispose();
54342
- enqueueChange(locals, root => {
54344
+ enqueueChange(locals, ([root]) => {
54343
54345
  root.querySelector(`#${locals.id}`).appendChild(locals.node);
54344
54346
  (0,_interop__WEBPACK_IMPORTED_MODULE_1__.deactivate)(moduleName, locals.referenceId);
54345
54347
  });
@@ -54388,11 +54390,13 @@ function createBlazorApi(config = {}) {
54388
54390
  options
54389
54391
  }) => convert(moduleName, dependency, args, options);
54390
54392
 
54391
- return () => {
54393
+ return (_, meta) => {
54392
54394
  const loader = (0,_dependencies__WEBPACK_IMPORTED_MODULE_1__.createDependencyLoader)(convert, lazy);
54393
54395
  let options;
54394
54396
  return {
54395
- defineBlazorReferences: loader.defineBlazorReferences,
54397
+ defineBlazorReferences(references) {
54398
+ return loader.defineBlazorReferences(references, meta);
54399
+ },
54396
54400
 
54397
54401
  defineBlazorOptions(blazorOptions) {
54398
54402
  options = blazorOptions;
@@ -54437,50 +54441,73 @@ var _a;
54437
54441
  const loadedDependencies = (_a = window.$blazorDependencies) !== null && _a !== void 0 ? _a : window.$blazorDependencies = [];
54438
54442
  function createDependencyLoader(convert, lazy = true) {
54439
54443
  const definedBlazorReferences = [];
54444
+ const loadedBlazorPilets = [];
54440
54445
  let dependency;
54441
54446
  return {
54442
54447
  getDependency() {
54443
54448
  return dependency;
54444
54449
  },
54445
54450
 
54446
- defineBlazorReferences(references) {
54447
- const load = () => (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__awaiter)(this, void 0, void 0, function* () {
54448
- for (const dllUrl of references) {
54449
- const dllName = dllUrl.substring(dllUrl.lastIndexOf('/') + 1);
54451
+ defineBlazorReferences(references, meta = {}) {
54452
+ const load = ([_, capabilities]) => (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__awaiter)(this, void 0, void 0, function* () {
54453
+ if (capabilities.includes('load')) {
54454
+ // new loading mechanism
54455
+ const dependencies = references.filter(m => m.endsWith('.dll'));
54456
+ const dllUrl = dependencies.pop();
54457
+ const piletName = dllUrl.substring(0, dllUrl.length - 4);
54458
+ const piletPdb = `${piletName}.pdb`;
54459
+ const pdbUrl = references.find(m => m === piletPdb);
54460
+ const id = Math.random().toString(26).substring(2);
54461
+ yield (0,_interop__WEBPACK_IMPORTED_MODULE_1__.loadBlazorPilet)(id, {
54462
+ name: meta.name || '(unknown)',
54463
+ version: meta.version || '0.0.0',
54464
+ config: JSON.stringify(meta.config || {}),
54465
+ baseUrl: meta.basePath || dllUrl.substring(0, dllUrl.lastIndexOf('/')).replace('/_framework/', '/'),
54466
+ dependencies,
54467
+ dllUrl,
54468
+ pdbUrl
54469
+ });
54470
+ loadedBlazorPilets.push(id);
54471
+ } else {
54472
+ // old loading mechanism
54473
+ for (const dllUrl of references) {
54474
+ const dllName = dllUrl.substring(dllUrl.lastIndexOf('/') + 1);
54450
54475
 
54451
- if (dllUrl.endsWith('.dll')) {
54452
- const entry = loadedDependencies.find(m => m.name === dllName);
54476
+ if (dllUrl.endsWith('.dll')) {
54477
+ const entry = loadedDependencies.find(m => m.name === dllName);
54453
54478
 
54454
- if (entry) {
54455
- entry.count++;
54456
- yield entry.promise;
54457
- } else {
54458
- const urlWithoutExtension = dllUrl.substring(0, dllUrl.length - 4);
54459
- const pdbName = `${urlWithoutExtension}.pdb`;
54460
- const pdbUrl = references.find(m => m === pdbName);
54461
- const promise = pdbUrl ? (0,_interop__WEBPACK_IMPORTED_MODULE_1__.loadResourceWithSymbol)(dllUrl, pdbUrl) : (0,_interop__WEBPACK_IMPORTED_MODULE_1__.loadResource)(dllUrl);
54462
- loadedDependencies.push({
54463
- name: dllName,
54464
- url: dllUrl,
54465
- count: 1,
54466
- promise
54467
- });
54468
- yield promise;
54469
- }
54479
+ if (entry) {
54480
+ entry.count++;
54481
+ yield entry.promise;
54482
+ } else {
54483
+ const urlWithoutExtension = dllUrl.substring(0, dllUrl.length - 4);
54484
+ const pdbName = `${urlWithoutExtension}.pdb`;
54485
+ const pdbUrl = references.find(m => m === pdbName);
54486
+ const promise = pdbUrl ? (0,_interop__WEBPACK_IMPORTED_MODULE_1__.loadResourceWithSymbol)(dllUrl, pdbUrl) : (0,_interop__WEBPACK_IMPORTED_MODULE_1__.loadResource)(dllUrl);
54487
+ loadedDependencies.push({
54488
+ name: dllName,
54489
+ url: dllUrl,
54490
+ count: 1,
54491
+ promise
54492
+ });
54493
+ yield promise;
54494
+ }
54470
54495
 
54471
- definedBlazorReferences.push(dllName);
54496
+ definedBlazorReferences.push(dllName);
54497
+ }
54472
54498
  }
54473
54499
  }
54474
54500
  });
54475
54501
 
54476
54502
  let result = !lazy && convert.loader.then(load);
54477
54503
 
54478
- dependency = () => result || (result = load());
54504
+ dependency = config => result || (result = load(config));
54479
54505
  },
54480
54506
 
54481
54507
  releaseBlazorReferences() {
54482
54508
  return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__awaiter)(this, void 0, void 0, function* () {
54483
54509
  const references = definedBlazorReferences.splice(0, definedBlazorReferences.length);
54510
+ const ids = loadedBlazorPilets.splice(0, loadedBlazorPilets.length); // old way of loading
54484
54511
 
54485
54512
  for (const reference of references) {
54486
54513
  const entry = loadedDependencies.find(m => m.name === reference);
@@ -54489,6 +54516,11 @@ function createDependencyLoader(convert, lazy = true) {
54489
54516
  loadedDependencies.splice(loadedDependencies.indexOf(entry), 1);
54490
54517
  yield (0,_interop__WEBPACK_IMPORTED_MODULE_1__.unloadResource)(entry.url);
54491
54518
  }
54519
+ } // new way of loading
54520
+
54521
+
54522
+ for (const id of ids) {
54523
+ yield (0,_interop__WEBPACK_IMPORTED_MODULE_1__.unloadBlazorPilet)(id);
54492
54524
  }
54493
54525
  });
54494
54526
  }
@@ -54641,10 +54673,13 @@ __webpack_require__.r(__webpack_exports__);
54641
54673
  /* harmony export */ "callNotifyLocationChanged": () => (/* binding */ callNotifyLocationChanged),
54642
54674
  /* harmony export */ "createBootLoader": () => (/* binding */ createBootLoader),
54643
54675
  /* harmony export */ "deactivate": () => (/* binding */ deactivate),
54676
+ /* harmony export */ "getCapabilities": () => (/* binding */ getCapabilities),
54644
54677
  /* harmony export */ "initialize": () => (/* binding */ initialize),
54678
+ /* harmony export */ "loadBlazorPilet": () => (/* binding */ loadBlazorPilet),
54645
54679
  /* harmony export */ "loadResource": () => (/* binding */ loadResource),
54646
54680
  /* harmony export */ "loadResourceWithSymbol": () => (/* binding */ loadResourceWithSymbol),
54647
54681
  /* harmony export */ "reactivate": () => (/* binding */ reactivate),
54682
+ /* harmony export */ "unloadBlazorPilet": () => (/* binding */ unloadBlazorPilet),
54648
54683
  /* harmony export */ "unloadResource": () => (/* binding */ unloadResource)
54649
54684
  /* harmony export */ });
54650
54685
  /* harmony import */ var _events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./events */ "../../converters/piral-blazor/esm/events.js");
@@ -54700,14 +54735,14 @@ function createBlazorStarter(publicPath) {
54700
54735
 
54701
54736
  navManager.getBaseURI = () => originalBase;
54702
54737
 
54703
- return window.Blazor.start().then(() => {
54738
+ return window.Blazor.start().then(getCapabilities).then(capabilities => {
54704
54739
  baseElement.href = originalBase;
54705
- return root;
54740
+ return [root, capabilities];
54706
54741
  });
54707
54742
  };
54708
54743
  }
54709
54744
 
54710
- return () => window.Blazor.start().then(() => root);
54745
+ return () => window.Blazor.start().then(getCapabilities).then(capabilities => [root, capabilities]);
54711
54746
  }
54712
54747
 
54713
54748
  function computePath() {
@@ -54751,6 +54786,13 @@ function deactivate(moduleName, referenceId) {
54751
54786
  function callNotifyLocationChanged(url, replace) {
54752
54787
  return window.DotNet.invokeMethodAsync(wasmLib, 'NotifyLocationChanged', url, replace);
54753
54788
  }
54789
+ function getCapabilities() {
54790
+ return window.DotNet.invokeMethodAsync(coreLib, 'GetCapabilities').catch(() => {
54791
+ // Apparently an older version of Piral.Blazor, which does not support this
54792
+ // discard this error silently (in the future we may print warnings here)
54793
+ return [];
54794
+ });
54795
+ }
54754
54796
  function loadResource(url) {
54755
54797
  return window.DotNet.invokeMethodAsync(coreLib, 'LoadComponentsFromLibrary', url);
54756
54798
  }
@@ -54760,6 +54802,12 @@ function loadResourceWithSymbol(dllUrl, pdbUrl) {
54760
54802
  function unloadResource(url) {
54761
54803
  return window.DotNet.invokeMethodAsync(coreLib, 'UnloadComponentsFromLibrary', url);
54762
54804
  }
54805
+ function loadBlazorPilet(id, data) {
54806
+ return window.DotNet.invokeMethodAsync(coreLib, 'LoadPilet', id, data);
54807
+ }
54808
+ function unloadBlazorPilet(id) {
54809
+ return window.DotNet.invokeMethodAsync(coreLib, 'UnloadPilet', id);
54810
+ }
54763
54811
  function initialize(scriptUrl, publicPath) {
54764
54812
  return new Promise((resolve, reject) => {
54765
54813
  const startBlazor = createBlazorStarter(publicPath);
@@ -54785,7 +54833,7 @@ function createBootLoader(scriptUrl, satellites) {
54785
54833
  return () => {
54786
54834
  if (typeof window.$blazorLoader === 'undefined') {
54787
54835
  // we load all satellite scripts before we initialize blazor
54788
- window.$blazorLoader = Promise.all(satellites.map(url => addScript(url))).then(() => initialize(scriptUrl, publicPath));
54836
+ window.$blazorLoader = Promise.all(satellites.map(addScript)).then(() => initialize(scriptUrl, publicPath));
54789
54837
  }
54790
54838
 
54791
54839
  return window.$blazorLoader;
@@ -63557,12 +63605,12 @@ function installPiralDebug(options) {
63557
63605
  debug: debugApiVersion,
63558
63606
  instance: {
63559
63607
  name: "sample-cross-fx",
63560
- version: "0.15.2-beta.4932",
63608
+ version: "0.15.2-beta.4938",
63561
63609
  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,piral-ng/common,preact,riot,rxjs,vue,zone.js,tslib,react,react-dom,react-router,react-router-dom"
63562
63610
  },
63563
63611
  build: {
63564
- date: "2022-11-30T01:55:52.418Z",
63565
- cli: "0.15.2-beta.4932",
63612
+ date: "2022-12-02T12:40:24.498Z",
63613
+ cli: "0.15.2-beta.4938",
63566
63614
  compat: "0.15"
63567
63615
  }
63568
63616
  };
@@ -216410,4 +216458,4 @@ root.render( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8__.createElement(piral
216410
216458
 
216411
216459
  /******/ })()
216412
216460
  ;
216413
- //# sourceMappingURL=index.94e896.js.map
216461
+ //# sourceMappingURL=index.284377.js.map