@rindo/core 3.3.0 → 4.0.0-beta.1

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.
Files changed (46) hide show
  1. package/cli/index.cjs +1 -1
  2. package/cli/index.js +1 -1
  3. package/cli/package.json +1 -1
  4. package/compiler/package.json +1 -1
  5. package/compiler/rindo.js +20 -84
  6. package/compiler/rindo.min.js +2 -2
  7. package/dev-server/client/index.js +1 -1
  8. package/dev-server/client/package.json +1 -1
  9. package/dev-server/connector.html +2 -2
  10. package/dev-server/index.js +1 -1
  11. package/dev-server/package.json +1 -1
  12. package/dev-server/server-process.js +2 -2
  13. package/dev-server/ws.js +1 -1
  14. package/internal/app-data/index.cjs +1 -7
  15. package/internal/app-data/index.js +1 -7
  16. package/internal/app-data/package.json +1 -1
  17. package/internal/client/index.js +13 -44
  18. package/internal/client/package.json +1 -1
  19. package/internal/client/patch-browser.js +4 -102
  20. package/internal/client/shadow-css.js +1 -1
  21. package/internal/hydrate/index.js +18 -23
  22. package/internal/hydrate/package.json +1 -1
  23. package/internal/package.json +1 -1
  24. package/internal/rindo-private.d.ts +0 -13
  25. package/internal/rindo-public-compiler.d.ts +0 -34
  26. package/internal/testing/index.js +18 -24
  27. package/internal/testing/package.json +1 -1
  28. package/mock-doc/index.cjs +2 -2
  29. package/mock-doc/index.js +2 -2
  30. package/mock-doc/package.json +1 -1
  31. package/package.json +2 -2
  32. package/screenshot/package.json +1 -1
  33. package/sys/node/713.node-fetch.js +451 -0
  34. package/sys/node/autoprefixer.js +2 -2
  35. package/sys/node/glob.js +1 -1
  36. package/sys/node/graceful-fs.js +1 -1
  37. package/sys/node/index.js +1 -1
  38. package/sys/node/node-fetch.js +4 -1
  39. package/sys/node/package.json +1 -1
  40. package/sys/node/worker.js +1 -1
  41. package/testing/index.js +8 -8
  42. package/testing/package.json +1 -1
  43. package/internal/client/css-shim.js +0 -4
  44. package/internal/client/dom.js +0 -73
  45. package/internal/client/patch-esm.js +0 -25
  46. package/internal/client/polyfills/css-shim.js +0 -1
