sample-cross-fx 1.6.2-beta.7421 → 1.6.2-beta.7472

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.
package/app/index.d.ts CHANGED
@@ -177,6 +177,8 @@ export interface PiralEventMap extends PiralCustomEventMap {
177
177
  [custom: string]: any;
178
178
  "store-data": PiralStoreDataEvent;
179
179
  "unhandled-error": PiralUnhandledErrorEvent;
180
+ "loading-pilets": PiralLoadingPiletsEvent;
181
+ "loaded-pilets": PiralLoadedPiletsEvent;
180
182
  }
181
183
 
182
184
  /**
@@ -614,6 +616,30 @@ export interface PiralUnhandledErrorEvent {
614
616
  pilet: string;
615
617
  }
616
618
 
619
+ /**
620
+ * Gets fired when the loading of pilets is triggered.
621
+ */
622
+ export interface PiralLoadingPiletsEvent {
623
+ /**
624
+ * The options that have been supplied for loading the pilets.
625
+ */
626
+ options: LoadPiletsOptions;
627
+ }
628
+
629
+ /**
630
+ * Gets fired when all pilets have been loaded.
631
+ */
632
+ export interface PiralLoadedPiletsEvent {
633
+ /**
634
+ * The pilets that have been loaded.
635
+ */
636
+ pilets: Array<Pilet>;
637
+ /**
638
+ * The loading error, if any.
639
+ */
640
+ error?: Error;
641
+ }
642
+
617
643
  export interface VueComponent<TProps> {
618
644
  /**
619
645
  * The root component of Vue rendering tree.
@@ -1022,6 +1048,56 @@ export interface BaseExtensionSlotProps<TName, TParams> {
1022
1048
  name: TName;
1023
1049
  }
1024
1050
 
1051
+ /**
1052
+ * The options for loading pilets.
1053
+ */
1054
+ export interface LoadPiletsOptions {
1055
+ /**
1056
+ * The callback function for creating an API object.
1057
+ * The API object is passed on to a specific pilet.
1058
+ */
1059
+ createApi: PiletApiCreator;
1060
+ /**
1061
+ * The callback for fetching the dynamic pilets.
1062
+ */
1063
+ fetchPilets: PiletRequester;
1064
+ /**
1065
+ * Optionally, some already existing evaluated pilets, e.g.,
1066
+ * helpful when debugging or in SSR scenarios.
1067
+ */
1068
+ pilets?: Array<Pilet>;
1069
+ /**
1070
+ * Optionally, configures the default loader.
1071
+ */
1072
+ config?: DefaultLoaderConfig;
1073
+ /**
1074
+ * Optionally, defines the default way how to load a pilet.
1075
+ */
1076
+ loadPilet?: PiletLoader;
1077
+ /**
1078
+ * Optionally, defines loaders for custom specifications.
1079
+ */
1080
+ loaders?: CustomSpecLoaders;
1081
+ /**
1082
+ * Optionally, defines a set of loading hooks to be used.
1083
+ */
1084
+ hooks?: PiletLifecycleHooks;
1085
+ /**
1086
+ * Gets the map of globally available dependencies with their names
1087
+ * as keys and their evaluated pilet content as value.
1088
+ */
1089
+ dependencies?: AvailableDependencies;
1090
+ /**
1091
+ * Optionally, defines the loading strategy to use.
1092
+ */
1093
+ strategy?: PiletLoadingStrategy;
1094
+ }
1095
+
1096
+ /**
1097
+ * An evaluated pilet, i.e., a full pilet: functionality and metadata.
1098
+ */
1099
+ export type Pilet = SinglePilet | MultiPilet;
1100
+
1025
1101
  /**
1026
1102
  * Options passed through to Angular `bootstrapModule`.
1027
1103
  *
@@ -1207,6 +1283,94 @@ export interface ExtensionRegistration extends BaseRegistration {
1207
1283
  defaults: any;
1208
1284
  }
1209
1285
 
1286
+ /**
1287
+ * The creator function for the pilet API.
1288
+ */
1289
+ export interface PiletApiCreator {
1290
+ /**
1291
+ * Creates an API for the given raw pilet.
1292
+ * @param target The raw (meta) content of the pilet.
1293
+ * @returns The API object to be used with the pilet.
1294
+ */
1295
+ (target: PiletMetadata): PiletApi;
1296
+ }
1297
+
1298
+ /**
1299
+ * The interface describing a function capable of fetching pilets.
1300
+ */
1301
+ export interface PiletRequester {
1302
+ /**
1303
+ * Gets the raw pilets (e.g., from a server) asynchronously.
1304
+ */
1305
+ (): Promise<PiletEntries>;
1306
+ }
1307
+
1308
+ /**
1309
+ * Additional configuration options for the default loader.
1310
+ */
1311
+ export interface DefaultLoaderConfig {
1312
+ /**
1313
+ * Sets the cross-origin attribute of potential script tags.
1314
+ * For pilets v1 this may be useful. Otherwise, only pilets that
1315
+ * have an integrity defined will be set to "anonymous".
1316
+ */
1317
+ crossOrigin?: string;
1318
+ }
1319
+
1320
+ /**
1321
+ * The callback to be used to load a single pilet.
1322
+ */
1323
+ export interface PiletLoader {
1324
+ (entry: PiletEntry): Promise<Pilet>;
1325
+ }
1326
+
1327
+ /**
1328
+ * Defines the spec identifiers for custom loading.
1329
+ */
1330
+ export type CustomSpecLoaders = Record<string, PiletLoader>;
1331
+
1332
+ /**
1333
+ * A set of pipeline hooks used by the Piral loading orchestrator.
1334
+ */
1335
+ export interface PiletLifecycleHooks {
1336
+ /**
1337
+ * Hook fired before a pilet is loaded.
1338
+ */
1339
+ loadPilet?(pilet: PiletMetadata): void;
1340
+ /**
1341
+ * Hook fired before a pilet is being set up.
1342
+ */
1343
+ setupPilet?(pilet: Pilet): void;
1344
+ /**
1345
+ * Hook fired before a pilet is being cleaned up.
1346
+ */
1347
+ cleanupPilet?(pilet: Pilet): void;
1348
+ }
1349
+
1350
+ /**
1351
+ * The record containing all available dependencies.
1352
+ */
1353
+ export interface AvailableDependencies {
1354
+ [name: string]: any;
1355
+ }
1356
+
1357
+ /**
1358
+ * The strategy for how pilets are loaded at runtime.
1359
+ */
1360
+ export interface PiletLoadingStrategy {
1361
+ (options: LoadPiletsOptions, pilets: PiletsLoaded): PromiseLike<void>;
1362
+ }
1363
+
1364
+ /**
1365
+ * An evaluated single pilet.
1366
+ */
1367
+ export type SinglePilet = SinglePiletApp & PiletMetadata;
1368
+
1369
+ /**
1370
+ * An evaluated multi pilet.
1371
+ */
1372
+ export type MultiPilet = MultiPiletApp & PiletMetadata;
1373
+
1210
1374
  export type BlazorRootConfig = [root: HTMLDivElement, capabilities: Array<string>, applyChanges: (pilet: PiletApi) => void];
1211
1375
 
1212
1376
  /**
@@ -1240,6 +1404,60 @@ export interface BaseRegistration {
1240
1404
 
1241
1405
  export type WrappedComponent<TProps> = React.ComponentType<React.PropsWithChildren<Without<TProps, keyof BaseComponentProps>>>;
1242
1406
 
1407
+ /**
1408
+ * The entries representing pilets from a feed service response.
1409
+ */
1410
+ export type PiletEntries = Array<PiletEntry>;
1411
+
1412
+ /**
1413
+ * Pilet entry representing part of a response from the feed service.
1414
+ */
1415
+ export type PiletEntry = MultiPiletEntry | SinglePiletEntry;
1416
+
1417
+ /**
1418
+ * The callback to be used when pilets have been loaded.
1419
+ */
1420
+ export interface PiletsLoaded {
1421
+ (error: Error | undefined, pilets: Array<Pilet>): void;
1422
+ }
1423
+
1424
+ /**
1425
+ * The pilet app, i.e., the functional exports.
1426
+ */
1427
+ export interface SinglePiletApp {
1428
+ /**
1429
+ * Integrates the evaluated pilet into the application.
1430
+ * @param api The API to access the application.
1431
+ */
1432
+ setup(api: PiletApi): void | Promise<void>;
1433
+ /**
1434
+ * Optional function for cleanup.
1435
+ * @param api The API to access the application.
1436
+ */
1437
+ teardown?(api: PiletApi): void;
1438
+ /**
1439
+ * The referenced stylesheets to load / integrate.
1440
+ * This would only be used by v3 pilets.
1441
+ */
1442
+ styles?: Array<string>;
1443
+ /**
1444
+ * The referenced WebAssembly binaries to load / integrate.
1445
+ * This would only be used by v3 pilets.
1446
+ */
1447
+ assemblies?: Array<string>;
1448
+ }
1449
+
1450
+ /**
1451
+ * The pilet app, i.e., the functional exports.
1452
+ */
1453
+ export interface MultiPiletApp {
1454
+ /**
1455
+ * Integrates the evaluated pilet into the application.
1456
+ * @param api The API to access the application.
1457
+ */
1458
+ setup(apiFactory: PiletApiCreator): void | Promise<void>;
1459
+ }
1460
+
1243
1461
  export interface NavigationApi {
1244
1462
  /**
1245
1463
  * Pushes a new location onto the history stack.
@@ -1290,6 +1508,16 @@ export interface NavigationApi {
1290
1508
 
1291
1509
  export type Without<T, K> = Pick<T, Exclude<keyof T, K>>;
1292
1510
 
1511
+ /**
1512
+ * The metadata response for a multi pilet.
1513
+ */
1514
+ export type MultiPiletEntry = PiletBundleEntry;
1515
+
1516
+ /**
1517
+ * The metadata response for a single pilet.
1518
+ */
1519
+ export type SinglePiletEntry = PiletV0Entry | PiletV1Entry | PiletV2Entry | PiletV3Entry | PiletMfEntry | PiletVxEntry;
1520
+
1293
1521
  export interface NavigationBlocker {
1294
1522
  (tx: NavigationTransition): void;
1295
1523
  }
@@ -1298,6 +1526,238 @@ export interface NavigationListener {
1298
1526
  (update: NavigationUpdate): void;
1299
1527
  }
1300
1528
 
1529
+ /**
1530
+ * Metadata for pilets using the bundle schema.
1531
+ */
1532
+ export interface PiletBundleEntry {
1533
+ /**
1534
+ * The name of the bundle pilet, i.e., the package id.
1535
+ */
1536
+ name?: string;
1537
+ /**
1538
+ * Optionally provides the version of the specification for this pilet.
1539
+ */
1540
+ spec?: "v1";
1541
+ /**
1542
+ * The link for retrieving the bundle content of the pilet.
1543
+ */
1544
+ link: string;
1545
+ /**
1546
+ * The reference name for the global bundle-shared require.
1547
+ */
1548
+ bundle: string;
1549
+ /**
1550
+ * The computed integrity of the pilet. Will be used to set the
1551
+ * integrity value of the script.
1552
+ */
1553
+ integrity?: string;
1554
+ /**
1555
+ * Optionally provides some custom metadata for the pilet.
1556
+ */
1557
+ custom?: any;
1558
+ /**
1559
+ * Additional shared dependency script files.
1560
+ */
1561
+ dependencies?: Record<string, string>;
1562
+ }
1563
+
1564
+ /**
1565
+ * Metadata for pilets using the v0 schema.
1566
+ */
1567
+ export type PiletV0Entry = PiletV0ContentEntry | PiletV0LinkEntry;
1568
+
1569
+ /**
1570
+ * Metadata for pilets using the v1 schema.
1571
+ */
1572
+ export interface PiletV1Entry {
1573
+ /**
1574
+ * The name of the pilet, i.e., the package id.
1575
+ */
1576
+ name: string;
1577
+ /**
1578
+ * The version of the pilet. Should be semantically versioned.
1579
+ */
1580
+ version: string;
1581
+ /**
1582
+ * Optionally provides the version of the specification for this pilet.
1583
+ */
1584
+ spec?: "v1";
1585
+ /**
1586
+ * The link for retrieving the content of the pilet.
1587
+ */
1588
+ link: string;
1589
+ /**
1590
+ * The reference name for the global require.
1591
+ */
1592
+ requireRef: string;
1593
+ /**
1594
+ * The computed integrity of the pilet. Will be used to set the
1595
+ * integrity value of the script.
1596
+ */
1597
+ integrity?: string;
1598
+ /**
1599
+ * Optionally provides some custom metadata for the pilet.
1600
+ */
1601
+ custom?: any;
1602
+ /**
1603
+ * Optionally provides some configuration to be used in the pilet.
1604
+ */
1605
+ config?: Record<string, any>;
1606
+ /**
1607
+ * Additional shared dependency script files.
1608
+ */
1609
+ dependencies?: Record<string, string>;
1610
+ }
1611
+
1612
+ /**
1613
+ * Metadata for pilets using the v2 schema.
1614
+ */
1615
+ export interface PiletV2Entry {
1616
+ /**
1617
+ * The name of the pilet, i.e., the package id.
1618
+ */
1619
+ name: string;
1620
+ /**
1621
+ * The version of the pilet. Should be semantically versioned.
1622
+ */
1623
+ version: string;
1624
+ /**
1625
+ * Provides the version of the specification for this pilet.
1626
+ */
1627
+ spec: "v2";
1628
+ /**
1629
+ * The reference name for the global require.
1630
+ */
1631
+ requireRef: string;
1632
+ /**
1633
+ * The computed integrity of the pilet.
1634
+ */
1635
+ integrity?: string;
1636
+ /**
1637
+ * The link for retrieving the content of the pilet.
1638
+ */
1639
+ link: string;
1640
+ /**
1641
+ * Optionally provides some custom metadata for the pilet.
1642
+ */
1643
+ custom?: any;
1644
+ /**
1645
+ * Optionally provides some configuration to be used in the pilet.
1646
+ */
1647
+ config?: Record<string, any>;
1648
+ /**
1649
+ * Additional shared dependency script files.
1650
+ */
1651
+ dependencies?: Record<string, string>;
1652
+ }
1653
+
1654
+ /**
1655
+ * Metadata for pilets using the v3 schema.
1656
+ */
1657
+ export interface PiletV3Entry {
1658
+ /**
1659
+ * The name of the pilet, i.e., the package id.
1660
+ */
1661
+ name: string;
1662
+ /**
1663
+ * The version of the pilet. Should be semantically versioned.
1664
+ */
1665
+ version: string;
1666
+ /**
1667
+ * Provides the version of the specification for this pilet.
1668
+ */
1669
+ spec: "v3";
1670
+ /**
1671
+ * The reference name for the global require.
1672
+ */
1673
+ requireRef: string;
1674
+ /**
1675
+ * The computed integrity of the pilet.
1676
+ */
1677
+ integrity?: string;
1678
+ /**
1679
+ * The fallback link for retrieving the content of the pilet.
1680
+ */
1681
+ link: string;
1682
+ /**
1683
+ * The links for specific variations of the pilet, e.g., "client", "server", ...
1684
+ */
1685
+ variations?: Record<string, string>;
1686
+ /**
1687
+ * Optionally provides some custom metadata for the pilet.
1688
+ */
1689
+ custom?: any;
1690
+ /**
1691
+ * Optionally provides some configuration to be used in the pilet.
1692
+ */
1693
+ config?: Record<string, any>;
1694
+ /**
1695
+ * Additional shared dependency script files.
1696
+ */
1697
+ dependencies?: Record<string, string>;
1698
+ }
1699
+
1700
+ /**
1701
+ * Metadata for pilets using the v2 schema.
1702
+ */
1703
+ export interface PiletMfEntry {
1704
+ /**
1705
+ * The name of the pilet, i.e., the package id.
1706
+ */
1707
+ name: string;
1708
+ /**
1709
+ * The version of the pilet. Should be semantically versioned.
1710
+ */
1711
+ version: string;
1712
+ /**
1713
+ * Provides the version of the specification for this pilet.
1714
+ */
1715
+ spec: "mf";
1716
+ /**
1717
+ * The computed integrity of the pilet.
1718
+ */
1719
+ integrity?: string;
1720
+ /**
1721
+ * The fallback link for retrieving the content of the pilet.
1722
+ */
1723
+ link: string;
1724
+ /**
1725
+ * Optionally provides some custom metadata for the pilet.
1726
+ */
1727
+ custom?: any;
1728
+ /**
1729
+ * Optionally provides some configuration to be used in the pilet.
1730
+ */
1731
+ config?: Record<string, any>;
1732
+ }
1733
+
1734
+ export interface PiletVxEntry {
1735
+ /**
1736
+ * The name of the pilet, i.e., the package id.
1737
+ */
1738
+ name: string;
1739
+ /**
1740
+ * The version of the pilet. Should be semantically versioned.
1741
+ */
1742
+ version: string;
1743
+ /**
1744
+ * Provides an identifier for the custom specification.
1745
+ */
1746
+ spec: string;
1747
+ /**
1748
+ * Optionally provides some custom metadata for the pilet.
1749
+ */
1750
+ custom?: any;
1751
+ /**
1752
+ * Optionally provides some configuration to be used in the pilet.
1753
+ */
1754
+ config?: Record<string, any>;
1755
+ /**
1756
+ * Additional shared dependency script files.
1757
+ */
1758
+ dependencies?: Record<string, string>;
1759
+ }
1760
+
1301
1761
  export interface NavigationTransition extends NavigationUpdate {
1302
1762
  retry?(): void;
1303
1763
  }
@@ -1307,6 +1767,34 @@ export interface NavigationUpdate {
1307
1767
  location: NavigationLocation;
1308
1768
  }
1309
1769
 
1770
+ /**
1771
+ * Metadata for pilets using the v0 schema with a content.
1772
+ */
1773
+ export interface PiletV0ContentEntry extends PiletV0BaseEntry {
1774
+ /**
1775
+ * The content of the pilet. If the content is not available
1776
+ * the link will be used (unless caching has been activated).
1777
+ */
1778
+ content: string;
1779
+ /**
1780
+ * If available indicates that the pilet should not be cached.
1781
+ * In case of a string this is interpreted as the expiration time
1782
+ * of the cache. In case of an accurate hash this should not be
1783
+ * required or set.
1784
+ */
1785
+ noCache?: boolean | string;
1786
+ }
1787
+
1788
+ /**
1789
+ * Metadata for pilets using the v0 schema with a link.
1790
+ */
1791
+ export interface PiletV0LinkEntry extends PiletV0BaseEntry {
1792
+ /**
1793
+ * The link for retrieving the content of the pilet.
1794
+ */
1795
+ link: string;
1796
+ }
1797
+
1310
1798
  export type NavigationAction = "POP" | "PUSH" | "REPLACE";
1311
1799
 
1312
1800
  export interface NavigationLocation {
@@ -1344,4 +1832,39 @@ export interface NavigationLocation {
1344
1832
  * locations, this string will be a unique identifier.
1345
1833
  */
1346
1834
  key?: string;
1835
+ }
1836
+
1837
+ /**
1838
+ * Basic metadata for pilets using the v0 schema.
1839
+ */
1840
+ export interface PiletV0BaseEntry {
1841
+ /**
1842
+ * The name of the pilet, i.e., the package id.
1843
+ */
1844
+ name: string;
1845
+ /**
1846
+ * The version of the pilet. Should be semantically versioned.
1847
+ */
1848
+ version: string;
1849
+ /**
1850
+ * Optionally provides the version of the specification for this pilet.
1851
+ */
1852
+ spec?: "v0";
1853
+ /**
1854
+ * The computed hash value of the pilet's content. Should be
1855
+ * accurate to allow caching.
1856
+ */
1857
+ hash: string;
1858
+ /**
1859
+ * Optionally provides some custom metadata for the pilet.
1860
+ */
1861
+ custom?: any;
1862
+ /**
1863
+ * Optionally provides some configuration to be used in the pilet.
1864
+ */
1865
+ config?: Record<string, any>;
1866
+ /**
1867
+ * Additional shared dependency script files.
1868
+ */
1869
+ dependencies?: Record<string, string>;
1347
1870
  }
package/app/index.html CHANGED
@@ -5,7 +5,7 @@
5
5
  <title>Sample - Cross Framework with Piral</title>
6
6
  <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
7
7
 
8
- <script defer src="/index.488fdf.js"></script></head>
8
+ <script defer src="/index.96624e.js"></script></head>
9
9
  <body>
10
10
  <div id="app"></div>
11
11
 
package/files.tar CHANGED
Binary file
package/files_once.tar CHANGED
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sample-cross-fx",
3
3
  "description": "Example project illustrating the mixing of different (opt-in) frameworks via plugins.",
4
- "version": "1.6.2-beta.7421",
4
+ "version": "1.6.2-beta.7472",
5
5
  "license": "MIT",
6
6
  "homepage": "https://piral.io",
7
7
  "keywords": [
@@ -50,7 +50,7 @@
50
50
  "files": []
51
51
  },
52
52
  "piralCLI": {
53
- "version": "1.6.2-beta.7421",
53
+ "version": "1.6.2-beta.7472",
54
54
  "generated": true
55
55
  },
56
56
  "main": "./app/index.js",
@@ -65,8 +65,8 @@
65
65
  "@types/react-router": "^5.1.8",
66
66
  "@types/react-router-dom": "^5.1.6",
67
67
  "@vue/component-compiler-utils": "^3.0.0",
68
- "piral-cli": "^1.6.2-beta.7421",
69
- "piral-cli-webpack5": "^1.6.2-beta.7421",
68
+ "piral-cli": "^1.6.2-beta.7472",
69
+ "piral-cli-webpack5": "^1.6.2-beta.7472",
70
70
  "sass": "^1.17.0",
71
71
  "vue-template-compiler": "^2.6.10",
72
72
  "@angular/common": "16.2.9",
@@ -89,22 +89,22 @@
89
89
  "inferno-create-element": "7.4.11",
90
90
  "lit-element": "2.5.1",
91
91
  "mithril": "2.2.2",
92
- "piral-aurelia": "^1.6.2-beta.7421",
93
- "piral-blazor": "^1.6.2-beta.7421",
94
- "piral-core": "^1.6.2-beta.7421",
95
- "piral-elm": "^1.6.2-beta.7421",
96
- "piral-hyperapp": "^1.6.2-beta.7421",
97
- "piral-inferno": "^1.6.2-beta.7421",
98
- "piral-lazy": "^1.6.2-beta.7421",
99
- "piral-litel": "^1.6.2-beta.7421",
100
- "piral-mithril": "^1.6.2-beta.7421",
101
- "piral-ng": "^1.6.2-beta.7421",
102
- "piral-ngjs": "^1.6.2-beta.7421",
103
- "piral-preact": "^1.6.2-beta.7421",
104
- "piral-riot": "^1.6.2-beta.7421",
105
- "piral-solid": "^1.6.2-beta.7421",
106
- "piral-svelte": "^1.6.2-beta.7421",
107
- "piral-vue": "^1.6.2-beta.7421",
92
+ "piral-aurelia": "^1.6.2-beta.7472",
93
+ "piral-blazor": "^1.6.2-beta.7472",
94
+ "piral-core": "^1.6.2-beta.7472",
95
+ "piral-elm": "^1.6.2-beta.7472",
96
+ "piral-hyperapp": "^1.6.2-beta.7472",
97
+ "piral-inferno": "^1.6.2-beta.7472",
98
+ "piral-lazy": "^1.6.2-beta.7472",
99
+ "piral-litel": "^1.6.2-beta.7472",
100
+ "piral-mithril": "^1.6.2-beta.7472",
101
+ "piral-ng": "^1.6.2-beta.7472",
102
+ "piral-ngjs": "^1.6.2-beta.7472",
103
+ "piral-preact": "^1.6.2-beta.7472",
104
+ "piral-riot": "^1.6.2-beta.7472",
105
+ "piral-solid": "^1.6.2-beta.7472",
106
+ "piral-svelte": "^1.6.2-beta.7472",
107
+ "piral-vue": "^1.6.2-beta.7472",
108
108
  "preact": "10.18.1",
109
109
  "react": "18.2.0",
110
110
  "react-dom": "18.2.0",