Skip to content

feat: create announcements banner#617

Open
araujogui wants to merge 5 commits intomainfrom
feat/banners
Open

feat: create announcements banner#617
araujogui wants to merge 5 commits intomainfrom
feat/banners

Conversation

@araujogui
Copy link
Member

Description

Create announcements banner component

Validation

image

Related Issues

Fixes #327

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run node --run test and all tests passed.
  • I have check code formatting with node --run format & node --run lint.
  • I've covered new added functionality with unit tests if necessary.

@araujogui araujogui requested a review from a team as a code owner February 20, 2026 19:56
Copilot AI review requested due to automatic review settings February 20, 2026 19:56
@vercel
Copy link

vercel bot commented Feb 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
api-docs-tooling Ready Ready Preview Mar 12, 2026 10:29pm

Request Review

@codecov
Copy link

codecov bot commented Feb 20, 2026

Codecov Report

❌ Patch coverage is 46.15385% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.87%. Comparing base (32a824c) to head (71e53ac).
⚠️ Report is 32 commits behind head on main.

Files with missing lines Patch % Lines
src/generators/jsx-ast/utils/buildContent.mjs 22.22% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #617      +/-   ##
==========================================
- Coverage   78.62%   75.87%   -2.76%     
==========================================
  Files         128      145      +17     
  Lines       12461    13730    +1269     
  Branches      902      991      +89     
==========================================
+ Hits         9798    10418     +620     
- Misses       2658     3306     +648     
- Partials        5        6       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link

github-actions bot commented Feb 20, 2026

legacy-html Generator

