@plitzi/plitzi-builder 0.38.17 → 0.38.19

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/CHANGELOG.md CHANGED
@@ -1,5 +1,125 @@
1
1
  # @plitzi/plitzi-builder
2
2
 
3
+ ## 0.38.19
4
+
5
+ ### Patch Changes
6
+
7
+ - 92a9f1b: ## Security
8
+
9
+ - **The `Origin` fallback tells the ports apart over HTTP/2 too** (`@plitzi/sdk-server`): a browser that sends no
10
+ `Sec-Fetch-Site` (Safari before 16.4, older webviews) is judged by its `Origin`, compared with the authority the
11
+ request was addressed to. HTTP/2 carries no `Host` header — the authority is `:authority` — and the comparison then
12
+ fell back to the host's NAME, so every port and scheme of it counted as this server's own: what 0.38.18 closed for
13
+ `same-site` stayed open there, over TLS, where a Plitzi server speaks HTTP/2. The authority is now `:authority`,
14
+ `Host`, or the `X-Forwarded-Host` a proxy in front wrote — whichever names the host the request is answered as — port
15
+ included; when none does, the origin is not taken as its own. The write guard (`crossSiteWrites`), the sign-in's
16
+ login-CSRF check and `createOriginGuardMiddleware` share it.
17
+
18
+ ## Packages
19
+ - **The server evaluates rules without the query editor** (`@plitzi/sdk-shared`, `@plitzi/sdk-auth`,
20
+ `@plitzi/sdk-elements`, `@plitzi/sdk-interactions`, `@plitzi/plitzi-builder`): every evaluation of a `when` rule
21
+ group imports `QueryBuilderEvaluator` from `@plitzi/plitzi-ui/QueryBuilder/evaluator` — the evaluator alone — instead
22
+ of the `QueryBuilder` barrel, which brings the editor's React components, or `QueryBuilder/helpers`, which brings the
23
+ SQL and MongoDB formatters. `@plitzi/sdk-shared/helpers` reads `get` and `omit` from `@plitzi/plitzi-ui/helpers/lodash`.
24
+ Importing `@plitzi/sdk-server` loads 19 modules of `@plitzi/plitzi-ui` (26 before) and neither
25
+ `class-variance-authority` nor `clsx`, and starts in ~125 ms (~150 before). Needs `@plitzi/plitzi-ui` 1.6.34.
26
+
27
+ - Updated dependencies [92a9f1b]
28
+ - @plitzi/plitzi-sdk@0.38.19
29
+ - @plitzi/sdk-auth@0.38.19
30
+ - @plitzi/sdk-authoring@0.38.19
31
+ - @plitzi/sdk-dev-tools@0.38.19
32
+ - @plitzi/sdk-elements@0.38.19
33
+ - @plitzi/sdk-event-bridge@0.38.19
34
+ - @plitzi/sdk-interactions@0.38.19
35
+ - @plitzi/sdk-navigation@0.38.19
36
+ - @plitzi/sdk-plugins@0.38.19
37
+ - @plitzi/sdk-schema@0.38.19
38
+ - @plitzi/sdk-shared@0.38.19
39
+ - @plitzi/sdk-style@0.38.19
40
+ - @plitzi/sdk-variables@0.38.19
41
+
42
+ ## 0.38.18
43
+
44
+ ### Patch Changes
45
+
46
+ - b3023c9: ## Security
47
+
48
+ - **A page of the same site on another origin is no longer this server's own** (`@plitzi/sdk-server`): the guard
49
+ against writes another page caused (`crossSiteWrites`, the sign-in's login-CSRF check and `createOriginGuardMiddleware`)
50
+ trusted `Sec-Fetch-Site: same-site` — and a site has no port and spans every sub-domain, so another port of the host
51
+ (where `createAuthoringHost` serves pages an agent wrote) or a sibling sub-domain (every space of a platform on one
52
+ domain) could write as if it were the server's own page. Now only `same-origin` (and `none`, a typed URL) is; `same-site`
53
+ is refused 403 `reason: 'foreign'` unless its origin is named (`crossSiteWrites.origins`, `identity.platformOrigins`),
54
+ and the `Origin` fallback compares host and port. In production an app and its spaces are already on different sites,
55
+ so a deployment that works there needs nothing; one that relied on a sibling sub-domain locally names it.
56
+ `createAuthoringHost`'s docs now say to serve on a host of its own — a cookie belongs to a host whatever its port.
57
+
58
+ ## Server
59
+ - **An open page takes a new version of its space where it stands** (`@plitzi/sdk-server`, `@plitzi/plitzi-sdk`):
60
+ `server.updatePages(documents, { draft? })` hands the pages showing that space — or that draft — its new documents,
61
+ and each swaps them in place, its state, scroll and focus kept (`replaceSpace` on what the SDK's `render` returns;
62
+ `false`, and the page loads again, for a page with elements the server draws). The development loop of a project uses
63
+ it: a save to the space no longer reloads the open page. `createAuthoringHost`'s `put` over an id that pages show
64
+ hands them the new version and answers how many took it (`updated`), so a page an agent keeps improving is seen to
65
+ grow instead of reloading — no second iframe needed.
66
+ - **`devReload` is `livePages`** (`@plitzi/sdk-server`): the channel the open pages listen on now carries the space,
67
+ not only "load again", and a host that is not developing uses it too. Its address is `/__plitzi/live`; a draft's page
68
+ listens for its own changes alone (`?__pt=`). A plugin swapped where it is drawn stays a development server's
69
+ (`devMode`). `plitzi upgrade migrations --write` renames the option in a project's code (`livePagesOption`).
70
+
71
+ ## Packages
72
+ - **`@plitzi/sdk-server` starts in half the time** (`@plitzi/sdk-shared`, `@plitzi/sdk-server`): importing it took
73
+ ~310 ms, ~200 of them `date-fns` — 108 modules nothing on the server uses, brought by `@plitzi/sdk-shared/helpers` —
74
+ and loaded the browser's hooks and contexts of every folder of `@plitzi/sdk-shared` it read, `@plitzi/nexus/react`
75
+ with them. Now ~150 ms (`@plitzi/sdk-shared` 139 → 113 modules, `@plitzi/nexus` 53 → 31). What moved, each
76
+ rewritten by `plitzi upgrade migrations --write` (`movedExports`):
77
+ - the dates — `formatDate`, `formatDateUTC`, `formatFromNow`, `formatUTCToLocal`, `getDurationMs`, `isDate`,
78
+ `isValidFormat`, `parseDate`, `toUnixSeconds`, `SupportedLocale` — from `@plitzi/sdk-shared/helpers` to
79
+ `@plitzi/sdk-shared/dates`;
80
+ - React's bindings to an entry of their own beside each area, as `@plitzi/nexus/react` is: `useDisplayMode`,
81
+ `useElementSize` → `@plitzi/sdk-shared/style/react`; `SchemaContext` → `schema/react`; `PluginsContext` →
82
+ `plugins/react`; `DevToolsContext` → `devTools/react`; `useFlagResolution` → `flags/react` (`flagUserFrom` stays
83
+ in `flags`);
84
+ - `PROJECT_DATA_PREFIX` from `@plitzi/sdk-shared/server` to `@plitzi/sdk-shared/project/paths` — the project's
85
+ layout names, an entry a browser imports too (`@plitzi/sdk-shared/project` stays Node only and re-exports them).
86
+ The theme cookie's helpers (`themeFromCookies`…) are also `@plitzi/sdk-shared/theme/cookie`, still exported by
87
+ `@plitzi/sdk-shared/theme`.
88
+
89
+ `yarn check:server-footprint` (in CI after the build) holds what the server's root loads, package by package — Plitzi's
90
+ and every other — to a budget: a heavy library or a folder of hooks coming back fails with what came in.
91
+
92
+ ## CLI
93
+ - **`plitzi upgrade migrations --write` writes a file import's new home when it has one** (`@plitzi/cli`): the
94
+ `folderImports` migration of 0.38.17 named every import of a package's FILE and wrote none. It now reads the installed
95
+ declarations with the project's own TypeScript and rewrites each `import` / `export … from` whose every name the folder
96
+ exports under one name — `import usePlitzi from '@plitzi/sdk-shared/hooks/usePlitzi'` →
97
+ `import { usePlitzi } from '@plitzi/sdk-shared/hooks'`, `type` modifiers and aliases kept. What has no one answer is
98
+ said with why (a namespace import, an `import()` or mock, a name the folder does not export, a project with no
99
+ TypeScript). The report says which places `--write` writes (`writable` in `--json`) instead of calling every one
100
+ "yours to change"; a migration now gives each place its own `edit` in place of a whole-file `rewrite`
101
+ (`docs/en/releases.md`).
102
+ - **`plitzi doctor` says an import of a path the installed package does not export** (`@plitzi/cli`):
103
+ `import-not-exported`, an error, at the importing file — what Node otherwise reports at start as an
104
+ `ERR_MODULE_NOT_FOUND` into the package's `dist`, which reads as a broken install rather than a changed API. For a
105
+ `@plitzi` package the fix names `plitzi upgrade migrations --write`; for any other, its `exports`. Asked only of a
106
+ package that is installed.
107
+
108
+ - Updated dependencies [b3023c9]
109
+ - @plitzi/plitzi-sdk@0.38.18
110
+ - @plitzi/sdk-auth@0.38.18
111
+ - @plitzi/sdk-authoring@0.38.18
112
+ - @plitzi/sdk-dev-tools@0.38.18
113
+ - @plitzi/sdk-elements@0.38.18
114
+ - @plitzi/sdk-event-bridge@0.38.18
115
+ - @plitzi/sdk-interactions@0.38.18
116
+ - @plitzi/sdk-navigation@0.38.18
117
+ - @plitzi/sdk-plugins@0.38.18
118
+ - @plitzi/sdk-schema@0.38.18
119
+ - @plitzi/sdk-shared@0.38.18
120
+ - @plitzi/sdk-style@0.38.18
121
+ - @plitzi/sdk-variables@0.38.18
122
+
3
123
  ## 0.38.17
4
124
 
5
125
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "@plitzi/plitzi-builder",
3
- "version": "0.38.17",
3
+ "version": "0.38.19",
4
4
  "homepage": "./",
5
5
  "license": "AGPL-3.0",
6
6
  "files": [
@@ -34,7 +34,7 @@ declare const _default: {
34
34
  "@fortawesome/fontawesome-free": "^7.3.1",
35
35
  "@plitzi/nexus": "^1.4.0",
36
36
  "@plitzi/plitzi-sdk": "workspace:*",
37
- "@plitzi/plitzi-ui": "^1.6.33",
37
+ "@plitzi/plitzi-ui": "^1.6.34",
38
38
  "@plitzi/sdk-auth": "workspace:*",
39
39
  "@plitzi/sdk-authoring": "workspace:*",
40
40
  "@plitzi/sdk-dev-tools": "workspace:*",