Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(build): split rendering index.html from building index.json #10953

Merged
merged 21 commits into from
Jun 19, 2024
Merged

Conversation

fiji-flo
Copy link
Contributor

@fiji-flo fiji-flo commented Apr 18, 2024

Important

Deprecation notice
Rendering index.html files as part of the build command is now DEPRECATED, and will no longer be supported in Yari v3. To resolve this warning, add the -n (--nohtml) option.

Summary

(MP-1174 e.a.)

Problem

Currently, building the index.json files and rendering the index.html files happens in a single step via the yarn build command. Although it's possible to only build the index.json files via yarn build -n, it is not possible to only render the index.html files.

Solution

  1. Split rendering the index.html files into a separate command (yarn render:html).
  2. Introduce a new explicit command for building the JSON files for docs (yarn build:docs).
  3. Reuse the render:html command to render static pages (aka "SPAs"), by ensuring the corresponding builds produce index.jsons (that just contain a pageTitle and a url for now).
  4. Show a deprecation warning (see above) when yarn build is called without the -n flag.

Screenshots

(No visual change.)


How did you test this change?

Ran a full build locally on main and on this branch, and compared the resulting build output. The only changes identified were as follows:

  • There are now index.json files for all static pages ("SPAs").
  • The og:url field now contains the correct URL for static pages ("SPAs"), instead of the base URL.
  • All index.jsons now contain a url field, which is replicated in the hydration data of the index.html, but not part of the metadata.json.

@fiji-flo fiji-flo force-pushed the ssr2.1 branch 2 times, most recently from 7091f33 to bbcab3d Compare April 22, 2024 14:17
@github-actions github-actions bot added the merge conflicts 🚧 Please rebase onto or merge the latest main. label Apr 25, 2024
Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@fiji-flo fiji-flo force-pushed the ssr2.1 branch 2 times, most recently from 4e5e120 to d6e8dd6 Compare April 25, 2024 19:17
@github-actions github-actions bot removed the merge conflicts 🚧 Please rebase onto or merge the latest main. label Apr 25, 2024
@fiji-flo fiji-flo changed the title feat(SSR): split index.json and SSR feat(SSR): split building index.json and SSR into two Apr 26, 2024
package.json Outdated Show resolved Hide resolved
@fiji-flo fiji-flo mentioned this pull request Apr 30, 2024
6 tasks
Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@github-actions github-actions bot added the merge conflicts 🚧 Please rebase onto or merge the latest main. label Apr 30, 2024
@github-actions github-actions bot removed the merge conflicts 🚧 Please rebase onto or merge the latest main. label May 17, 2024
Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@github-actions github-actions bot added the merge conflicts 🚧 Please rebase onto or merge the latest main. label May 27, 2024
@caugner caugner changed the title feat(SSR): split building index.json and SSR into two feat(build)!: split building index.json from rendering index.html Jun 6, 2024
@caugner caugner self-assigned this Jun 6, 2024
@github-actions github-actions bot removed the merge conflicts 🚧 Please rebase onto or merge the latest main. label Jun 14, 2024
@caugner caugner changed the title feat(build)!: split building index.json from rendering index.html feat(build)!: split building (index.json) from rendering (index.html) Jun 14, 2024
@caugner caugner changed the title feat(build)!: split building (index.json) from rendering (index.html) feat(build)!: split rendering (index.html) from building (index.json) Jun 14, 2024
@caugner caugner changed the title feat(build)!: split rendering (index.html) from building (index.json) feat(build): split rendering (index.html) from building (index.json) Jun 14, 2024
@caugner caugner changed the title feat(build): split rendering (index.html) from building (index.json) feat(build): split rendering index.html from building index.json Jun 14, 2024
@caugner caugner marked this pull request as ready for review June 14, 2024 13:25
@caugner caugner requested review from mdn-bot and a team as code owners June 14, 2024 13:25
@caugner
Copy link
Contributor

caugner commented Jun 14, 2024

This is now deployed to stage.

Copy link
Contributor Author

@fiji-flo fiji-flo left a comment

Choose a reason for hiding this comment

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

This looks good. Should we get it on stage one more time and then merge?

@caugner
Copy link
Contributor

caugner commented Jun 19, 2024

Should we get it on stage one more time and then merge?

This is still deployed on stage, since 2024-06-14.

@caugner caugner merged commit acc0ede into main Jun 19, 2024
16 checks passed
@caugner caugner deleted the ssr2.1 branch June 19, 2024 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants