Skip to content

Commit

Permalink
feat: remove declarative shadow dom polyfill entirely
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianCataldo committed Aug 6, 2024
1 parent 315ed00 commit 265f400
Show file tree
Hide file tree
Showing 35 changed files with 38 additions and 166 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

<!-- -->



<script>
// REQUEST IDLE CALLBACK - POLYFILL
Expand Down Expand Up @@ -54,8 +53,7 @@
<link rel="icon" type="image/svg" href="/favicon.svg" />

<title>Gracile About</title>
<script type="module" crossorigin src="/assets/index-YV9WDv3j.js"></script>
<link rel="modulepreload" crossorigin href="/assets/document.client-Cca60DWw.js">
<script type="module" crossorigin src="/assets/document.client-CMOVr55R.js"></script>
<link rel="stylesheet" crossorigin href="/assets/document-aADsc6DG.css">
</head>

Expand Down

This file was deleted.

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import"./document.client-CMOVr55R.js";console.log("Hello from client! (Home)");

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import"./document.client-CMOVr55R.js";console.log("Hello from foo/bar client!");

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

<!-- -->



<script>
// REQUEST IDLE CALLBACK - POLYFILL
Expand Down Expand Up @@ -54,8 +53,7 @@
<link rel="icon" type="image/svg" href="/favicon.svg" />

