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(infra): migrate to next.js infrastructure #4981

Closed
wants to merge 20 commits into from
Closed

feat(infra): migrate to next.js infrastructure #4981

wants to merge 20 commits into from

Conversation

ovflowd
Copy link
Member

@ovflowd ovflowd commented Dec 23, 2022

This PR is a draft to migrate the underlying infrastructure from Handlebars and Metalsmith to JSX (React) and Next.js.

Changes

Legacy Content Removal

  • Black Live Matters Layouts
  • Knowledge Base Pages and Layouts
  • Node.js scripts specific to Handlebars and Metalsmith
  • Legacy static files
  • Metalsmith scripts and build system
  • Handlebars specific content

The items above are considered legacy content and pages.

Migration of Structure

A few directories are changed to accommodate the new Next.js folder structure. Notably, these are the significant changes:

  • Some Handlebar utilities became React Components under src/components
  • Sass files (SCSS) were moved to src/styles
  • The pages were moved from locale/{languageCode}/{folder}/{filename}.md to pages/{folder}/{filename}.{languageCode}.mdx (Plain .md when no React Component is needed)
  • Static Files were moved from static/ to public/static (Links will be preserved)
  • Layouts will be ported over React to src/layouts
  • Data files (such as versions.json and schedule.json) were moved to src/data
  • I18n Configuration files and Translations will be moved unto src/i18n

The deletion of per-locale site.json and creation of a global site.json

i18n specific metatdata will be moved to src/i18n/locales.json as the aggregate of all i18n metadata. Specific translation texts (such as "Next" button) or other translated text will be moved to i18n localization files such as src/i18n/locales/en.json. This is the same approach adopted currently on nodejs.dev repository to ease the migration.

Navigation structure and other non-related global metadata will be moved towards a global src/data/site.json and respectively for Navigation to pages/_meta.json files.

Migration of Handlebars Templates to JSX

A lot of the current "Handlebars" scripts (for templating-engine) will be ported to either JavaScript utils or JSX Components, and the current Layouts will be ported to JSX too.

Things to be done (Within this PR)

Since this PR is in a draft state, there are still a few things to be done before we can say we're ready to get this PR reviewed:

  • Migrate SEO and Meta Tags and all other kinds of metadata
  • Migrate the i18n metadata and translations
  • Migrate the Handlebars scripts and Layouts to JSX
  • Migrate all locale/ pages to the new directory and file structure format
  • Update all pages of Frontmatter
  • Move all blog posts to the new pages folder and new file format and update its Frontmatter
  • Update all Markdown files such as README, CONTRIBUTING and et cetera
  • Update configuration files such as Crodwin to be still compatible
  • Migrate the GitHub Actions to be compatible with the new build system
  • Verify that the new tooling can successfully deploy to the Node.js website Infrastructure

Migration from old tooling/scripts

Currently, we have scripts to generate the metadata of releases, versions, and the release schedule of Node.js; we should adopt the nodes from Nodejs.dev as they're going to be adopted anyways. This can be done either in this PR or in a follow-up, depending on the complexity of migrating the current scripts.

Open Questions

  • How to include Sass support into Nextra (Next.js)
  • How to make a custom theme without a Monorepo?
  • Adding an RSS feed here

Items to be done after this PR

As mentioned, this is an initial implementation for this issue, following-up there will still be some improvements to be done, such as removing more legacy content and normalizing the JSX code and a few other things.

After that, we can start porting the layout and content from the Nodejs.dev repository.


Relates to #4958

cc @nodejs/website @nodejs/nodejs-dev @nodejs/build

@@ -1,5 +1,3 @@
# Generated HTML and other static files
build/
Copy link
Contributor

Choose a reason for hiding this comment

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

Claudio does not forget the .next (it is not a priority)

@ovflowd
Copy link
Member Author

ovflowd commented Jan 3, 2023

Closing this PR in favor of #4991

@ovflowd ovflowd closed this Jan 3, 2023
@ovflowd ovflowd deleted the feat/next-js branch January 3, 2023 22:52
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.

2 participants