piral-lazy 0.15.0-alpha.3549 → 0.15.0-alpha.3592
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/esm/create.js.map +1 -1
- package/esm/types.d.ts +2 -2
- package/lib/create.js.map +1 -1
- package/lib/types.d.ts +2 -2
- package/package.json +11 -6
- package/piral-lazy.min.js +1 -0
- package/src/create.ts +1 -1
- package/src/types.ts +2 -2
package/esm/create.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,aAAa,EAAiB,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAe,OAAO,
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,aAAa,EAAiB,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAe,OAAO,EAAE,MAAM,YAAY,CAAC;AAUlD,MAAM,UAAU,aAAa;IAC3B,OAAO,CAAC,OAAO,EAAE,EAAE;QACjB,OAAO,CAAC,GAAG,EAAE,EAAE;YACb,MAAM,KAAK,GAAoB,EAAE,CAAC;YAElC,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,EAAE;;gBACrC,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;gBAExB,IAAI,CAAC,GAAG,EAAE;oBACR,MAAM,IAAI,KAAK,CACb,yBAAyB,IAAI,iEAAiE,CAC/F,CAAC;iBACH;gBAED,OAAO,MAAA,GAAG,CAAC,MAAM,mCAAI,CAAC,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;YACnD,CAAC,CAAC;YAEF,OAAO;gBACL,gBAAgB,CAAC,IAAI,EAAE,MAAM;oBAC3B,KAAK,CAAC,IAAI,CAAC,GAAG;wBACZ,MAAM;wBACN,MAAM,EAAE,SAAS;qBAClB,CAAC;gBACJ,CAAC;gBACD,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,EAAE;oBACtB,OAAO,IAAI,CAAC,GAAG,EAAE,CACf,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;wBACnD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;4BAC9C,GAAG,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;4BAC1B,OAAO,GAAG,CAAC;wBACb,CAAC,EAAE,EAAE,CAAC,CAAC;wBACP,OAAO,IAAI,EAAE;6BACV,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;6BACtD,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;4BACtB,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,WAA4B,kBAAI,IAAI,EAAE,MAAM,IAAK,KAAK,EAAG;yBAC5F,CAAC,CAAC,CAAC;oBACR,CAAC,CAAC,CACH,CAAC;gBACJ,CAAC;aACF,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
package/esm/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ComponentType } from 'react';
|
|
2
|
-
import { AnyComponent, BaseComponentProps } from 'piral-core';
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
import type { AnyComponent, BaseComponentProps } from 'piral-core';
|
|
3
3
|
declare module 'piral-core/lib/types/custom' {
|
|
4
4
|
interface PiletCustomApi extends PiletLazyApi {
|
|
5
5
|
}
|
package/lib/create.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":";;;AAAA,iCAA2D;AAC3D,
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":";;;AAAA,iCAA2D;AAC3D,2CAAkD;AAUlD,SAAgB,aAAa;IAC3B,OAAO,CAAC,OAAO,EAAE,EAAE;QACjB,OAAO,CAAC,GAAG,EAAE,EAAE;YACb,MAAM,KAAK,GAAoB,EAAE,CAAC;YAElC,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,EAAE;;gBACrC,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;gBAExB,IAAI,CAAC,GAAG,EAAE;oBACR,MAAM,IAAI,KAAK,CACb,yBAAyB,IAAI,iEAAiE,CAC/F,CAAC;iBACH;gBAED,OAAO,MAAA,GAAG,CAAC,MAAM,mCAAI,CAAC,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;YACnD,CAAC,CAAC;YAEF,OAAO;gBACL,gBAAgB,CAAC,IAAI,EAAE,MAAM;oBAC3B,KAAK,CAAC,IAAI,CAAC,GAAG;wBACZ,MAAM;wBACN,MAAM,EAAE,SAAS;qBAClB,CAAC;gBACJ,CAAC;gBACD,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,EAAE;oBACtB,OAAO,IAAA,YAAI,EAAC,GAAG,EAAE,CACf,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;wBACnD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;4BAC9C,GAAG,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;4BAC1B,OAAO,GAAG,CAAC;wBACb,CAAC,EAAE,EAAE,CAAC,CAAC;wBACP,OAAO,IAAI,EAAE;6BACV,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,oBAAO,EAAC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;6BACtD,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;4BACtB,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAA,qBAAa,EAAC,WAA4B,kBAAI,IAAI,EAAE,MAAM,IAAK,KAAK,EAAG;yBAC5F,CAAC,CAAC,CAAC;oBACR,CAAC,CAAC,CACH,CAAC;gBACJ,CAAC;aACF,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AA1CD,sCA0CC"}
|
package/lib/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ComponentType } from 'react';
|
|
2
|
-
import { AnyComponent, BaseComponentProps } from 'piral-core';
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
import type { AnyComponent, BaseComponentProps } from 'piral-core';
|
|
3
3
|
declare module 'piral-core/lib/types/custom' {
|
|
4
4
|
interface PiletCustomApi extends PiletLazyApi {
|
|
5
5
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-lazy",
|
|
3
|
-
"version": "0.15.0-alpha.
|
|
3
|
+
"version": "0.15.0-alpha.3592",
|
|
4
4
|
"description": "Plugin for lazy loading third-party framework components in Piral.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"piral",
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"files": [
|
|
24
24
|
"esm",
|
|
25
25
|
"lib",
|
|
26
|
-
"src"
|
|
26
|
+
"src",
|
|
27
|
+
"piral-lazy.min.js"
|
|
27
28
|
],
|
|
28
29
|
"repository": {
|
|
29
30
|
"type": "git",
|
|
@@ -33,17 +34,21 @@
|
|
|
33
34
|
"url": "https://github.com/smapiot/piral/issues"
|
|
34
35
|
},
|
|
35
36
|
"scripts": {
|
|
36
|
-
"build": "yarn build:commonjs && yarn build:esnext",
|
|
37
|
+
"build": "yarn build:bundle && yarn build:commonjs && yarn build:esnext",
|
|
38
|
+
"build:bundle": "esbuild src/index.ts --outfile=piral-lazy.min.js --bundle --external:piral-core --external:react --minify --global-name=piralLazy",
|
|
37
39
|
"build:commonjs": "tsc --project tsconfig.json --outDir lib --module commonjs",
|
|
38
40
|
"build:esnext": "tsc --project tsconfig.json --outDir esm --module esnext",
|
|
39
41
|
"typedoc": "typedoc --json ../../../docs/types/piral-lazy.json src --exclude \"src/**/*.test.*\"",
|
|
40
42
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
41
43
|
},
|
|
42
44
|
"devDependencies": {
|
|
43
|
-
"
|
|
45
|
+
"@types/react": "^17.0.0",
|
|
46
|
+
"piral-core": "0.15.0-alpha.3592",
|
|
47
|
+
"react": "^17.0.1"
|
|
44
48
|
},
|
|
45
49
|
"peerDependencies": {
|
|
46
|
-
"piral-core": "0.14.x"
|
|
50
|
+
"piral-core": "0.14.x",
|
|
51
|
+
"react": ">=16.8.0"
|
|
47
52
|
},
|
|
48
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "5537ccd39d275afdc53845ab8cb4868a8dbc8903"
|
|
49
54
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var piralLazy=(()=>{var D=Object.create;var p=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames,y=Object.getOwnPropertySymbols,C=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var s=(e,n,r)=>n in e?p(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,f=(e,n)=>{for(var r in n||(n={}))l.call(n,r)&&s(e,r,n[r]);if(y)for(var r of y(n))x.call(n,r)&&s(e,r,n[r]);return e};var m=e=>p(e,"__esModule",{value:!0});var h=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(n,r)=>(typeof require!="undefined"?require:n)[r]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var T=(e,n)=>{m(e);for(var r in n)p(e,r,{get:n[r],enumerable:!0})},E=(e,n,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of A(n))!l.call(e,o)&&o!=="default"&&p(e,o,{get:()=>n[o],enumerable:!(r=w(n,o))||r.enumerable});return e},P=e=>E(m(p(e!=null?D(C(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var v={};T(v,{createLazyApi:()=>k});var d=P(h("react")),L=P(h("piral-core"));function k(){return e=>n=>{let r={},o=a=>{var c;let t=r[a];if(!t)throw new Error(`The given dependency "${a}" cannot be found. Please add it first using "defineDependency"`);return(c=t.result)!=null?c:t.result=t.loader()};return{defineDependency(a,t){r[a]={loader:t,result:void 0}},fromLazy(a,t=[]){return(0,d.lazy)(()=>Promise.all(t.map(o)).then(c=>{let g=t.reduce((i,u,z)=>(i[u]=c[z],i),{});return a().then(i=>(0,L.withApi)(e,i,n,"unknown")).then(i=>({default:u=>(0,d.createElement)(i,f({deps:g},u))}))}))}}}}return v;})();
|
package/src/create.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { lazy, createElement, ComponentType } from 'react';
|
|
2
|
-
import { PiralPlugin, withApi
|
|
2
|
+
import { PiralPlugin, withApi } from 'piral-core';
|
|
3
3
|
import { PiletLazyApi, LazyDependencyLoader } from './types';
|
|
4
4
|
|
|
5
5
|
interface DependencyCache {
|
package/src/types.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ComponentType } from 'react';
|
|
2
|
-
import { AnyComponent, BaseComponentProps } from 'piral-core';
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
import type { AnyComponent, BaseComponentProps } from 'piral-core';
|
|
3
3
|
|
|
4
4
|
declare module 'piral-core/lib/types/custom' {
|
|
5
5
|
interface PiletCustomApi extends PiletLazyApi {}
|