-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
refactor: download archive page unnecessary checks #8134
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this 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 refactors the download archive page by removing unnecessary validation checks and error handling that are deemed redundant given the context of how the page is accessed. The changes include simplifying the version extraction logic and updating the UI to provide more prominent links to version-specific information.
- Simplified
extractVersionFromPath
function by removing null checks and version format validation - Removed error handling in
WithDownloadArchive
component that was checking for null versions - Added changelog and blog post links higher up in the archive page UI
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
apps/site/util/download/archive.tsx |
Simplified version extraction by removing validation checks and making the parameter non-optional |
apps/site/components/withDownloadArchive.tsx |
Removed null checks, unused imports, and simplified version matching logic |
apps/site/pages/en/download/archive/index.mdx |
Added changelog and blog post links to provide better access to version information |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8134 +/- ##
==========================================
- Coverage 76.60% 76.55% -0.05%
==========================================
Files 115 115
Lines 9595 9602 +7
Branches 321 323 +2
==========================================
+ Hits 7350 7351 +1
- Misses 2244 2250 +6
Partials 1 1 ☔ View full report in Codecov by Sentry. |
I'll check why the |
apps/site/redirects.json
Outdated
@@ -332,6 +332,10 @@ | |||
"source": "/:locale/download/source-code/current", | |||
"destination": "/:locale/download/current" | |||
}, | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the file (/pages/download/archive/index.mdx
) is under the pages directory, it maps to /download/archive
(When we remove version control, it drops to 500 page because there is no version named archive
). In fact, this file doesn’t really need to live under pages
directory
- Store the dynamically generated markdown files in a different directory instead of
pages
- Redirect
/download/archive
to/download/archive/current
- Use an existing version(eg:
v22.0.0.mdx
) as the filename instead ofindex.mdx
IDK wich one suits for us better, for a quick fix i added this redirect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah this will also cause errors at build time 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDK, instead of going for an overkill solution, I added back the release check for now
Description
I’ve made some small refactors on the download archive page, per related comments here;
#7794 (comment)
#7794 (comment)
In addition to this PR, I’ve also added the changelog of the displayed version to the section where we provide version-related information. Since this information is valuable, I believe placing the links higher up makes more sense
Check List
pnpm format
to ensure the code follows the style guide.pnpm test
to check if all tests are passing.pnpm build
to check if the website builds without errors.