<title>Gracile Contact</title>
<script type="module" crossorigin src="/assets/index-CzX5SsJy.js"></script>
<link rel="modulepreload" crossorigin href="/assets/document.client-Cca60DWw.js">
<script type="module" crossorigin src="/assets/document.client-CMOVr55R.js"></script>
<link rel="stylesheet" crossorigin href="/assets/document-aADsc6DG.css">
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ const routeImports = new Map(
const routeAssets = new Map([
[
"/404.html",
"\t<script type=\"module\" crossorigin src=\"/assets/404-YV9WDv3j.js\"></script>\n\n\t<link rel=\"modulepreload\" crossorigin href=\"/assets/document.client-Cca60DWw.js\">\n\n\t<link rel=\"stylesheet\" crossorigin href=\"/assets/document-aADsc6DG.css\">\n"
"\t<script type=\"module\" crossorigin src=\"/assets/document.client-CMOVr55R.js\"></script>\n\n\t<link rel=\"stylesheet\" crossorigin href=\"/assets/document-aADsc6DG.css\">\n"
],
[
"/about/",
"\t<script type=\"module\" crossorigin src=\"/assets/index-YV9WDv3j.js\"></script>\n\n\t<link rel=\"modulepreload\" crossorigin href=\"/assets/document.client-Cca60DWw.js\">\n\n\t<link rel=\"stylesheet\" crossorigin href=\"/assets/document-aADsc6DG.css\">\n"
"\t<script type=\"module\" crossorigin src=\"/assets/document.client-CMOVr55R.js\"></script>\n\n\t<link rel=\"stylesheet\" crossorigin href=\"/assets/document-aADsc6DG.css\">\n"
],
[
"/api/:path*/",
Expand All @@ -156,35 +156,35 @@ const routeAssets = new Map([
],
[
"/assets-methods/",
"\t<script type=\"module\" crossorigin src=\"/assets/index-M5WC9mrg.js\"></script>\n\n\t<link rel=\"modulepreload\" crossorigin href=\"/assets/document.client-Cca60DWw.js\">\n\n\t<link rel=\"stylesheet\" crossorigin href=\"/assets/document-aADsc6DG.css\">\n"
"\t<script type=\"module\" crossorigin src=\"/assets/document.client-CMOVr55R.js\"></script>\n\n\t<link rel=\"stylesheet\" crossorigin href=\"/assets/document-aADsc6DG.css\">\n"
],
[
"/contact/",
"\t<script type=\"module\" crossorigin src=\"/assets/index-CzX5SsJy.js\"></script>\n\n\t<link rel=\"modulepreload\" crossorigin href=\"/assets/document.client-Cca60DWw.js\">\n\n\t<link rel=\"stylesheet\" crossorigin href=\"/assets/document-aADsc6DG.css\">\n"
"\t<script type=\"module\" crossorigin src=\"/assets/document.client-CMOVr55R.js\"></script>\n\n\t<link rel=\"stylesheet\" crossorigin href=\"/assets/document-aADsc6DG.css\">\n"
],
[
"/foo/bar/",
"\t<script type=\"module\" crossorigin src=\"/assets/index-BE7fdwSI.js\"></script>\n\n\t<link rel=\"modulepreload\" crossorigin href=\"/assets/document.client-Cca60DWw.js\">\n\n\t<link rel=\"stylesheet\" crossorigin href=\"/assets/document-aADsc6DG.css\">\n"
"\t<script type=\"module\" crossorigin src=\"/assets/index-DoNyqiqH.js\"></script>\n\n\t<link rel=\"modulepreload\" crossorigin href=\"/assets/document.client-CMOVr55R.js\">\n\n\t<link rel=\"stylesheet\" crossorigin href=\"/assets/document-aADsc6DG.css\">\n"
],
[
"/",
"\t<script type=\"module\" crossorigin src=\"/assets/index-bQOEfuds.js\"></script>\n\n\t<link rel=\"modulepreload\" crossorigin href=\"/assets/document.client-Cca60DWw.js\">\n\n\t<link rel=\"stylesheet\" crossorigin href=\"/assets/document-aADsc6DG.css\">\n\n\t<link rel=\"stylesheet\" crossorigin href=\"/assets/index-C17FHxsp.css\">\n"
"\t<script type=\"module\" crossorigin src=\"/assets/index-CKZBGRGy.js\"></script>\n\n\t<link rel=\"modulepreload\" crossorigin href=\"/assets/document.client-CMOVr55R.js\">\n\n\t<link rel=\"stylesheet\" crossorigin href=\"/assets/document-aADsc6DG.css\">\n\n\t<link rel=\"stylesheet\" crossorigin href=\"/assets/index-C17FHxsp.css\">\n"
],
[
"/private/",
"\t<script type=\"module\" crossorigin src=\"/assets/index-N2SDIJ_X.js\"></script>\n\n\t<link rel=\"modulepreload\" crossorigin href=\"/assets/document.client-Cca60DWw.js\">\n\n\t<link rel=\"stylesheet\" crossorigin href=\"/assets/document-aADsc6DG.css\">\n"
"\t<script type=\"module\" crossorigin src=\"/assets/document.client-CMOVr55R.js\"></script>\n\n\t<link rel=\"stylesheet\" crossorigin href=\"/assets/document-aADsc6DG.css\">\n"
],
[
"/redirect/",
null
],
[
"/response-init/",
"\t<script type=\"module\" crossorigin src=\"/assets/index-C6DRZtAV.js\"></script>\n\n\t<link rel=\"modulepreload\" crossorigin href=\"/assets/document.client-Cca60DWw.js\">\n\n\t<link rel=\"stylesheet\" crossorigin href=\"/assets/document-aADsc6DG.css\">\n"
"\t<script type=\"module\" crossorigin src=\"/assets/document.client-CMOVr55R.js\"></script>\n\n\t<link rel=\"stylesheet\" crossorigin href=\"/assets/document-aADsc6DG.css\">\n"
],
[
"/throws/",
"\t<script type=\"module\" crossorigin src=\"/assets/index-Bo3GL0oc.js\"></script>\n\n\t<link rel=\"modulepreload\" crossorigin href=\"/assets/document.client-Cca60DWw.js\">\n\n\t<link rel=\"stylesheet\" crossorigin href=\"/assets/document-aADsc6DG.css\">\n"
"\t<script type=\"module\" crossorigin src=\"/assets/document.client-CMOVr55R.js\"></script>\n\n\t<link rel=\"stylesheet\" crossorigin href=\"/assets/document-aADsc6DG.css\">\n"
]
]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@

<!-- -->

<script
type="module"
src="/@id/__x00__/404/index.html?html-proxy&index=2.js"
></script>

<script>
// REQUEST IDLE CALLBACK - POLYFILL

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@

<!-- -->

<script type="module">
// DECLARATIVE SHADOW DOM
import { checkDsd } from "@gracile/gracile/_internals/polyfills/declarative-shadow-dom";
checkDsd();
</script>

<script>
// REQUEST IDLE CALLBACK - POLYFILL

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@

<!-- -->

<script
type="module"
src="/@id/__x00__/about/index.html?html-proxy&index=2.js"
></script>

<script>
// REQUEST IDLE CALLBACK - POLYFILL

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,11 @@
<link rel="icon" type="image/svg" href="/favicon.svg" />

<title>Gracile About</title>
<script type="module" crossorigin src="/assets/index-YV9WDv3j.js"></script>
<link
rel="modulepreload"
<script
type="module"
crossorigin
href="/assets/document.client-Cca60DWw.js"
/>
src="/assets/document.client-CMOVr55R.js"
></script>
<link rel="stylesheet" crossorigin href="/assets/document-aADsc6DG.css" />
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@

<!-- -->

<script
type="module"
src="/@id/__x00__/assets-methods/index.html?html-proxy&index=2.js"
></script>

<script>
// REQUEST IDLE CALLBACK - POLYFILL

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,11 @@
<link rel="icon" type="image/svg" href="/favicon.svg" />

<title>Gracile Assets</title>
<script type="module" crossorigin src="/assets/index-M5WC9mrg.js"></script>

<link
rel="modulepreload"
<script
type="module"
crossorigin
href="/assets/document.client-Cca60DWw.js"
/>
src="/assets/document.client-CMOVr55R.js"
></script>

<link rel="stylesheet" crossorigin href="/assets/document-aADsc6DG.css" />
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@

<!-- -->

<script
type="module"
src="/@id/__x00__/contact/index.html?html-proxy&index=2.js"
></script>

<script>
// REQUEST IDLE CALLBACK - POLYFILL

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,11 @@
<link rel="icon" type="image/svg" href="/favicon.svg" />

<title>Gracile Contact</title>
<script type="module" crossorigin src="/assets/index-CzX5SsJy.js"></script>
<link
rel="modulepreload"
<script
type="module"
crossorigin
href="/assets/document.client-Cca60DWw.js"
/>
src="/assets/document.client-CMOVr55R.js"
></script>
<link rel="stylesheet" crossorigin href="/assets/document-aADsc6DG.css" />
</head>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@

<!-- -->

<script
type="module"
src="/@id/__x00__/index.html?html-proxy&index=2.js"
></script>

<script>
// REQUEST IDLE CALLBACK - POLYFILL

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@
<link rel="icon" type="image/svg" href="/favicon.svg" />

<title>Gracile Home</title>
<script type="module" crossorigin src="/assets/index-bQOEfuds.js"></script>
<script type="module" crossorigin src="/assets/index-CKZBGRGy.js"></script>

<link
rel="modulepreload"
crossorigin
href="/assets/document.client-Cca60DWw.js"
href="/assets/document.client-CMOVr55R.js"
/>

<link rel="stylesheet" crossorigin href="/assets/document-aADsc6DG.css" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
<meta charset="UTF-8" />
<title>Document - With polyfills</title>

<!-- Not well tested enough -->


<!-- -->


Expand Down Expand Up @@ -45,7 +42,7 @@

<!-- /PAGE ASSETS -->

<script type="module" crossorigin src="/assets/index-d4VDqEN4.js"></script>
<script type="module" crossorigin src="/assets/index-B-fhizYj.js"></script>
<link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-B5Qt9EMX.js">
</head>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import"./modulepreload-polyfill-B5Qt9EMX.js";requestIdleCallback(()=>{console.log("REQUEST IDLE CALLBACK PLEASE!")});

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
<meta charset="UTF-8" />
<title>Document - With polyfills</title>

<!-- Not well tested enough -->

<script
type="module"
src="/@id/__x00__/04-polyfills/00-polyfills/index.html?html-proxy&index=0.js"
></script>

<!-- -->

<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ export function document(context: { url: URL }) {
<meta charset="UTF-8" />
<title>Document - With polyfills</title>
<!-- Not well tested enough -->
${helpers.polyfills.declarativeShadowDom}
<!-- -->
${helpers.polyfills.requestIdleCallback}
<!-- -->
Expand Down
5 changes: 1 addition & 4 deletions integration/src/exports.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import test, { describe } from 'node:test';
import { fileURLToPath } from 'node:url';

import * as env from '@gracile/engine/server/env';
import * as dsd from '@gracile/gracile/_internals/polyfills/declarative-shadow-dom';
import * as requestIdleC from '@gracile/gracile/_internals/polyfills/request-idle-callback';
import * as serverRuntime from '@gracile/gracile/_internals/server-runtime';
import * as document from '@gracile/gracile/document';
Expand Down Expand Up @@ -85,9 +84,7 @@ describe('gracile package should do its exports correctly', () => {
test('internals - lit hydrate', () => {
assert.equal('litElementHydrateSupport' in globalThis, true);
});
test('internals - polyfills - dsd', () => {
assert.equal(typeof dsd.checkDsd, 'function');
});

test('internals - polyfills - requestIdleCallback', () => {
assert.equal(typeof requestIdleC.requestIdleCallback, 'string');
});
Expand Down
53 changes: 0 additions & 53 deletions packages/client/src/polyfills/declarative-shadow-dom.ts

This file was deleted.

This file was deleted.

7 changes: 1 addition & 6 deletions packages/server/src/document.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ describe('should exports helpers', () => {
test('pageAssets', () => {
assert.equal(isLitServerTemplate(helpers.pageAssets), true);
});
test('dsd', () => {
assert.equal(
isLitServerTemplate(helpers.polyfills.declarativeShadowDom),
true,
);
});

test('requestIdleCallback', () => {
assert.equal(
isLitServerTemplate(helpers.polyfills.requestIdleCallback),
Expand Down
Loading

0 comments on commit 265f400

Please sign in to comment.