File Base Head Diff
stream.html 803.49 KB 822.25 KB +18.75 KB (+2.33%)
fs.html 913.83 KB 928.92 KB +15.09 KB (+1.65%)
webcrypto.html 320.48 KB 334.63 KB +14.15 KB (+4.42%)
diagnostics_channel.html 221.94 KB 234.15 KB +12.22 KB (+5.50%)
crypto.html 997.50 KB 1007.81 KB +10.31 KB (+1.03%)
n-api.html 758.34 KB 767.40 KB +9.07 KB (+1.20%)
os.html 75.40 KB 83.60 KB +8.20 KB (+10.87%)
errors.html 341.45 KB 349.54 KB +8.09 KB (+2.37%)
http2.html 736.72 KB 743.60 KB +6.88 KB (+0.93%)
http.html 591.73 KB 597.92 KB +6.19 KB (+1.05%)
cli.html 281.51 KB 287.63 KB +6.12 KB (+2.17%)
util.html 708.69 KB 714.55 KB +5.86 KB (+0.83%)
module.html 322.94 KB 328.45 KB +5.52 KB (+1.71%)
test.html 796.42 KB 801.86 KB +5.45 KB (+0.68%)
quic.html 137.33 KB 142.57 KB +5.24 KB (+3.82%)
dns.html 210.79 KB 215.95 KB +5.15 KB (+2.44%)
sqlite.html 184.93 KB 189.96 KB +5.03 KB (+2.72%)
buffer.html 1.06 MB 1.07 MB +4.99 KB (+0.46%)
process.html 677.97 KB 682.75 KB +4.78 KB (+0.71%)
net.html 211.82 KB 216.24 KB +4.43 KB (+2.09%)
perf_hooks.html 345.33 KB 349.49 KB +4.16 KB (+1.20%)
tls.html 259.31 KB 263.42 KB +4.12 KB (+1.59%)
deprecations.html 258.86 KB 262.95 KB +4.09 KB (+1.58%)
webstreams.html 266.19 KB 270.27 KB +4.08 KB (+1.53%)
readline.html 200.67 KB 204.62 KB +3.95 KB (+1.97%)
esm.html 122.59 KB 126.35 KB +3.76 KB (+3.07%)
zlib.html 272.53 KB 276.26 KB +3.72 KB (+1.37%)
url.html 318.30 KB 322.00 KB +3.70 KB (+1.16%)
events.html 541.55 KB 545.18 KB +3.63 KB (+0.67%)
vm.html 330.88 KB 334.30 KB +3.42 KB (+1.03%)
worker_threads.html 382.93 KB 386.29 KB +3.36 KB (+0.88%)
child_process.html 438.97 KB 442.26 KB +3.29 KB (+0.75%)
v8.html 309.14 KB 312.33 KB +3.19 KB (+1.03%)
inspector.html 110.75 KB 113.82 KB +3.07 KB (+2.77%)
globals.html 120.14 KB 123.14 KB +3.00 KB (+2.50%)
packages.html 118.86 KB 121.67 KB +2.81 KB (+2.36%)
modules.html 148.53 KB 151.28 KB +2.75 KB (+1.85%)
assert.html 464.27 KB 466.93 KB +2.66 KB (+0.57%)
async_hooks.html 217.73 KB 220.38 KB +2.65 KB (+1.22%)
single-executable-applications.html 83.02 KB 85.61 KB +2.58 KB (+3.11%)
dgram.html 153.12 KB 155.64 KB +2.52 KB (+1.64%)
cluster.html 195.87 KB 198.22 KB +2.35 KB (+1.20%)
intl.html 40.46 KB 42.78 KB +2.32 KB (+5.73%)
repl.html 215.26 KB 217.51 KB +2.25 KB (+1.05%)
timers.html 87.18 KB 89.38 KB +2.20 KB (+2.52%)
console.html 95.74 KB 97.90 KB +2.16 KB (+2.26%)
permissions.html 35.62 KB 37.72 KB +2.10 KB (+5.88%)
path.html 93.69 KB 95.76 KB +2.07 KB (+2.21%)
tty.html 41.57 KB 43.63 KB +2.06 KB (+4.97%)
https.html 153.59 KB 155.65 KB +2.05 KB (+1.34%)
async_context.html 198.51 KB 200.56 KB +2.05 KB (+1.03%)
index.html 15.14 KB 17.06 KB +1.92 KB (+12.68%)
addons.html 336.13 KB 338.04 KB +1.90 KB (+0.57%)
debugger.html 36.24 KB 38.11 KB +1.87 KB (+5.15%)
tracing.html 87.56 KB 89.42 KB +1.86 KB (+2.13%)
domain.html 99.32 KB 101.17 KB +1.85 KB (+1.86%)
typescript.html 32.06 KB 33.83 KB +1.77 KB (+5.53%)
report.html 186.09 KB 187.86 KB +1.77 KB (+0.95%)
wasi.html 43.51 KB 45.27 KB +1.76 KB (+4.05%)
environment_variables.html 22.87 KB 24.61 KB +1.74 KB (+7.61%)
querystring.html 32.04 KB 33.76 KB +1.72 KB (+5.36%)
punycode.html 32.69 KB 34.40 KB +1.71 KB (+5.24%)
string_decoder.html 38.57 KB 40.21 KB +1.65 KB (+4.27%)
documentation.html 24.09 KB 25.74 KB +1.64 KB (+6.81%)
embedding.html 48.04 KB 49.68 KB +1.64 KB (+3.41%)
synopsis.html 23.89 KB 25.47 KB +1.58 KB (+6.63%)

orama-db Generator

File Base Head Diff
orama-db.json 8.03 MB 8.03 MB -2.82 KB (-0.03%)

web Generator

