@adobe/helix-rum-enhancer 2.51.1 → 2.53.0

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.
@@ -0,0 +1,18 @@
1
+ # [2.53.0](https://github.com/adobe/helix-rum-enhancer/compare/v2.52.0...v2.53.0) (2026-11-26)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **ci:** fail the backfill workflow when the script refuses ([2003f4b](https://github.com/adobe/helix-rum-enhancer/commit/2003f4b547399ac7fdcc8be65360d34e79ff08ab))
7
+ * **ci:** isolate branch CI and make publishing pause explicit ([#637](https://github.com/adobe/helix-rum-enhancer/issues/637)) ([f847e24](https://github.com/adobe/helix-rum-enhancer/commit/f847e249d6488aa081803a2ae1266335c0b226d6))
8
+ * **ci:** publish releases without a bot account ([#640](https://github.com/adobe/helix-rum-enhancer/issues/640)) ([748b7a2](https://github.com/adobe/helix-rum-enhancer/commit/748b7a29e809faf452ae2b128dfa32d322859274))
9
+ * **ci:** push release branches with the publisher App ([#642](https://github.com/adobe/helix-rum-enhancer/issues/642)) ([07c73eb](https://github.com/adobe/helix-rum-enhancer/commit/07c73eb9722a9571b03478e3d5864c71900a6ca1))
10
+ * **cwv:** use the bundled web-vitals instead of loading it at runtime ([4b7063d](https://github.com/adobe/helix-rum-enhancer/commit/4b7063de763cf0c60f1ac222801813dc4e692131))
11
+ * **release:** check exact-branch availability before publishing; reject ambiguous versions ([2c2898a](https://github.com/adobe/helix-rum-enhancer/commit/2c2898a79adb7e675bb8ce674e5055a39459081b))
12
+ * **release:** require the manifest source commit to match HEAD ([278ab2f](https://github.com/adobe/helix-rum-enhancer/commit/278ab2f6e129f33981b0c912e2f26895b2f52937))
13
+
14
+
15
+ ### Features
16
+
17
+ * **release:** publish a manifest of every built file and make exact releases write-once ([dba8cf0](https://github.com/adobe/helix-rum-enhancer/commit/dba8cf0711d4494bbfc320bddfbb4ba1d6b0aed8))
18
+ * **release:** publish a manifest of every built file and make exact releases write-once ([#645](https://github.com/adobe/helix-rum-enhancer/issues/645)) ([d046188](https://github.com/adobe/helix-rum-enhancer/commit/d04618838aa741f8d4eca9374656f4bc027100e6))
package/rollup.config.js CHANGED
@@ -30,6 +30,18 @@ const banner = `/*
30
30
  * governing permissions and limitations under the License.
31
31
  */`;
32
32
 
33
+ // Pinned copy of web-vitals for enhancer releases that predate the bundled CWV plugin and
34
+ // still load /.rum/web-vitals/dist/web-vitals.iife.js at runtime. The collector serves this
35
+ // file, which is listed in the release manifest, for that path instead of fetching the
36
+ // unversioned library from a public CDN. The bytes are the npm package's, unmodified.
37
+ const vendorWebVitals = {
38
+ name: 'vendor-web-vitals',
39
+ writeBundle() {
40
+ fs.mkdirSync('src/vendor', { recursive: true });
41
+ fs.copyFileSync('node_modules/web-vitals/dist/web-vitals.iife.js', 'src/vendor/web-vitals.iife.js');
42
+ },
43
+ };
44
+
33
45
  // Get list of plugins from the file system
34
46
  const pluginFiles = fs.readdirSync('plugins').filter((file) => file.endsWith('.js'));
35
47
  const plugins = pluginFiles.map((file) => path.basename(file, '.js'));
@@ -80,6 +92,7 @@ const indexConfig = {
80
92
  filename: 'index.md5',
81
93
  includeAssets: false,
82
94
  }),
95
+ vendorWebVitals,
83
96
  checksum({
84
97
  filename: 'index',
85
98
  includeAssets: false,
package/src/index.js CHANGED
@@ -114,24 +114,41 @@ const sourceSelector = el => {
114
114
  } catch (error) {
115
115
  return null;
116
116
  }
117
- };const {
117
+ };function getCookie(name) {
118
+ try {
119
+ const matches = document.cookie.split(';').map(c => c.trim()).filter(c => c.startsWith(`${name}=`));
120
+ if (!matches.length) {
121
+ return undefined;
122
+ }
123
+ return matches.length === 1 ? matches[0].slice(name.length + 1) : null;
124
+ } catch {
125
+ return undefined;
126
+ }
127
+ }
128
+ function getLocalStorage(name) {
129
+ try {
130
+ return window.localStorage.getItem(name);
131
+ } catch {
132
+ return null;
133
+ }
134
+ }const {
118
135
  sampleRUM,
119
136
  queue,
120
137
  isSelected
121
138
  } = window.hlx && window.hlx.rum ? window.hlx.rum : {};
122
139
  const createMO = cb => window.MutationObserver ? new MutationObserver(cb) : {};
123
140
  const [blocksMO, mediaMO] = [blocksMCB, mediaMCB].map(createMO);
124
- const hasCookie = key => document.cookie.split(';').some(c => c.trim().startsWith(`${key}=`));
141
+ const hasCookie = key => getCookie(key) !== undefined;
125
142
  const pluginBase = new URL(document.currentScript.src).href.replace(/index(\.map)?\.js/, 'plugins');
126
143
  const CONSENT_PROVIDERS = [{
127
144
  name: 'onetrust',
128
- detect: () => hasCookie('OptanonAlertBoxClosed') || document.querySelector('#onetrust-banner-sdk, #onetrust-pc-sdk')
145
+ detect: () => ['OptanonAlertBoxClosed', 'OptanonConsent'].some(hasCookie) || document.querySelector('#onetrust-banner-sdk, #onetrust-pc-sdk')
129
146
  }, {
130
147
  name: 'trustarc',
131
148
  detect: () => ['notice_gdpr_prefs', 'notice_preferences'].some(hasCookie) || document.querySelector('#truste-consent-track')
132
149
  }, {
133
150
  name: 'usercentrics',
134
- detect: () => window.localStorage.getItem('uc_gcm') || document.querySelector('#usercentrics-root')
151
+ detect: () => getLocalStorage('uc_gcm') || hasCookie('uc_consent_status_essential') || document.querySelector('#usercentrics-root')
135
152
  }];
136
153
  const getConsent = () => CONSENT_PROVIDERS.find(({
137
154
  detect
package/src/index.md5 CHANGED
@@ -1 +1 @@
1
- 58417ffc49bf1f6f8f9a9fc57b378b0a
1
+ 7c8148c1a0842c810a053d892851d6e9
package/src/index.sri CHANGED
@@ -1 +1 @@
1
- sha384-nY9+RtcZa8Dyu77MVlBoTpT9hhtcLDMBznR3Qwyy/0t9MXjBiPvpLh3euJziTS+r
1
+ sha384-zoEXfXJ6U6Zbnao59dApLcpEYsT50jfDbMYYZ2dPJCdPcXl6doTyKRJW+RLJcplc