@mdn/fred 1.3.0 → 1.3.2

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.
Files changed (117) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +15 -0
  3. package/components/content-section/server.css +5 -0
  4. package/components/doc/server.js +1 -1
  5. package/components/env/README.md +2 -0
  6. package/components/env/utils.js +2 -1
  7. package/components/outer-layout/server.js +4 -6
  8. package/components/scrim-inline/element.css +7 -0
  9. package/l10n/en-US.ftl +2 -2
  10. package/out/service-worker.js +1 -1
  11. package/out/service-worker.js.map +1 -1
  12. package/out/static/client/2192.047e085427f96849.js +2 -0
  13. package/out/static/client/2192.047e085427f96849.js.map +1 -0
  14. package/out/static/client/2319.daf8150c3dd00fb4.js +60 -0
  15. package/out/static/client/2319.daf8150c3dd00fb4.js.map +1 -0
  16. package/out/static/client/9379.b25587d6a239abd3.js +2 -0
  17. package/out/static/client/9379.b25587d6a239abd3.js.map +1 -0
  18. package/out/static/client/{index.1e789b86311a8c84.js → index.b9d9ebb034538241.js} +12 -12
  19. package/out/static/client/index.b9d9ebb034538241.js.map +1 -0
  20. package/out/static/client/{runtime.8c7621b5c39c82eb.js → runtime.cc9114c9e108157f.js} +2 -2
  21. package/out/static/client/{runtime.8c7621b5c39c82eb.js.map → runtime.cc9114c9e108157f.js.map} +1 -1
  22. package/out/static/client/stats.json +260 -260
  23. package/out/static/client/{styles-a11y-menu.9ef9230de282e800.js → styles-a11y-menu.7611b4bce04dce87.js} +1 -1
  24. package/out/static/client/{styles-advertising.a44392a700080714.js → styles-advertising.6ef20f7efd05a15e.js} +1 -1
  25. package/out/static/client/{styles-article-footer.86b64eeebebad91b.js → styles-article-footer.cc0f537c8ada7c9b.js} +1 -1
  26. package/out/static/client/{styles-banner.fbff125bcec971bb.js → styles-banner.9d03daba84c11958.js} +1 -1
  27. package/out/static/client/styles-baseline-indicator.33eb05f9a9b91b89.js +1 -0
  28. package/out/static/client/{styles-blog-index.ffc8cf956c8e4373.js → styles-blog-index.ef4c3381388cfc3c.js} +1 -1
  29. package/out/static/client/{styles-blog-post.a91d641515116579.js → styles-blog-post.ab28b6e530a52ebd.js} +1 -1
  30. package/out/static/client/{styles-breadcrumbs-bar.99a04f7eef75930e.js → styles-breadcrumbs-bar.a5b3dde8e4982283.js} +1 -1
  31. package/out/static/client/{styles-breadcrumbs.efcc208fb9e255c5.js → styles-breadcrumbs.5333e663949a9a4d.js} +1 -1
  32. package/out/static/client/{styles-button.fbe882b992422121.js → styles-button.ef5d0faf165ee6e2.js} +1 -1
  33. package/out/static/client/{styles-content-section.97477ade56571b27.js → styles-content-section.9fe8a1ad9c2259f7.js} +1 -1
  34. package/out/static/client/{styles-content-section.0dbf80e850fa3402.css → styles-content-section.e0bbadd0c4bc857d.css} +2 -2
  35. package/out/static/client/{styles-content-section.0dbf80e850fa3402.css.map → styles-content-section.e0bbadd0c4bc857d.css.map} +1 -1
  36. package/out/static/client/styles-contributor-spotlight.2a64f233a4b2f8cf.js +1 -0
  37. package/out/static/client/{styles-curriculum-about.f15ed5fd5438c809.js → styles-curriculum-about.5b5af2be7bfeb792.js} +1 -1
  38. package/out/static/client/styles-curriculum-default.56f461a14f48000f.js +1 -0
  39. package/out/static/client/styles-curriculum-landing.0b13e3b8789c8975.js +1 -0
  40. package/out/static/client/{styles-curriculum-module.4f565696a741e039.js → styles-curriculum-module.09d969ccdd8fba0e.js} +1 -1
  41. package/out/static/client/styles-curriculum-overview.0b6ec4922ffa21cd.js +1 -0
  42. package/out/static/client/{styles-featured-articles.33d674ab9d0a4b23.js → styles-featured-articles.bf0dd66c721166d5.js} +1 -1
  43. package/out/static/client/{styles-footer.61afa985d6c61587.js → styles-footer.abd19f8639decb33.js} +1 -1
  44. package/out/static/client/{styles-generic-about.832ee823b2a15f3d.js → styles-generic-about.8e7b0a1963a28044.js} +1 -1
  45. package/out/static/client/{styles-generic-community.747ac72340973838.js → styles-generic-community.3be0ea626cc23a91.js} +1 -1
  46. package/out/static/client/{styles-generic-content.a3756d3e18ebaa38.js → styles-generic-content.fb3767c6c038360a.js} +1 -1
  47. package/out/static/client/{styles-generic-layout.35e962adef8a2f23.js → styles-generic-layout.a167731346d98e68.js} +1 -1
  48. package/out/static/client/{styles-generic-sidebar.0292229bdf97c876.js → styles-generic-sidebar.5980d2f382e31c2f.js} +1 -1
  49. package/out/static/client/{styles-generic-toc.0cf78fef4fb1ca04.js → styles-generic-toc.e87b903f40b5ee3d.js} +1 -1
  50. package/out/static/client/{styles-global.73ea7609e20e907a.js → styles-global.57880af9e7d6375b.js} +1 -1
  51. package/out/static/client/styles-global.c9f2a49e47bf5c55.css +2 -0
  52. package/out/static/client/{styles-global.d92154c94ac95c1e.css.map → styles-global.c9f2a49e47bf5c55.css.map} +1 -1
  53. package/out/static/client/{styles-heading-anchor.40bbc9df73fbe3ed.js → styles-heading-anchor.9c108abd05c06751.js} +1 -1
  54. package/out/static/client/{styles-homepage-body.4d5de7246b823efb.js → styles-homepage-body.feca200494fa3f2b.js} +1 -1
  55. package/out/static/client/styles-homepage-contributor-spotlight.03dab9ff0109526a.js +1 -0
  56. package/out/static/client/{styles-homepage-footer.1d2128d057b63f1c.js → styles-homepage-footer.84c517dc0ea370ef.js} +1 -1
  57. package/out/static/client/{styles-homepage-header.7f9ca8158a115853.js → styles-homepage-header.deaef111dbb0c461.js} +1 -1
  58. package/out/static/client/{styles-homepage-hero.a378110befc1e2cf.js → styles-homepage-hero.0663c42e3542e919.js} +1 -1
  59. package/out/static/client/{styles-homepage.5fb3fbe7543e268c.js → styles-homepage.76dcd400ed4ef833.js} +1 -1
  60. package/out/static/client/{styles-latest-news.9807f67c0586ad37.js → styles-latest-news.fdcc5477075ebe1e.js} +1 -1
  61. package/out/static/client/{styles-left-sidebar.2b2c4b35ffab8b27.js → styles-left-sidebar.30b4df297a282352.js} +1 -1
  62. package/out/static/client/{styles-logo.b0bad5a338d3c9d5.js → styles-logo.9063fd7fb72b63d6.js} +1 -1
  63. package/out/static/client/{styles-mandala.12a581abb318dbd8.js → styles-mandala.ce86c75111666a12.js} +1 -1
  64. package/out/static/client/{styles-menu.5b31bb6fde3da1a1.js → styles-menu.69b7fa131dc4d6fa.js} +1 -1
  65. package/out/static/client/{styles-navigation.48b5d8d8c84bded3.js → styles-navigation.135a000deb94eb19.js} +1 -1
  66. package/out/static/client/{styles-not-found.d239b62bbdf556a1.js → styles-not-found.fbeeeeb400396890.js} +1 -1
  67. package/out/static/client/styles-observatory-landing.110db07bb7544066.js +1 -0
  68. package/out/static/client/styles-observatory-results.c3442ff842cbdb45.js +1 -0
  69. package/out/static/client/{styles-page-layout.88f6a1626ac74ab0.js → styles-page-layout.9b3493593d874fb1.js} +1 -1
  70. package/out/static/client/{styles-pagination.cf614f5da0884ae8.js → styles-pagination.e3e8520569a46adb.js} +1 -1
  71. package/out/static/client/{styles-playground.372ea0d0972b1cf7.js → styles-playground.036c5327a7d7e6f4.js} +1 -1
  72. package/out/static/client/styles-recent-contributions.12d4e639949c9e09.js +1 -0
  73. package/out/static/client/{styles-reference-layout.d9101683510063c5.js → styles-reference-layout.0e24dfefa6cc72e3.js} +1 -1
  74. package/out/static/client/{styles-reference-toc.b16b3ae26546340c.js → styles-reference-toc.07c68b6e6c891ede.js} +1 -1
  75. package/out/static/client/{styles-sandbox.c6f491538eb37b5a.js → styles-sandbox.97d617556b73c537.js} +1 -1
  76. package/out/static/client/{styles-site-search.0c4b85eda79571bf.js → styles-site-search.2334e870616575a9.js} +1 -1
  77. package/out/static/client/{styles-translation-banner.89994e4b4025fca7.js → styles-translation-banner.b0a8a3eadb7853f4.js} +1 -1
  78. package/out/static/client/{styles-writer-toolbar.8cf64ea391d384dc.js → styles-writer-toolbar.dd7af6ca4f2b9b18.js} +1 -1
  79. package/out/static/client/{styles.7e12510d3d62d6c2.js → styles.42b0721850a6a7e4.js} +2 -2
  80. package/out/static/client/{styles.7e12510d3d62d6c2.js.map → styles.42b0721850a6a7e4.js.map} +1 -1
  81. package/out/static/legacy/1539.ed9136a5f40f8f86.js +27 -0
  82. package/out/static/legacy/1539.ed9136a5f40f8f86.js.map +1 -0
  83. package/out/static/legacy/asset-manifest.json +7 -7
  84. package/out/static/legacy/{index.fdfbaab08cf3189a.js → index.3504df1c7b6a1b29.js} +3 -3
  85. package/out/static/legacy/{index.fdfbaab08cf3189a.js.map → index.3504df1c7b6a1b29.js.map} +1 -1
  86. package/out/static/legacy/{index.7a7a7a6c9ea9fbe7.html → index.e4ab469094607d20.html} +1 -1
  87. package/out/static/legacy/stats.json +16 -16
  88. package/out/static/legacy/{yari.9ba4e4812214ca1d.js → yari.7a85003b4add8414.js} +3 -3
  89. package/out/static/legacy/{yari.9ba4e4812214ca1d.js.map → yari.7a85003b4add8414.js.map} +1 -1
  90. package/out/static/ssr/index.js +10 -10
  91. package/out/static/ssr/index.js.map +1 -1
  92. package/out/static/ssr/stats.json +4 -4
  93. package/package.json +11 -11
  94. package/out/static/client/2192.6208c073539aca0c.js +0 -2
  95. package/out/static/client/2192.6208c073539aca0c.js.map +0 -1
  96. package/out/static/client/2319.0beb43a38dd85a2c.js +0 -60
  97. package/out/static/client/2319.0beb43a38dd85a2c.js.map +0 -1
  98. package/out/static/client/9379.fdeb8d3dbec381d4.js +0 -2
  99. package/out/static/client/9379.fdeb8d3dbec381d4.js.map +0 -1
  100. package/out/static/client/index.1e789b86311a8c84.js.map +0 -1
  101. package/out/static/client/styles-baseline-indicator.bf566965786907bc.js +0 -1
  102. package/out/static/client/styles-contributor-spotlight.f38b65412f05511a.js +0 -1
  103. package/out/static/client/styles-curriculum-default.e5662ee1eb84c092.js +0 -1
  104. package/out/static/client/styles-curriculum-landing.6e4b9b74a02421c0.js +0 -1
  105. package/out/static/client/styles-curriculum-overview.03c8bb59e85f60fc.js +0 -1
  106. package/out/static/client/styles-global.d92154c94ac95c1e.css +0 -2
  107. package/out/static/client/styles-homepage-contributor-spotlight.40146b76a1b9b98d.js +0 -1
  108. package/out/static/client/styles-observatory-landing.35868a8dba7b4d88.js +0 -1
  109. package/out/static/client/styles-observatory-results.7639a9793cb4d5f4.js +0 -1
  110. package/out/static/client/styles-recent-contributions.1381c21c0d5a9068.js +0 -1
  111. package/out/static/legacy/1539.bf50d6a606ae3f2e.js +0 -27
  112. package/out/static/legacy/1539.bf50d6a606ae3f2e.js.map +0 -1
  113. /package/out/static/client/{2319.0beb43a38dd85a2c.js.LICENSE.txt → 2319.daf8150c3dd00fb4.js.LICENSE.txt} +0 -0
  114. /package/out/static/client/{index.1e789b86311a8c84.js.LICENSE.txt → index.b9d9ebb034538241.js.LICENSE.txt} +0 -0
  115. /package/out/static/legacy/{1539.bf50d6a606ae3f2e.js.LICENSE.txt → 1539.ed9136a5f40f8f86.js.LICENSE.txt} +0 -0
  116. /package/out/static/legacy/{index.fdfbaab08cf3189a.js.LICENSE.txt → index.3504df1c7b6a1b29.js.LICENSE.txt} +0 -0
  117. /package/out/static/legacy/{yari.9ba4e4812214ca1d.js.LICENSE.txt → yari.7a85003b4add8414.js.LICENSE.txt} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.3.2](https://github.com/mdn/fred/compare/v1.3.1...v1.3.2) (2025-09-05)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **content-section:** move dt/dd in dt closer together ([#704](https://github.com/mdn/fred/issues/704)) ([b93e613](https://github.com/mdn/fred/commit/b93e6136f16c21c8ca956f3db112785429caf18c))
9
+ * **doc:** use pageTitle as `<title>` ([#693](https://github.com/mdn/fred/issues/693)) ([4d0756e](https://github.com/mdn/fred/commit/4d0756e5e22b95fc7a5802f892ac9b7204cf8fee))
10
+ * **scrim-inline:** add missing style ([#700](https://github.com/mdn/fred/issues/700)) ([2d8e30a](https://github.com/mdn/fred/commit/2d8e30a0caf7b487f03aadfaefb4450395517c37))
11
+
12
+
13
+ ### Miscellaneous
14
+
15
+ * **deps-dev:** bump @mdn/browser-compat-data from 7.1.1 to 7.1.2 ([#699](https://github.com/mdn/fred/issues/699)) ([382c653](https://github.com/mdn/fred/commit/382c653c00146e06586f699d714c728d078e5715))
16
+ * **deps-dev:** bump @types/node from 22.18.0 to 22.18.1 in the dev group ([#707](https://github.com/mdn/fred/issues/707)) ([89244ab](https://github.com/mdn/fred/commit/89244ab6f0c022efe12cced7bfbfe792143dedba))
17
+ * **deps-dev:** bump the dev group with 3 updates ([#695](https://github.com/mdn/fred/issues/695)) ([5031a68](https://github.com/mdn/fred/commit/5031a688326d0bd973746b7251c51693a1b4dfa0))
18
+
19
+ ## [1.3.1](https://github.com/mdn/fred/compare/v1.3.0...v1.3.1) (2025-09-03)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * **env:** remove inline script if no runtime variables are set ([#691](https://github.com/mdn/fred/issues/691)) ([771737e](https://github.com/mdn/fred/commit/771737eb0ccf60eab9af54bb011f4099af475e17))
25
+
26
+
27
+ ### Miscellaneous
28
+
29
+ * **compat-table:** Port release label fix from yari ([#687](https://github.com/mdn/fred/issues/687)) ([3391cc4](https://github.com/mdn/fred/commit/3391cc4079cf9e6fed5c5b096d361793055fa94e))
30
+ * **deps-dev:** bump the dev group with 5 updates ([#688](https://github.com/mdn/fred/issues/688)) ([bdff859](https://github.com/mdn/fred/commit/bdff8590ce1127286f9d0788ff60c5aa67afc9c8))
31
+
3
32
  ## [1.3.0](https://github.com/mdn/fred/compare/v1.2.0...v1.3.0) (2025-09-01)
4
33
 
5
34
 
package/README.md CHANGED
@@ -24,6 +24,21 @@ MDN's next fr(ont)e(n)d.
24
24
  - `npm run preview`
25
25
  - runs the preview server: using the production bundles with the rari server: useful for testing our prod rspack config
26
26
 
27
+ ### Accessing from non-localhost
28
+
29
+ If you want to access fred from a different machine, you'll need to run with certain options:
30
+
31
+ - `HTTPS=true` to enable HTTPS with a self-signed certificate, allowing Web APIs requiring a secure context to work
32
+ - `ORIGIN_MAIN=your.local.ip.address` to allowlist your address in the playground
33
+
34
+ So a full command might look like:
35
+
36
+ ```
37
+ HTTPS=true ORIGIN_MAIN=192.168.0.99 npm run start
38
+ ```
39
+
40
+ This is useful to test changes on mobile, tablets and other platforms.
41
+
27
42
  ## Development principles
28
43
 
29
44
  ### Environment variables
@@ -245,6 +245,11 @@
245
245
 
246
246
  dd {
247
247
  margin-left: 1rem;
248
+
249
+ /* Move description closer to term. */
250
+ p:first-child {
251
+ margin-top: 0.5rem;
252
+ }
248
253
  }
249
254
 
250
255
  ul {
@@ -6,7 +6,7 @@ export class Doc extends ServerComponent {
6
6
  /**
7
7
  * @param {import("@fred").Context<import("@rari").DocPage>} context
8
8
  */ render(context) {
9
- context.pageTitle = context.doc.title;
9
+ context.pageTitle = context.doc.pageTitle;
10
10
  return PageLayout.render(context, ReferenceLayout.render(context));
11
11
  }
12
12
  }
@@ -26,3 +26,5 @@ Rspack will bundle **all** environment variables prefixed with `FRED_` into the
26
26
  By default, variables are baked into our bundle at build time. However, you can define variables as runtime environment variables, which can be changed when running a version of Fred built with `FRED_RUNTIME_ENV=true`.
27
27
 
28
28
  This is used in our npm package, so we can e.g. set `FRED_WRITER_MODE=true` in the `content` repo, without having to bake that into the npm package for all consumers.
29
+
30
+ Runtime environment variables fall back to their build-time values if not set, and then to the default defined in code.
@@ -50,7 +50,8 @@ function getEnv(name, options = {}) {
50
50
  const fullName = `FRED_${name}`;
51
51
  if (runtime && RUNTIME_ENV) {
52
52
  runtimeVariables.push(fullName);
53
- return process.env[fullName] || getEnv(name);
53
+ // safely navigate if process is not defined
54
+ return globalThis.process?.env[fullName] || getEnv(name);
54
55
  }
55
56
  return globalThis.__MDNEnv?.[fullName];
56
57
  }
@@ -69,10 +69,8 @@ export class OuterLayout extends ServerComponent {
69
69
  ? "learn"
70
70
  : undefined;
71
71
 
72
- const env = Object.fromEntries(
73
- Object.entries(process.env).filter(([key]) =>
74
- runtimeVariables.includes(key),
75
- ),
72
+ const runtimeEnvEntries = Object.entries(process.env).filter(
73
+ ([key]) => key.startsWith("FRED_") && runtimeVariables.includes(key),
76
74
  );
77
75
 
78
76
  // if you want to put some script inline, put it in entry.inline.js
@@ -93,9 +91,9 @@ export class OuterLayout extends ServerComponent {
93
91
  content="width=device-width, initial-scale=1.0"
94
92
  />
95
93
  <title>${context.pageTitle || "MDN"}</title>
96
- ${RUNTIME_ENV
94
+ ${RUNTIME_ENV && runtimeEnvEntries.length > 0
97
95
  ? unsafeHTML(`<script>process = {
98
- env: ${JSON.stringify(env)}
96
+ env: ${JSON.stringify(Object.fromEntries(runtimeEnvEntries))}
99
97
  };</script>`)
100
98
  : nothing}
101
99
  ${unsafeHTML(`<script>${inlineScript}</script>`)}
@@ -2,6 +2,13 @@
2
2
 
3
3
  :host {
4
4
  display: block;
5
+
6
+ width: 100%;
7
+ max-width: 36rem;
8
+ aspect-ratio: 1.5;
9
+
10
+ margin: 0.5rem auto;
11
+
5
12
  overflow: hidden;
6
13
  }
7
14
 
package/l10n/en-US.ftl CHANGED
@@ -62,8 +62,8 @@ obs-mdn = The { -brand-name-obs } provides effective security insights, guided b
62
62
 
63
63
  compat-loading = Loading…
64
64
 
65
- compat-browser-version-date = { $browser } { $version } – Released { $date }
66
- compat-browser-version-released = Released { $date }
65
+ compat-browser-version-date = { $browser } { $version } – Release date: { $date }
66
+ compat-browser-version-released = Release date: { $date }
67
67
 
68
68
  compat-link-report-issue = Report problems with this compatibility data
69
69
  compat-link-report-issue-title = Report an issue with this compatibility data