File Base Head Diff
fs.js 1.33 MB 1.18 MB -151.72 KB (-11.12%)
fs.html 1.29 MB 1.39 MB +103.72 KB (+7.83%)
crypto.js 1.24 MB 1.15 MB -88.47 KB (-6.97%)
webcrypto.js 464.93 KB 390.80 KB -74.13 KB (-15.94%)
http2.js 861.83 KB 802.17 KB -59.66 KB (-6.92%)
crypto.html 987.57 KB 1.02 MB +59.56 KB (+6.03%)
stream.js 909.92 KB 855.87 KB -54.05 KB (-5.94%)
quic.js 220.25 KB 169.55 KB -50.69 KB (-23.02%)
http.js 742.92 KB 692.24 KB -50.68 KB (-6.82%)
buffer.html 855.53 KB 904.70 KB +49.17 KB (+5.75%)
util.js 797.10 KB 756.21 KB -40.89 KB (-5.13%)
test.html 684.13 KB 722.17 KB +38.05 KB (+5.56%)
test.js 885.03 KB 847.35 KB -37.69 KB (-4.26%)
buffer.js 1.13 MB 1.10 MB -37.68 KB (-3.25%)
process.js 747.57 KB 710.52 KB -37.04 KB (-4.95%)
util.html 655.29 KB 691.46 KB +36.17 KB (+5.52%)
stream.html 820.30 KB 856.46 KB +36.16 KB (+4.41%)
webstreams.js 320.81 KB 285.73 KB -35.08 KB (-10.94%)
net.js 321.67 KB 287.44 KB -34.23 KB (-10.64%)
perf_hooks.js 406.03 KB 375.25 KB -30.77 KB (-7.58%)
tls.js 349.38 KB 322.19 KB -27.19 KB (-7.78%)
diagnostics_channel.js 252.87 KB 226.75 KB -26.13 KB (-10.33%)
http2.html 740.69 KB 765.66 KB +24.97 KB (+3.37%)
events.js 575.74 KB 550.96 KB -24.78 KB (-4.30%)
webcrypto.html 528.45 KB 504.39 KB -24.06 KB (-4.55%)
net.html 357.47 KB 380.69 KB +23.22 KB (+6.50%)
http.html 712.70 KB 735.03 KB +22.33 KB (+3.13%)
dns.js 292.44 KB 270.65 KB -21.79 KB (-7.45%)
vm.js 380.39 KB 358.65 KB -21.74 KB (-5.72%)
vm.html 331.32 KB 350.56 KB +19.24 KB (+5.81%)
child_process.js 489.11 KB 469.89 KB -19.23 KB (-3.93%)
v8.js 355.28 KB 336.08 KB -19.19 KB (-5.40%)
tls.html 353.23 KB 372.28 KB +19.05 KB (+5.39%)
worker_threads.js 420.88 KB 402.05 KB -18.83 KB (-4.47%)
module.js 351.50 KB 333.20 KB -18.30 KB (-5.21%)
child_process.html 363.11 KB 381.38 KB +18.26 KB (+5.03%)
url.js 354.43 KB 336.80 KB -17.63 KB (-4.97%)
sqlite.html 240.10 KB 256.69 KB +16.60 KB (+6.91%)
sqlite.js 241.73 KB 225.84 KB -15.89 KB (-6.57%)
deprecations.html 509.91 KB 494.12 KB -15.80 KB (-3.10%)
events.html 438.26 KB 453.98 KB +15.73 KB (+3.59%)
cli.html 502.93 KB 487.97 KB -14.97 KB (-2.98%)
v8.html 305.93 KB 320.09 KB +14.16 KB (+4.63%)
zlib.js 334.44 KB 320.93 KB -13.51 KB (-4.04%)
readline.js 238.88 KB 225.69 KB -13.19 KB (-5.52%)
module.html 310.90 KB 323.49 KB +12.59 KB (+4.05%)
diagnostics_channel.html 219.47 KB 231.94 KB +12.47 KB (+5.68%)
url.html 333.93 KB 346.03 KB +12.10 KB (+3.62%)
webstreams.html 343.87 KB 355.63 KB +11.76 KB (+3.42%)
quic.html 368.40 KB 357.01 KB -11.39 KB (-3.09%)
n-api.html 814.52 KB 803.53 KB -10.99 KB (-1.35%)
styles.css 128.14 KB 138.74 KB +10.60 KB (+8.27%)
inspector.js 132.83 KB 122.45 KB -10.38 KB (-7.81%)
dgram.js 185.12 KB 174.82 KB -10.30 KB (-5.57%)
readline.html 240.92 KB 250.90 KB +9.99 KB (+4.15%)
process.html 656.14 KB 665.91 KB +9.77 KB (+1.49%)
assert.js 467.59 KB 458.01 KB -9.58 KB (-2.05%)
dns.html 285.63 KB 295.20 KB +9.57 KB (+3.35%)
os.html 132.04 KB 141.53 KB +9.49 KB (+7.18%)
zlib.html 279.95 KB 289.44 KB +9.48 KB (+3.39%)
errors.html 465.94 KB 456.80 KB -9.14 KB (-1.96%)
os.js 116.34 KB 107.38 KB -8.96 KB (-7.70%)
cluster.js 206.89 KB 197.96 KB -8.92 KB (-4.31%)
worker_threads.html 355.64 KB 363.79 KB +8.15 KB (+2.29%)
assert.html 321.30 KB 329.39 KB +8.09 KB (+2.52%)
path.js 105.32 KB 97.78 KB -7.54 KB (-7.16%)
timers.js 107.82 KB 100.87 KB -6.95 KB (-6.45%)
modules.js 158.24 KB 151.49 KB -6.75 KB (-4.27%)
dgram.html 186.67 KB 193.24 KB +6.57 KB (+3.52%)
perf_hooks.html 373.03 KB 379.00 KB +5.97 KB (+1.60%)
errors.js 413.89 KB 407.98 KB -5.92 KB (-1.43%)
globals.html 233.02 KB 227.26 KB -5.75 KB (-2.47%)
console.js 114.73 KB 109.19 KB -5.54 KB (-4.83%)
timers.html 127.13 KB 132.41 KB +5.28 KB (+4.15%)
repl.js 215.40 KB 210.38 KB -5.02 KB (-2.33%)
async_context.js 194.17 KB 189.36 KB -4.81 KB (-2.48%)
tty.js 54.21 KB 49.53 KB -4.69 KB (-8.64%)
https.js 166.44 KB 162.12 KB -4.32 KB (-2.60%)
globals.js 141.34 KB 137.23 KB -4.10 KB (-2.90%)
console.html 141.77 KB 145.74 KB +3.96 KB (+2.80%)
async_hooks.js 201.30 KB 197.36 KB -3.93 KB (-1.95%)
addons.html 259.25 KB 262.88 KB +3.63 KB (+1.40%)
path.html 134.30 KB 137.92 KB +3.62 KB (+2.69%)
async_context.html 158.79 KB 162.33 KB +3.53 KB (+2.23%)
repl.html 176.85 KB 180.33 KB +3.47 KB (+1.96%)
tty.html 90.61 KB 94.08 KB +3.47 KB (+3.83%)
https.html 145.76 KB 149.00 KB +3.24 KB (+2.22%)
async_hooks.html 155.61 KB 158.40 KB +2.80 KB (+1.80%)
cluster.html 192.01 KB 194.67 KB +2.66 KB (+1.39%)
packages.html 155.45 KB 153.09 KB -2.36 KB (-1.52%)
inspector.html 167.79 KB 170.04 KB +2.25 KB (+1.34%)
wasi.js 44.80 KB 42.59 KB -2.21 KB (-4.93%)
single-executable-applications.js 83.41 KB 81.24 KB -2.17 KB (-2.60%)
esm.js 139.78 KB 137.98 KB -1.80 KB (-1.29%)
domain.html 102.11 KB 103.85 KB +1.75 KB (+1.71%)
domain.js 93.08 KB 91.35 KB -1.72 KB (-1.85%)
querystring.js 33.02 KB 31.32 KB -1.70 KB (-5.16%)
punycode.js 30.23 KB 28.55 KB -1.69 KB (-5.58%)
packages.js 126.22 KB 124.83 KB -1.40 KB (-1.11%)
tracing.js 78.84 KB 77.59 KB -1.25 KB (-1.59%)
environment_variables.html 44.02 KB 42.79 KB -1.23 KB (-2.79%)
documentation.html 38.07 KB 36.92 KB -1.15 KB (-3.01%)
typescript.html 53.67 KB 52.54 KB -1.13 KB (-2.11%)
modules.html 177.98 KB 176.88 KB -1.10 KB (-0.62%)
synopsis.html 42.57 KB 41.51 KB -1.06 KB (-2.48%)
report.html 173.68 KB 174.66 KB +997.00 B (+0.56%)
permissions.html 54.77 KB 53.92 KB -866.00 B (-1.54%)
punycode.html 62.82 KB 62.00 KB -844.00 B (-1.31%)
string_decoder.js 32.32 KB 31.57 KB -769.00 B (-2.32%)
debugger.html 54.07 KB 53.38 KB -710.00 B (-1.28%)
index.html 35.67 KB 34.98 KB -700.00 B (-1.92%)
intl.html 57.62 KB 56.96 KB -680.00 B (-1.15%)
single-executable-applications.html 101.24 KB 101.89 KB +665.00 B (+0.64%)
embedding.html 58.88 KB 58.29 KB -598.00 B (-0.99%)
cli.js 325.51 KB 324.98 KB -546.00 B (-0.16%)
querystring.html 62.28 KB 62.81 KB +545.00 B (+0.85%)
tracing.html 83.44 KB 83.00 KB -449.00 B (-0.53%)
wasi.html 67.97 KB 68.33 KB +364.00 B (+0.52%)
deprecations.js 313.52 KB 313.32 KB -212.00 B (-0.07%)
permissions.js 28.46 KB 28.65 KB +202.00 B (+0.69%)
addons.js 299.72 KB 299.82 KB +105.00 B (+0.03%)
debugger.js 31.09 KB 31.19 KB +105.00 B (+0.33%)
report.js 188.53 KB 188.64 KB +105.00 B (+0.05%)
typescript.js 25.81 KB 25.91 KB +105.00 B (+0.40%)
environment_variables.js 15.13 KB 15.23 KB +100.00 B (+0.65%)
n-api.js 721.30 KB 721.40 KB +100.00 B (+0.01%)
documentation.js 9.72 KB 9.82 KB +95.00 B (+0.95%)
embedding.js 37.28 KB 37.37 KB +95.00 B (+0.25%)
index.js 9.51 KB 9.60 KB +95.00 B (+0.98%)
intl.js 37.06 KB 37.16 KB +95.00 B (+0.25%)
synopsis.js 15.70 KB 15.80 KB +95.00 B (+0.59%)
string_decoder.html 54.29 KB 54.33 KB +42.00 B (+0.08%)
esm.html 152.69 KB 152.69 KB -3.00 B (-0.00%)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements an announcement banner component that fetches configuration from a remote JSON endpoint to display global and version-specific banners on the API documentation pages. The banners support date-based activation/deactivation and can include links to relevant resources.

