diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml
index ff8b44e35..dbc3a46d1 100644
--- a/.github/workflows/node.js.yml
+++ b/.github/workflows/node.js.yml
@@ -1,5 +1,36 @@
-# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
-# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
+# # This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
+# # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
+
+# name: Node.js CI
+
+# on:
+# push:
+# branches: [next]
+# pull_request:
+# branches: [next]
+
+# jobs:
+# build:
+# runs-on: ubuntu-latest
+
+# strategy:
+# matrix:
+# node-version: [20.x]
+# # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
+
+# steps:
+# - uses: actions/checkout@v4
+# - name: Use Node.js ${{ matrix.node-version }}
+# uses: actions/setup-node@v4
+# with:
+# node-version: ${{ matrix.node-version }}
+# cache: 'npm'
+# - run: npm ci
+# - run: npx playwright install-deps
+# - run: npm run verify
+
+# # This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
+# # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
@@ -10,21 +41,61 @@ on:
branches: [next]
jobs:
- build:
+ lint:
runs-on: ubuntu-latest
strategy:
matrix:
- node-version: [18.x]
+ node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@v3
+ uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- - run: npx playwright install-deps
- run: npm ci
- - run: npm run verify
+ - run: npm run prettier && npm run lint
+
+ test_client:
+ runs-on: ubuntu-latest
+
+ strategy:
+ matrix:
+ node-version: [20.x]
+ # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
+
+ steps:
+ - uses: actions/checkout@v4
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v4
+ with:
+ node-version: ${{ matrix.node-version }}
+ cache: 'npm'
+ - run: npm ci
+ - run: npx playwright uninstall --all && npx playwright install --force chromium firefox webkit --with-deps
+ - run: npm run build
+ # --bail to fail on first failing test.
+ - run: CSR_ONLY="true" npm run test -- --bail
+
+ test_ssr:
+ runs-on: ubuntu-latest
+
+ strategy:
+ matrix:
+ node-version: [20.x]
+ # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
+
+ steps:
+ - uses: actions/checkout@v4
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v4
+ with:
+ node-version: ${{ matrix.node-version }}
+ cache: 'npm'
+ - run: npm ci
+ - run: npx playwright uninstall --all && npx playwright install --force chromium firefox webkit --with-deps
+ - run: npm run build
+ - run: SSR_ONLY="true" npm run test -- --bail
diff --git a/.gitignore b/.gitignore
index aa943f40d..b5bb02845 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,9 +3,10 @@ _site
.DS_Store
package.json
package-lock.json
-dist
+dist/
+dist-cdn/
docs/public/pagefind
node_modules
src/react
-cdn
.astro
+cdn/
diff --git a/custom-elements-manifest.js b/custom-elements-manifest.js
index cdf80b9d6..2c1853295 100644
--- a/custom-elements-manifest.js
+++ b/custom-elements-manifest.js
@@ -7,7 +7,7 @@ import fs from 'fs';
const packageData = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
const { name, description, version, author, homepage, license } = packageData;
-const outdir = 'dist';
+const outdir = 'dist-cdn';
function replace(string, terms) {
terms.forEach(({ from, to }) => {
@@ -162,7 +162,7 @@ export default {
}),
customElementJetBrainsPlugin({
- outdir: './dist',
+ outdir: './dist-cdn',
excludeCss: true,
packageJson: false,
referencesTemplate: (_, tag) => {
diff --git a/docs/.eleventy.js b/docs/.eleventy.js
index fe807b788..1630652d7 100644
--- a/docs/.eleventy.js
+++ b/docs/.eleventy.js
@@ -11,6 +11,8 @@ import { searchPlugin } from './_utils/search.js';
import { readFile } from 'fs/promises';
import { outlinePlugin } from './_utils/outline.js';
import { getComponents } from './_utils/manifest.js';
+import litPlugin from '@lit-labs/eleventy-plugin-lit';
+
import process from 'process';
const packageData = JSON.parse(await readFile('./package.json', 'utf-8'));
@@ -106,6 +108,26 @@ export default function (eleventyConfig) {
])
);
+ const omittedModules = [];
+
+ // problematic components:
+ // animation (breaks on navigation + ssr with Turbo)
+ // mutation-observer (why SSR this?)
+ // resize-observer (why SSR this?)
+ // tooltip (why SSR this?)
+
+ const componentModules = getComponents()
+ // .filter(component => !omittedModules.includes(component.tagName.split(/wa-/)[1]))
+ .map(component => {
+ const name = component.tagName.split(/wa-/)[1];
+ return `./dist/components/${name}/${name}.js`;
+ });
+
+ eleventyConfig.addPlugin(litPlugin, {
+ mode: 'worker',
+ componentModules
+ });
+
// Build the search index
eleventyConfig.addPlugin(
searchPlugin({
diff --git a/docs/_includes/base.njk b/docs/_includes/base.njk
index 95c2722ae..6ecbedfb2 100644
--- a/docs/_includes/base.njk
+++ b/docs/_includes/base.njk
@@ -13,6 +13,9 @@
{# Scripts #}
+ {# Hydration stuff #}
+
+
@@ -26,7 +29,7 @@
{# Web Awesome #}
-
+
@@ -128,5 +131,6 @@
{% include 'search.njk' %}
+