@@ -320,31 +320,26 @@ const createTime = (e, t = "") => {
320
320
  }, rootAppliedStyles = new WeakMap, registerStyle = (e, t, o) => {
321
321
  let n = styles.get(e);
322
322
  n = t, styles.set(e, n);
323
- }, addStyle = (e, t, o, n) => {
324
- var s;
325
- let l = getScopeId(t, o);
326
- const a = styles.get(l);
327
- if (!BUILD.attachStyles) return l;
328
- if (e = 11 === e.nodeType ? e : doc, a) if ("string" == typeof a) {
323
+ }, addStyle = (e, t, o) => {
324
+ var n;
325
+ const s = getScopeId(t, o), l = styles.get(s);
326
+ if (!BUILD.attachStyles) return s;
327
+ if (e = 11 === e.nodeType ? e : doc, l) if ("string" == typeof l) {
329
328
  e = e.head || e;
330
- let o, r = rootAppliedStyles.get(e);
331
- if (r || rootAppliedStyles.set(e, r = new Set), !r.has(l)) {
332
- if (BUILD.hydrateClientSide && e.host && (o = e.querySelector(`[sty-id="${l}"]`))) o.innerHTML = a; else {
333
- if (BUILD.cssVarShim && plt.$cssShim$) {
334
- o = plt.$cssShim$.createHostStyle(n, l, a, !!(10 & t.$flags$));
335
- const e = o["s-sc"];
336
- e && (l = e, r = null);
337
- } else o = doc.createElement("style"), o.innerHTML = a;
338
- const i = null !== (s = plt.$nonce$) && void 0 !== s ? s : queryNonceMetaTagContent(doc);
339
- null != i && o.setAttribute("nonce", i), (BUILD.hydrateServerSide || BUILD.hotModuleReplacement) && o.setAttribute("sty-id", l),
340
- e.insertBefore(o, e.querySelector("link"));
329
+ let t, o = rootAppliedStyles.get(e);
330
+ if (o || rootAppliedStyles.set(e, o = new Set), !o.has(s)) {
331
+ if (BUILD.hydrateClientSide && e.host && (t = e.querySelector(`[sty-id="${s}"]`))) t.innerHTML = l; else {
332
+ t = doc.createElement("style"), t.innerHTML = l;
333
+ const o = null !== (n = plt.$nonce$) && void 0 !== n ? n : queryNonceMetaTagContent(doc);
334
+ null != o && t.setAttribute("nonce", o), (BUILD.hydrateServerSide || BUILD.hotModuleReplacement) && t.setAttribute("sty-id", s),
335
+ e.insertBefore(t, e.querySelector("link"));
341
336
  }
342
- r && r.add(l);
337
+ o && o.add(s);
343
338
  }
344
- } else BUILD.constructableCSS && !e.adoptedStyleSheets.includes(a) && (e.adoptedStyleSheets = [ ...e.adoptedStyleSheets, a ]);
345
- return l;
339
+ } else BUILD.constructableCSS && !e.adoptedStyleSheets.includes(l) && (e.adoptedStyleSheets = [ ...e.adoptedStyleSheets, l ]);
340
+ return s;
346
341
  }, attachStyles = e => {
347
- const t = e.$cmpMeta$, o = e.$hostElement$, n = t.$flags$, s = createTime("attachStyles", t.$tagName$), l = addStyle(BUILD.shadowDom && supportsShadow && o.shadowRoot ? o.shadowRoot : o.getRootNode(), t, e.$modeName$, o);
342
+ const t = e.$cmpMeta$, o = e.$hostElement$, n = t.$flags$, s = createTime("attachStyles", t.$tagName$), l = addStyle(BUILD.shadowDom && supportsShadow && o.shadowRoot ? o.shadowRoot : o.getRootNode(), t, e.$modeName$);
348
343
  (BUILD.shadowDom || BUILD.scoped) && BUILD.cssAnnotations && 10 & n && (o["s-sc"] = l,
349
344
  o.classList.add(l + "-h"), BUILD.scoped && 2 & n && o.classList.add(l + "-s")),
350
345
  s();
@@ -528,7 +523,7 @@ const createElm = (e, t, o, n) => {
528
523
  BUILD.style && o && attachStyles(e);
529
524
  const r = createTime("render", e.$cmpMeta$.$tagName$);
530
525
  if (BUILD.isDev && (e.$flags$ |= 1024), BUILD.hydrateServerSide ? await callRender(e, t, s) : callRender(e, t, s),
531
- BUILD.cssVarShim && plt.$cssShim$ && plt.$cssShim$.updateHost(s), BUILD.isDev && (e.$renderCount$ = void 0 === e.$renderCount$ ? 1 : e.$renderCount$ + 1,
526
+ BUILD.isDev && (e.$renderCount$ = void 0 === e.$renderCount$ ? 1 : e.$renderCount$ + 1,
532
527
  e.$flags$ &= -1025), BUILD.hydrateServerSide) try {
533
528
  serverSideConnected(s), o && (1 & e.$cmpMeta$.$flags$ ? s["s-en"] = "" : 2 & e.$cmpMeta$.$flags$ && (s["s-en"] = "c"));
534
529
  } catch (e) {
@@ -749,7 +744,7 @@ const callRender = (e, t, o) => {
749
744
  if (0 == (1 & plt.$flags$)) {
750
745
  const t = getHostRef(e), o = BUILD.lazyLoad ? t.$lazyInstance$ : e;
751
746
  BUILD.hostListener && t.$rmListeners$ && (t.$rmListeners$.map((e => e())), t.$rmListeners$ = void 0),
752
- BUILD.cssVarShim && plt.$cssShim$ && plt.$cssShim$.removeHost(e), BUILD.lazyLoad && BUILD.disconnectedCallback && safeCall(o, "disconnectedCallback"),
747
+ BUILD.lazyLoad && BUILD.disconnectedCallback && safeCall(o, "disconnectedCallback"),
753
748
  BUILD.cmpDidUnload && safeCall(o, "componentDidUnload");
754
749
  }
755
750
  }, defineCustomElement = (e, t) => {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/internal/hydrate",
3
- "version": "3.3.0",
3
+ "version": "4.0.0-beta.1",
4
4
  "description": "Rindo internal hydrate platform to be imported by the Rindo Compiler. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "private": true
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/internal",
3
- "version": "3.3.0",
3
+ "version": "4.0.0-beta.1",
4
4
  "description": "Rindo internals only to be imported by the Rindo Compiler. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -115,17 +115,14 @@ export interface BuildConditionals extends Partial<BuildFeatures> {
115
115
  cssAnnotations?: boolean;
116
116
  lazyLoad?: boolean;
117
117
  profile?: boolean;
118
- cssVarShim?: boolean;
119
118
  constructableCSS?: boolean;
120
119
  appendChildSlotFix?: boolean;
121
120
  slotChildNodesFix?: boolean;
122
121
  scopedSlotTextContentFix?: boolean;
123
122
  cloneNodeFix?: boolean;
124
- dynamicImportShim?: boolean;
125
123
  hydratedAttribute?: boolean;
126
124
  hydratedClass?: boolean;
127
125
  initializeNextTick?: boolean;
128
- safari10?: boolean;
129
126
  scriptDataOpts?: boolean;
130
127
  shadowDomShim?: boolean;
131
128
  asyncQueue?: boolean;
@@ -933,15 +930,6 @@ export interface HostRuleHeader {
933
930
  name?: string;
934
931
  value?: string;
935
932
  }
936
- export interface CssVarShim {
937
- i(): Promise<any>;
938
- addLink(linkEl: HTMLLinkElement): Promise<any>;
939
- addGlobalStyle(styleEl: HTMLStyleElement): void;
940
- createHostStyle(hostEl: HTMLElement, templateName: string, cssText: string, isScoped: boolean): HTMLStyleElement;
941
- removeHost(hostEl: HTMLElement): void;
942
- updateHost(hostEl: HTMLElement): void;
943
- updateGlobal(): void;
944
- }
945
933
  export interface DevClientWindow extends Window {
946
934
  ['s-dev-server']: boolean;
947
935
  ['s-initial-load']: boolean;
@@ -1486,7 +1474,6 @@ export interface HostRef {
1486
1474
  $renderCount$?: number;
1487
1475
  }
1488
1476
  export interface PlatformRuntime {
1489
- $cssShim$?: CssVarShim;
1490
1477
  $flags$: number;
1491
1478
  $orgLocNodes$?: Map<string, RenderNode>;
1492
1479
  $resourcesUrl$: string;
@@ -252,21 +252,6 @@ export interface ConfigExtras {
252
252
  * simulating shadow dom. Defaults to `false`.
253
253
  */
254
254
  cloneNodeFix?: boolean;
255
- /**
256
- * Include the CSS Custom Property polyfill/shim for legacy browsers. ESM builds will
257
- * not include the css vars shim. Defaults to `false`
258
- *
259
- * @deprecated Since Rindo v3.0.0. IE 11, Edge <= 18, and old Safari
260
- * versions are no longer supported.
261
- */
262
- __deprecated__cssVarsShim?: boolean;
263
- /**
264
- * Dynamic `import()` shim. This is only needed for Edge 18 and below, and
265
- * Firefox 67 and below. Defaults to `false`.
266
- * @deprecated Since Rindo v3.0.0. IE 11, Edge <= 18, and old Safari
267
- * versions are no longer supported.
268
- */
269
- __deprecated__dynamicImportShim?: boolean;
270
255
  /**
271
256
  * Experimental flag. Projects that use a Rindo library built using the `dist` output target may have trouble lazily
272
257
  * loading components when using a bundler such as Wite or Parcel. Setting this flag to `true` will change how Rindo
@@ -287,15 +272,6 @@ export interface ConfigExtras {
287
272
  * Dispatches component lifecycle events. Mainly used for testing. Defaults to `false`.
288
273
  */
289
274
  lifecycleDOMEvents?: boolean;
290
- /**
291
- * Safari 10 supports ES modules with `<script type="module">`, however, it did not implement
292
- * `<script nomodule>`. When set to `true`, the runtime will patch support for Safari 10
293
- * due to its lack of `nomodule` support.
294
- * Defaults to `false`.
295
- *
296
- * @deprecated Since Rindo v3.0.0, Safari 10 is no longer supported.
297
- */
298
- __deprecated__safari10?: boolean;
299
275
  /**
300
276
  * It is possible to assign data to the actual `<script>` element's `data-opts` property,
301
277
  * which then gets passed to Rindo's initial bootstrap. This feature is only required
@@ -307,16 +283,6 @@ export interface ConfigExtras {
307
283
  * component that uses the shadow DOM. Defaults to `false`
308
284
  */
309
285
  scopedSlotTextContentFix?: boolean;
310
- /**
311
- * If enabled `true`, the runtime will check if the shadow dom shim is required. However,
312
- * if it's determined that shadow dom is already natively supported by the browser then
313
- * it does not request the shim. When set to `false` it will avoid all shadow dom tests.
314
- * Defaults to `false`.
315
- *
316
- * @deprecated Since Rindo v3.0.0. IE 11, Edge <= 18, and old Safari versions
317
- * are no longer supported.
318
- */
319
- __deprecated__shadowDomShim?: boolean;
320
286
  /**
321
287
  * When a component is first attached to the DOM, this setting will wait a single tick before
322
288
  * rendering. This works around an Angular issue, where Angular attaches the elements before
@@ -221,31 +221,26 @@ const createTime = (e, t = "") => {
221
221
  }, rootAppliedStyles = new WeakMap, registerStyle = (e, t, a) => {
222
222
  let o = styles.get(e);
223
223
  o = t, styles.set(e, o);
224
- }, addStyle = (e, t, a, o) => {
225
- var s;
226
- let n = getScopeId(t, a);
227
- const l = styles.get(n);
228
- if (!appData.BUILD.attachStyles) return n;
229
- if (e = 11 === e.nodeType ? e : doc, l) if ("string" == typeof l) {
224
+ }, addStyle = (e, t, a) => {
225
+ var o;
226
+ const s = getScopeId(t, a), n = styles.get(s);
227
+ if (!appData.BUILD.attachStyles) return s;
228
+ if (e = 11 === e.nodeType ? e : doc, n) if ("string" == typeof n) {
230
229
  e = e.head || e;
231
- let a, r = rootAppliedStyles.get(e);
232
- if (r || rootAppliedStyles.set(e, r = new Set), !r.has(n)) {
233
- if (appData.BUILD.hydrateClientSide && e.host && (a = e.querySelector(`[sty-id="${n}"]`))) a.innerHTML = l; else {
234
- if (appData.BUILD.cssVarShim && plt.$cssShim$) {
235
- a = plt.$cssShim$.createHostStyle(o, n, l, !!(10 & t.$flags$));
236
- const e = a["s-sc"];
237
- e && (n = e, r = null);
238
- } else a = doc.createElement("style"), a.innerHTML = l;
239
- const p = null !== (s = plt.$nonce$) && void 0 !== s ? s : queryNonceMetaTagContent(doc);
240
- null != p && a.setAttribute("nonce", p), (appData.BUILD.hydrateServerSide || appData.BUILD.hotModuleReplacement) && a.setAttribute("sty-id", n),
241
- e.insertBefore(a, e.querySelector("link"));
230
+ let t, a = rootAppliedStyles.get(e);
231
+ if (a || rootAppliedStyles.set(e, a = new Set), !a.has(s)) {
232
+ if (appData.BUILD.hydrateClientSide && e.host && (t = e.querySelector(`[sty-id="${s}"]`))) t.innerHTML = n; else {
233
+ t = doc.createElement("style"), t.innerHTML = n;
234
+ const a = null !== (o = plt.$nonce$) && void 0 !== o ? o : queryNonceMetaTagContent(doc);
235
+ null != a && t.setAttribute("nonce", a), (appData.BUILD.hydrateServerSide || appData.BUILD.hotModuleReplacement) && t.setAttribute("sty-id", s),
236
+ e.insertBefore(t, e.querySelector("link"));
242
237
  }
243
- r && r.add(n);
238
+ a && a.add(s);
244
239
  }
245
- } else appData.BUILD.constructableCSS && !e.adoptedStyleSheets.includes(l) && (e.adoptedStyleSheets = [ ...e.adoptedStyleSheets, l ]);
246
- return n;
240
+ } else appData.BUILD.constructableCSS && !e.adoptedStyleSheets.includes(n) && (e.adoptedStyleSheets = [ ...e.adoptedStyleSheets, n ]);
241
+ return s;
247
242
  }, attachStyles = e => {
248
- const t = e.$cmpMeta$, a = e.$hostElement$, o = t.$flags$, s = createTime("attachStyles", t.$tagName$), n = addStyle(appData.BUILD.shadowDom && exports.supportsShadow && a.shadowRoot ? a.shadowRoot : a.getRootNode(), t, e.$modeName$, a);
243
+ const t = e.$cmpMeta$, a = e.$hostElement$, o = t.$flags$, s = createTime("attachStyles", t.$tagName$), n = addStyle(appData.BUILD.shadowDom && exports.supportsShadow && a.shadowRoot ? a.shadowRoot : a.getRootNode(), t, e.$modeName$);
249
244
  (appData.BUILD.shadowDom || appData.BUILD.scoped) && appData.BUILD.cssAnnotations && 10 & o && (a["s-sc"] = n,
250
245
  a.classList.add(n + "-h"), appData.BUILD.scoped && 2 & o && a.classList.add(n + "-s")),
251
246
  s();
@@ -433,7 +428,7 @@ const createElm = (e, t, a, o) => {
433
428
  appData.BUILD.style && a && attachStyles(e);
434
429
  const r = createTime("render", e.$cmpMeta$.$tagName$);
435
430
  if (appData.BUILD.isDev && (e.$flags$ |= 1024), appData.BUILD.hydrateServerSide ? await callRender(e, t, s) : callRender(e, t, s),
436
- appData.BUILD.cssVarShim && plt.$cssShim$ && plt.$cssShim$.updateHost(s), appData.BUILD.isDev && (e.$renderCount$ = void 0 === e.$renderCount$ ? 1 : e.$renderCount$ + 1,
431
+ appData.BUILD.isDev && (e.$renderCount$ = void 0 === e.$renderCount$ ? 1 : e.$renderCount$ + 1,
437
432
  e.$flags$ &= -1025), appData.BUILD.hydrateServerSide) try {
438
433
  serverSideConnected(s), a && (1 & e.$cmpMeta$.$flags$ ? s["s-en"] = "" : 2 & e.$cmpMeta$.$flags$ && (s["s-en"] = "c"));
439
434
  } catch (e) {
@@ -658,8 +653,7 @@ const callRender = (e, t, a) => {
658
653
  if (0 == (1 & plt.$flags$)) {
659
654
  const t = getHostRef(e), a = appData.BUILD.lazyLoad ? t.$lazyInstance$ : e;
660
655
  appData.BUILD.hostListener && t.$rmListeners$ && (t.$rmListeners$.map((e => e())),
661
- t.$rmListeners$ = void 0), appData.BUILD.cssVarShim && plt.$cssShim$ && plt.$cssShim$.removeHost(e),
662
- appData.BUILD.lazyLoad && appData.BUILD.disconnectedCallback && safeCall(a, "disconnectedCallback"),
656
+ t.$rmListeners$ = void 0), appData.BUILD.lazyLoad && appData.BUILD.disconnectedCallback && safeCall(a, "disconnectedCallback"),
663
657
  appData.BUILD.cmpDidUnload && safeCall(a, "componentDidUnload");
664
658
  }
665
659
  }, proxyCustomElement = (e, t) => {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/internal/testing",
3
- "version": "3.3.0",
3
+ "version": "4.0.0-beta.1",
4
4
  "description": "Rindo internal testing platform to be imported by the Rindo Compiler. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "private": true