Changes:

  • Added AnnouncementBanner component that asynchronously fetches and displays banners from a remote config
  • Implemented isBannerActive utility function to filter banners based on date ranges
  • Added versionMajor and remoteConfig fields to static data passed from server to client

Reviewed changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/generators/web/index.mjs Adds remote config URL to web generator default configuration
src/generators/web/types.d.ts Adds remoteConfig type definition for the web generator
src/generators/web/utils/data.mjs Extracts version major and remote config URL from server config to client static data
src/generators/web/constants.mjs Registers AnnouncementBanner component in JSX imports map
src/generators/jsx-ast/utils/buildContent.mjs Adds AnnouncementBanner to document layout above navigation bar
src/generators/web/ui/utils/banner.mjs Implements date range checking logic for banner activation
src/generators/web/ui/utils/__tests__/banner.test.mjs Comprehensive tests for banner date range logic
src/generators/web/ui/components/AnnouncementBanner/types.d.ts Type definitions for banner entries and remote config structure
src/generators/web/ui/components/AnnouncementBanner/index.jsx Main component that fetches config and renders active banners

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

<div>
{banners.map(banner => (
<Banner key={banner.link} type={banner.type}>
{banner.link ? <a href={banner.link}>{banner.text}</a> : banner.text}
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

External URLs from the remote config are used directly in href attributes without validation. While React/Preact provides some protection against javascript: protocol URLs, there's still a potential security risk if the remote config source is compromised. Consider validating that banner.link uses an approved protocol (https://) or implementing an allowlist of acceptable domains to ensure only trusted URLs are rendered. This is especially important since the config is fetched from an external source.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@avivkeller @ovflowd what do you think? is this necessary? We don't do this on nodejs website

@ovflowd
Copy link
Member

ovflowd commented Feb 21, 2026

@araujogui please be aware this must 100% be a client-side only component. Since the value of this comes from being able to fetch this at page load, as docs are built only once for each version.

@ovflowd
Copy link
Member

ovflowd commented Feb 21, 2026

(this also means that this spec cannot ever change or needs to be forever retroactively compatible)

@avivkeller
Copy link
Member

please be aware this must 100% be a client-side only component

It is

@araujogui
Copy link
Member Author

araujogui commented Feb 21, 2026

@araujogui please be aware this must 100% be a client-side only component. Since the value of this comes from being able to fetch this at page load, as docs are built only once for each version.

uh, that also means we can't change the config url, so we should already create the config file on nodejs/node?

@ovflowd
Copy link
Member

ovflowd commented Feb 21, 2026

@araujogui please be aware this must 100% be a client-side only component. Since the value of this comes from being able to fetch this at page load, as docs are built only once for each version.

uh, that also means we can't change the config url, so we should already create the config file on nodejs/node?

Yeah... So we need to be very careful here 😓

@araujogui
Copy link
Member Author

araujogui commented Feb 25, 2026

@araujogui please be aware this must 100% be a client-side only component. Since the value of this comes from being able to fetch this at page load, as docs are built only once for each version.

uh, that also means we can't change the config url, so we should already create the config file on nodejs/node?

Yeah... So we need to be very careful here 😓

We already have a site.json on website repo, having another config file on nodejs/node looks like duplication?

@ovflowd
Copy link
Member

ovflowd commented Feb 25, 2026

@araujogui please be aware this must 100% be a client-side only component. Since the value of this comes from being able to fetch this at page load, as docs are built only once for each version.

uh, that also means we can't change the config url, so we should already create the config file on nodejs/node?

Yeah... So we need to be very careful here 😓

We already have a site.json on website repo, having another config file on nodejs/node looks like duplication?

We can use site.json, but note that it is not publicly available, the link would either need to be through raw.githubusercontent.com or we'd need to move the file to be publicly available.

@araujogui
Copy link
Member Author

@araujogui please be aware this must 100% be a client-side only component. Since the value of this comes from being able to fetch this at page load, as docs are built only once for each version.

uh, that also means we can't change the config url, so we should already create the config file on nodejs/node?

Yeah... So we need to be very careful here 😓

We already have a site.json on website repo, having another config file on nodejs/node looks like duplication?

We can use site.json, but note that it is not publicly available, the link would either need to be through raw.githubusercontent.com or we'd need to move the file to be publicly available.

I think raw.githubusercontent.com is good enough

@ovflowd
Copy link
Member

ovflowd commented Feb 26, 2026

@araujogui please be aware this must 100% be a client-side only component. Since the value of this comes from being able to fetch this at page load, as docs are built only once for each version.

uh, that also means we can't change the config url, so we should already create the config file on nodejs/node?

Yeah... So we need to be very careful here 😓

We already have a site.json on website repo, having another config file on nodejs/node looks like duplication?

We can use site.json, but note that it is not publicly available, the link would either need to be through raw.githubusercontent.com or we'd need to move the file to be publicly available.

I think raw.githubusercontent.com is good enough

IDK about that...

@MattIPv4
Copy link
Member

I'd be fine with using raw.githubusercontent.com at build time (like we do via nodevu on the site), but I don't think we should be reliant on hitting it client-side every time someone loads a page on the site, that feels like abuse of GitHub's service. Can we have a JSON file accessible via the site, or an API endpiont?

@ovflowd
Copy link
Member

ovflowd commented Feb 26, 2026

I'd be fine with using raw.githubusercontent.com at build time (like we do via nodevu on the site), but I don't think we should be reliant on hitting it client-side every time someone loads a page on the site, that feels like abuse of GitHub's service. Can we have a JSON file accessible via the site, or an API endpiont?

We won't be loading this at build-time, cause it is supposed to be a client-side only, so it would hit indeed on every page load. I don't think raw.githubusercontent.com has cache headers so it would not be good.

@araujogui
Copy link
Member Author

I'd be fine with using raw.githubusercontent.com at build time (like we do via nodevu on the site), but I don't think we should be reliant on hitting it client-side every time someone loads a page on the site, that feels like abuse of GitHub's service. Can we have a JSON file accessible via the site, or an API endpiont?

We won't be loading this at build-time, cause it is supposed to be a client-side only, so it would hit indeed on every page load. I don't think raw.githubusercontent.com has cache headers so it would not be good.

Okay, maybe we could expose site.json in an endpoint of the website

Copy link
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's put a block on this for now as this needs to be done thoughtfully


const active = [];

const globalBanner = config.websiteBanners?.index;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can have config.websiteBanners?.index and config.websiteBanners?.all, not sure which one to use here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement real-time (on-load) updates to API docs live-environment

5 participants