Skip to content

feat(homepage): redraw the architecture diagram and keep its source - #2094

Open
shreemaan-abhishek wants to merge 3 commits into
apache:masterfrom
shreemaan-abhishek:homepage-architecture-diagram
Open

feat(homepage): redraw the architecture diagram and keep its source#2094
shreemaan-abhishek wants to merge 3 commits into
apache:masterfrom
shreemaan-abhishek:homepage-architecture-diagram

Conversation

@shreemaan-abhishek

Copy link
Copy Markdown
Contributor

Follow-up to #2073.

Architecture diagram

The homepage architecture diagram was an exported architecture.svg with no source, so any change meant redrawing it from scratch. This replaces it with a generated PNG plus the generator that produces it:

  • next/scripts/architecture/arch.html is the drawing: a 1200x738 canvas of absolutely-positioned boxes plus one SVG layer for the connectors, so boxes and the wires that land on them share a coordinate space.
  • next/scripts/architecture/render.sh shoots it in headless Chrome at 2x and palette-reduces the result to next/public/img/architecture.png (2400x1476, ~73 KB).

Edit the HTML and re-render; the PNG is generated output. Documented in next/README.md.

Two notes on the script:

  • Chrome writes the screenshot and can then sit there instead of exiting, so render.sh waits on the output file and kills the process rather than waiting on it.
  • The diagram uses the system sans stack, so label widths follow the rendering machine's fonts. Re-rendering on macOS reproduces the committed PNG; elsewhere expect small shifts. This is called out in the script header.

HomePage.astro, the mobile pan rule in global.css, and the asset assertion in deploy.yml all move from the SVG to the PNG.

Dead Docusaurus section

website/src/components/sections/Architecture.tsx still imported the old Architecture-min.svg. Since the Astro build replaces index.html, that section no longer reaches users, but it still compiled and pulled in a 35 KB SVG. Removed, along with its scss, the two SVGs it exclusively imported, and the now-dead architecture.component.* zh translations.

The scss also declared .testimonials-head, .docs-promo-head, .oss-promo-head, .add-left-margin and .arch-scale-svg. customTheme.scss already declares all of them, and .add-left-margin (used by Benefits.tsx) is the only one that appears in any markup, so nothing loses styling.

Verification

  • npx astro build passes, 36 pages. dist/img/architecture.png is present, with no architecture.svg or stray variants left behind.
  • website/src/pages/index.tsx parses clean under esbuild after the import removal.
  • i18n/zh/code.json is still valid JSON.

The full Docusaurus build was not run locally, so CI is what will confirm that half. The change there is a deletion of an unreferenced component.

The old architecture.svg was an exported drawing with no source, so it
could only be replaced wholesale. Redraw it as HTML/CSS and commit the
generator alongside the output.

- scripts/architecture/arch.html is the drawing: a 1200x738 canvas of
  absolutely-positioned boxes plus one SVG layer for the connectors, so
  boxes and the wires that land on them share a coordinate space.
- scripts/architecture/render.sh shoots it in headless Chrome at 2x and
  palette-reduces to public/img/architecture.png (2400x1476, ~73 KB).

Chrome writes the screenshot and can then sit there instead of exiting,
so render.sh waits on the output file and kills the process.
The Astro homepage replaces index.html, so this section no longer
reaches users, but it still compiled and pulled in a 35 KB SVG.

Removes the component, its scss, the two SVGs it exclusively imported,
and the now-dead architecture.component.* zh translations.

The scss also declared .testimonials-head, .docs-promo-head,
.add-left-margin and .arch-scale-svg. customTheme.scss already declares
all of them, and .add-left-margin (Benefits.tsx) is the only one that
appears in any markup, so nothing loses styling.
…diagram

# Conflicts:
#	website/src/pages/index.tsx
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.

1 participant