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

Upgrade doc website to Next14 #2825

Merged
merged 17 commits into from Mar 4, 2024
Merged

Upgrade doc website to Next14 #2825

merged 17 commits into from Mar 4, 2024

Conversation

carbonrobot
Copy link
Contributor

@carbonrobot carbonrobot commented Feb 29, 2024

Upgrades the documentation website from react-static to Next14.

Background

The current website is built with react-static. The react-static package has long been deprecated and no longer receives support. It has multiple issues with dependencies and will no longer run on Node17+ without using the insecure legacy-ssl option. Our hosting provider for this site is Vercel, which will stop running all Node16 sites in June.

At the same time, we recently upgraded our Babel configuration to target modern browsers instead of IE10, which reduces our bundle size significantly. But the version of react-static that is available will not compile with modern code due to its embedded webpack config. This meant we could not use a recent version of Victory on our docs site.

Next14

This PR attempts to achieve the minimal changes possible to launch a Nextjs site. The previous code was retained as much as possible in most cases. This was achieved roughly by using the Next CLI to generate a base project, copying the existing code into that project as-is, and building out the skeleton for app router.

Notable changes

  • The victory packages are now pnpm linked into the doc site, so you can develop and test the site locally with code changes
  • The docs/theme page is now fully markdown instead of a mix of markdown/js/jsx
  • The playground (live editor) now uses the newer react-live package and not our older component-playground package. This changed the styling/theme of the code editor a little bit
  • Minor adjustments to eslint config. The eslint version is newer and has slightly different rules for parsing TS

Interesting code

  • The docs route statically generates its pages at build time using markdown files in the content directory
  • The various layout files enable partial rendering for soft link navigation on the client side instead of hard reloading the page

Due to the size of the PR and the number of changes, the important part to review here is the actual preview site to look for issues. The code of the documentation site is less crucial for review since most of it is moved files and small adjustments. We can follow up quickly with any problems in a separate PR.

Preview Link: https://victory-git-docs-next-formidable-labs.vercel.app/open-source/victory

Copy link

changeset-bot bot commented Feb 29, 2024

⚠️ No Changeset found

Latest commit: 7ae48a0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Feb 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
victory ✅ Ready (Inspect) Visit Preview 6 resolved Mar 2, 2024 0:11am

@carbonrobot carbonrobot merged commit 77d6b8e into main Mar 4, 2024
6 checks passed
@carbonrobot carbonrobot deleted the docs/next branch March 4, 2024 13:57
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.

None yet

1 participant