@plone/aurora 1.0.0-alpha.15 → 1.0.0-alpha.16

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/.release-it.json CHANGED
@@ -4,8 +4,8 @@
4
4
  },
5
5
  "hooks": {
6
6
  "after:bump": [
7
- "pipx run towncrier build --draft --yes --version ${version} > .changelog.draft",
8
- "pipx run towncrier build --yes --version ${version}"
7
+ "uvx towncrier build --draft --yes --version ${version} > .changelog.draft",
8
+ "uvx towncrier build --yes --version ${version}"
9
9
  ],
10
10
  "after:release": [
11
11
  "rm .changelog.draft",
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "git": {
19
19
  "commitArgs": ["--no-verify"],
20
- "changelog": "pipx run towncrier build --draft --yes --version 0.0.0",
20
+ "changelog": "uvx towncrier build --draft --yes --version 0.0.0",
21
21
  "requireUpstream": false,
22
22
  "requireCleanWorkingDir": false,
23
23
  "commitMessage": "Releasing @plone/aurora ${version}",
package/CHANGELOG.md CHANGED
@@ -8,6 +8,29 @@
8
8
 
9
9
  <!-- towncrier release notes start -->
10
10
 
11
+ ## 1.0.0-alpha.16 (2026-10-03)
12
+
13
+ ### Bugfix
14
+
15
+ - Fixed the server not loading the translations, which made it render raw message keys and React replace the whole server-rendered page on hydration. @sneridagh
16
+
17
+ ### Internal
18
+
19
+ - Added nightly Playwright visual regression tests for native blocks and editor overlays, with baselines stored in the `plone/aurora-visual-regression` repository and a protected workflow to update the screenshots. @sneridagh
20
+ - Cached the Playwright browsers in CI, and stopped installing their system dependencies with apt, which was sometimes very slow. @sneridagh
21
+ - Import icons from `@plone/icons`. Depend on `@plone/quanta` and pre-bundle its dependencies. @pnicolli
22
+ - Sped up CI: superseded runs on branches and pull requests are cancelled, the format and style checks skip building the packages, and the `@plone/client` unit tests no longer install Playwright. @sneridagh
23
+ - Split the Playwright acceptance tests in CI across 3 shards, and merge their reports into a single HTML report. @sneridagh
24
+ - The `release` scripts of all the packages now take the GitHub token from `gh auth token` when `GITHUB_TOKEN` is not set. @sneridagh
25
+ - The release configuration of all the packages now runs `towncrier` with `uvx` instead of `pipx`. @sneridagh
26
+ - Updated `actions/checkout` to v7 and `JarvusInnovations/background-action` to v2 in the visual regression workflows. @sneridagh
27
+
28
+ ### Documentation
29
+
30
+ - Added the "How to make a Plone Aurora release" documentation page, with the release requirements and the `prereleaser` workflow. @sneridagh
31
+ - Documented how to upgrade existing add-ons for the split of `@plone/components` into `@plone/quanta` and `@plone/icons`. @sneridagh
32
+ - Documented the visual regression tests: how to run them, review a failure and update the baseline screenshots, and how maintainers set up the GitHub infrastructure. @sneridagh
33
+
11
34
  ## 1.0.0-alpha.15 (2026-10-01)
12
35
 
13
36
  ### Internal
@@ -0,0 +1,105 @@
1
+ import { expect, test } from '../../../../packages/tooling/playwright/test';
2
+ import type { Page } from '@playwright/test';
3
+ import { PLONE_BLOCK_TYPE } from '@plone/helpers';
4
+ import { createContent } from '../../../../packages/tooling/playwright/content';
5
+
6
+ // If the server and client renders differ, React discards the server-rendered
7
+ // DOM on hydration and renders it again on the client. Any element a test (or
8
+ // script) grabbed before that is then detached and measures 0x0.
9
+
10
+ const PAGE_ID = 'hydration-page';
11
+ const IMAGE_ID = 'hydration-image';
12
+
13
+ async function setupImageBlockPage(page: Page) {
14
+ await createContent(page, {
15
+ contentType: 'Image',
16
+ contentId: IMAGE_ID,
17
+ contentTitle: 'Hydration image',
18
+ image: {
19
+ sourceFilename: 'halfdome2022.jpg',
20
+ filename: 'halfdome2022.jpg',
21
+ 'content-type': 'image/jpeg',
22
+ },
23
+ });
24
+ await createContent(page, {
25
+ contentType: 'Document',
26
+ contentId: PAGE_ID,
27
+ contentTitle: 'Hydration page',
28
+ transition: 'publish',
29
+ bodyModifier: (body) => ({
30
+ ...body,
31
+ blocks: {
32
+ __somersault__: {
33
+ '@type': '__somersault__',
34
+ value: [
35
+ { type: 'title', children: [{ text: 'Hydration page' }] },
36
+ { type: 'p', children: [{ text: 'Text before image' }] },
37
+ {
38
+ type: PLONE_BLOCK_TYPE,
39
+ '@type': 'image',
40
+ url: `/${IMAGE_ID}`,
41
+ align: 'left',
42
+ size: 'l',
43
+ blockWidth: 'default',
44
+ children: [{ text: '' }],
45
+ },
46
+ { type: 'p', children: [{ text: 'Text after image' }] },
47
+ ],
48
+ },
49
+ },
50
+ }),
51
+ });
52
+ }
53
+
54
+ test.describe('Hydration', () => {
55
+ test('the server renders translated messages', async ({ page }) => {
56
+ const html = await (await page.request.get('/')).text();
57
+ expect(
58
+ html.includes('layout.slots.headertools.anonymousTools.login'),
59
+ 'the server rendered a raw message key',
60
+ ).toBe(false);
61
+ expect(html.includes('>Log In<'), 'the server rendered "Log In"').toBe(
62
+ true,
63
+ );
64
+ });
65
+
66
+ test('the server-rendered image block survives hydration', async ({
67
+ page,
68
+ }) => {
69
+ await setupImageBlockPage(page);
70
+
71
+ // Keep a reference to the server-rendered node, before React hydrates.
72
+ await page.addInitScript(() => {
73
+ document.addEventListener('DOMContentLoaded', () => {
74
+ (window as any).__ssrImageBlock =
75
+ document.querySelector('.image-block');
76
+ });
77
+ });
78
+ await page.goto(`/${PAGE_ID}`);
79
+
80
+ // Wait until React owns the current `.image-block`, i.e. hydration (or a
81
+ // client re-render after a failed hydration) has finished.
82
+ await expect
83
+ .poll(() =>
84
+ page.evaluate(() => {
85
+ const el = document.querySelector('.image-block');
86
+ return (
87
+ !!el && Object.keys(el).some((k) => k.startsWith('__reactFiber'))
88
+ );
89
+ }),
90
+ )
91
+ .toBe(true);
92
+
93
+ const result = await page.evaluate(() => {
94
+ const ssr = (window as any).__ssrImageBlock as HTMLElement | null;
95
+ return {
96
+ found: !!ssr,
97
+ connected: !!ssr?.isConnected,
98
+ same: ssr === document.querySelector('.image-block'),
99
+ width: ssr?.getBoundingClientRect().width ?? 0,
100
+ };
101
+ });
102
+ expect(result).toMatchObject({ found: true, connected: true, same: true });
103
+ expect(result.width).toBeGreaterThan(0);
104
+ });
105
+ });
@@ -1,9 +1,22 @@
1
1
  import Backend from 'i18next-fs-backend/cjs';
2
- import { resolve } from 'node:path';
2
+ import { fileURLToPath } from 'node:url';
3
3
  import { initReactI18next } from 'react-i18next';
4
4
  import { createI18nextMiddleware } from 'remix-i18next';
5
5
  import i18n from './i18n'; // your i18n configuration file
6
6
 
7
+ // The add-on locales are generated into `public/locales`, which the build copies
8
+ // to `build/client/locales`. Resolve them relative to this module, not the
9
+ // working directory: in development it is `app/i18next.server.ts`, in
10
+ // production the server bundle `build/server/index.js`. If the server can't
11
+ // load them, it renders the raw message keys, the client renders the
12
+ // translations, and React discards the server-rendered DOM on hydration.
13
+ const localesPath = fileURLToPath(
14
+ new URL(
15
+ import.meta.env.PROD ? '../client/locales/' : '../public/locales/',
16
+ import.meta.url,
17
+ ),
18
+ );
19
+
7
20
  export const [i18nextMiddleware, getLocale, getInstance] =
8
21
  createI18nextMiddleware({
9
22
  detection: {
@@ -17,7 +30,7 @@ export const [i18nextMiddleware, getLocale, getInstance] =
17
30
  fallbackLng: i18n.fallbackLng as string,
18
31
  ns: i18n.defaultNS,
19
32
  backend: {
20
- loadPath: resolve('../locales/{{lng}}/{{ns}}.json'),
33
+ loadPath: `${localesPath}{{lng}}/{{ns}}.json`,
21
34
  },
22
35
  },
23
36
  // The i18next plugins the middleware's instance uses.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@plone/aurora",
3
3
  "description": "Plone Aurora is the next-generation frontend for Plone CMS",
4
- "version": "1.0.0-alpha.15",
4
+ "version": "1.0.0-alpha.16",
5
5
  "maintainers": [
6
6
  {
7
7
  "name": "Plone Foundation",
@@ -45,19 +45,21 @@
45
45
  "react-i18next": "^15.4.1",
46
46
  "react-router": "8.2.0",
47
47
  "remix-i18next": "^8.0.0",
48
- "@plone/agave": "1.0.0-alpha.7",
49
- "@plone/blocks": "1.0.0-alpha.16",
50
- "@plone/components": "5.0.0-alpha.4",
51
- "@plone/client": "2.0.0-alpha.7",
52
- "@plone/contents": "1.0.0-alpha.2",
53
- "@plone/helpers": "2.0.0-alpha.8",
54
- "@plone/plate": "1.0.0-alpha.21",
55
- "@plone/cmsui": "1.0.0-alpha.10",
56
- "@plone/publicui": "1.0.0-alpha.7",
57
- "@plone/layout": "1.0.0-alpha.12",
58
- "@plone/react-router": "2.0.0-alpha.6",
59
- "@plone/registry": "4.0.0-alpha.3",
60
- "@plone/theming": "1.0.0-alpha.7"
48
+ "@plone/agave": "1.0.0-alpha.8",
49
+ "@plone/blocks": "1.0.0-alpha.17",
50
+ "@plone/client": "2.0.0-alpha.8",
51
+ "@plone/cmsui": "1.0.0-alpha.11",
52
+ "@plone/components": "5.0.0-alpha.5",
53
+ "@plone/helpers": "2.0.0-alpha.9",
54
+ "@plone/contents": "1.0.0-alpha.3",
55
+ "@plone/plate": "1.0.0-alpha.22",
56
+ "@plone/layout": "1.0.0-alpha.13",
57
+ "@plone/registry": "4.0.0-alpha.4",
58
+ "@plone/publicui": "1.0.0-alpha.8",
59
+ "@plone/react-router": "2.0.0-alpha.7",
60
+ "@plone/theming": "1.0.0-alpha.8",
61
+ "@plone/icons": "1.0.0-alpha.1",
62
+ "@plone/quanta": "1.0.0-alpha.1"
61
63
  },
62
64
  "devDependencies": {
63
65
  "@babel/core": "^7.28.5",
@@ -78,7 +80,7 @@
78
80
  "vite-plugin-babel": "1.7.3",
79
81
  "vite-plugin-devtools-json": "^1.0.0",
80
82
  "vitest": "^4.1.0",
81
- "@plone/types": "3.0.0-alpha.6"
83
+ "@plone/types": "3.0.0-alpha.7"
82
84
  },
83
85
  "engines": {
84
86
  "node": ">=22.22.0"
@@ -94,8 +96,8 @@
94
96
  "check:ts": "react-router typegen && tsc",
95
97
  "typecheck": "react-router typegen && tsc",
96
98
  "typegen": "react-router typegen",
97
- "release": "release-it",
98
- "release-alpha": "release-it --preRelease=alpha",
99
+ "release": "GITHUB_TOKEN=${GITHUB_TOKEN:-$(gh auth token)} release-it",
100
+ "release-alpha": "GITHUB_TOKEN=${GITHUB_TOKEN:-$(gh auth token)} release-it --preRelease=alpha",
99
101
  "prettier:fix": "prettier --write '**/*.{js,jsx,ts,tsx}'",
100
102
  "lint:fix": "eslint --max-warnings=0 './**/*.{js,jsx,ts,tsx}' --fix --no-error-on-unmatched-pattern",
101
103
  "stylelint:fix": "sh -c 'if [ -f .stylelintrc ] || [ -f .stylelintrc.json ] || [ -f .stylelintrc.js ] || [ -f .stylelintrc.cjs ] || [ -f stylelint.config.js ] || [ -f stylelint.config.cjs ] || [ -f stylelint.config.mjs ]; then stylelint '''./**/*.{css,scss,less}''' --fix --allow-empty-input; else echo \"No local stylelint config, skipping\"; fi'",
package/tsconfig.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "exclude": ["packages/*"],
12
12
  "compilerOptions": {
13
13
  "lib": ["DOM", "DOM.Iterable", "ES2022"],
14
- "types": ["@react-router/node", "vite/client", "@plone/components/icons"],
14
+ "types": ["@react-router/node", "vite/client", "@plone/icons/svg"],
15
15
  "isolatedModules": true,
16
16
  "esModuleInterop": true,
17
17
  "jsx": "react-jsx",
package/vite.config.ts CHANGED
@@ -2,7 +2,7 @@ import { reactRouter } from '@react-router/dev/vite';
2
2
  import path from 'node:path';
3
3
  import { defineConfig, PluginOption } from 'vite';
4
4
  import { PloneRegistryVitePlugin } from '@plone/registry/vite-plugin';
5
- import { PloneSVGRVitePlugin } from '@plone/components/vite-plugin-svgr';
5
+ import { PloneSVGRVitePlugin } from '@plone/icons/vite-plugin-svgr';
6
6
  import applyAddonViteConfiguration from './.plone/vite.loader.js';
7
7
  import babel from 'vite-plugin-babel';
8
8
  import tailwindcss from '@tailwindcss/vite';
@@ -62,24 +62,32 @@ export default defineConfig(({ command, mode, isSsrBuild }) => {
62
62
  'react-i18next',
63
63
  // Injected by babel-plugin-react-compiler, not in any package.json
64
64
  'react/compiler-runtime',
65
- // @plone/components and @plone/helpers are not registered add-ons, so
66
- // their deps can't be declared in vite.extend.js — list them here
67
- '@plone/components > @internationalized/date',
68
- '@plone/components > @react-aria/utils',
69
- '@plone/components > @react-spectrum/utils',
65
+ // @plone/components, @plone/icons, @plone/quanta and @plone/helpers are
66
+ // not registered add-ons, so their deps can't be declared in
67
+ // vite.extend.js — list them here
70
68
  '@plone/components > clsx',
71
69
  '@plone/components > react-aria',
72
70
  '@plone/components > react-aria-components',
73
71
  '@plone/components > react-aria-components/DropZone',
74
- '@plone/components > react-aria-components/Form',
75
- '@plone/components > react-aria-components/Group',
76
- '@plone/components > react-aria-components/Modal',
77
- '@plone/components > react-aria-components/Table',
78
- '@plone/components > react-aria-components/Tooltip',
79
- '@plone/components > react-aria-components/composeRenderProps',
80
- '@plone/components > react-stately',
81
- '@plone/components > tailwind-merge',
82
- '@plone/components > tailwind-variants',
72
+ '@plone/icons > @react-aria/utils',
73
+ '@plone/icons > @react-spectrum/utils',
74
+ '@plone/icons > clsx',
75
+ '@plone/icons > tailwind-variants',
76
+ '@plone/quanta > @internationalized/date',
77
+ '@plone/quanta > @react-aria/utils',
78
+ '@plone/quanta > clsx',
79
+ '@plone/quanta > react-aria',
80
+ '@plone/quanta > react-aria-components',
81
+ '@plone/quanta > react-aria-components/DropZone',
82
+ '@plone/quanta > react-aria-components/Form',
83
+ '@plone/quanta > react-aria-components/Group',
84
+ '@plone/quanta > react-aria-components/Modal',
85
+ '@plone/quanta > react-aria-components/Table',
86
+ '@plone/quanta > react-aria-components/Tooltip',
87
+ '@plone/quanta > react-aria-components/composeRenderProps',
88
+ '@plone/quanta > react-stately',
89
+ '@plone/quanta > tailwind-merge',
90
+ '@plone/quanta > tailwind-variants',
83
91
  '@plone/helpers > jotai',
84
92
  '@plone/helpers > jotai/utils',
85
93
  '@plone/helpers > jotai-optics',