@smart-cloud/publisher-exporter 1.1.83 → 1.1.84

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/README.md CHANGED
@@ -4,8 +4,66 @@
4
4
 
5
5
  It is designed to run outside WordPress. The WordPress plugin only manages runtime config, queue state, and logs.
6
6
 
7
+ ## Runtime asset declarations
8
+
9
+ Client components can declare assets before their JavaScript initializes. This
10
+ is especially useful for stylesheets loaded exclusively inside shadow roots.
11
+ An inert JSON script exposes dependencies without fetching them or applying
12
+ styles to the document:
13
+
14
+ ```html
15
+ <script type="application/json" data-static-export-assets>
16
+ {"schemaVersion":1,"assets":["/assets/shadow-ui.css","/assets/ui.woff2"]}
17
+ </script>
18
+ ```
19
+
20
+ Local and delegated rendering read this declaration even when JavaScript is
21
+ disabled or the component has not mounted. URLs are resolved against the page
22
+ URL and pass the normal asset host/path policies. Assets enter the crawl
23
+ manifest and deployment plan through the same download pipeline as ordinary
24
+ HTML dependencies; CSS imports and fonts are discovered recursively. No
25
+ plugin names or customer-specific asset lists are required by the exporter.
26
+
27
+ WordPress producers should use `wp_json_encode` with `JSON_HEX_TAG`,
28
+ `JSON_HEX_AMP`, `JSON_HEX_APOS`, and `JSON_HEX_QUOT`, then emit the declaration
29
+ through `wp_print_inline_script_tag` with the attributes shown above. Do not
30
+ HTML-escape the JSON body: its JSON escapes are decoded by the crawler and
31
+ preserve the exact URL, including query separators. Keep declarations outside
32
+ client-owned mount containers so browser-runtime cleanup cannot remove them.
33
+ The published component still loads its styles into its own shadow root.
34
+
35
+ Multiple declarations are supported and deduplicated. Missing declarations do
36
+ not change ordinary discovery. Malformed declarations fail rendering instead
37
+ of silently dropping dependencies. Deploy the supporting exporter to both the
38
+ coordinator and delegated workers before relying on these declarations, purge
39
+ stale source page caches, and recrawl affected pages to update existing
40
+ manifests. The declaration does not require longer render readiness waits.
41
+
7
42
  ## Release notes
8
43
 
44
+ ### 1.1.84
45
+
46
+ - Discover explicitly declared runtime assets from inert `application/json`
47
+ scripts marked `data-static-export-assets`, both in local crawls (including
48
+ JavaScript-disabled crawls) and delegated render workers. CSS and its imports
49
+ and fonts enter the ordinary asset manifest and deploy pipeline without
50
+ applying shadow-only styles to the document or extending readiness waits.
51
+ - Preserve exact URLs after JSON escaping, including query separators and
52
+ Unicode. Validate the declaration schema and retain the ordinary asset
53
+ host/path restrictions; malformed declarations fail rather than silently
54
+ losing dependencies.
55
+ - Replace `fast-glob` with native filesystem enumeration for crawl cleanup,
56
+ rewrite and deployment. Remove the vulnerable `fast-glob -> micromatch ->
57
+ braces` production dependency chain while retaining dotfiles and symlink
58
+ aliases and preventing traversal cycles.
59
+
60
+ Update the external coordinator and delegated worker image to `1.1.84` before
61
+ relying on producer declarations. Install the corresponding Flow, Gatey and AI
62
+ Kit plugin updates when released, purge stale source page caches, and recrawl
63
+ affected pages (or run a full publish) so existing manifests gain the missing
64
+ runtime assets. No Static Publisher WordPress plugin change or new CDK resource
65
+ is required for this feature. Existing ordinary asset discovery is unchanged.
66
+
9
67
  ### 1.1.82
10
68
 
11
69
  - Buffer cross-account S3 upload streams into 64 KiB chunks before the AWS SDK applies streaming checksums. This prevents real HTML and asset bodies from failing with `Only the last chunk is allowed to have a size less than 8192 bytes` while preserving bounded streaming instead of loading complete objects into Lambda memory.