-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
feat: create release schedule component #8529
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import { create } from 'lts'; | ||
|
|
||
| import provideReleaseSchedule from '#site/next-data/providers/releaseSchedule'; | ||
|
|
||
| import type { FC } from 'react'; | ||
|
|
||
| const ReleaseSchedule: FC = async () => { | ||
| const schedule = await provideReleaseSchedule(); | ||
|
|
||
| const now = new Date(); | ||
|
|
||
| const threeMonthsAgo = new Date(now); | ||
| threeMonthsAgo.setMonth(now.getMonth() - 3); | ||
|
|
||
| const sixMonthsFromNow = new Date(); | ||
| sixMonthsFromNow.setMonth(now.getMonth() + 6); | ||
|
|
||
| const svg = create({ | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is showing a warning that I'm not sure how to solve: |
||
| data: schedule, | ||
| queryStart: threeMonthsAgo, | ||
| queryEnd: sixMonthsFromNow, | ||
| animate: true, | ||
| excludeMain: false, | ||
| projectName: 'Node.js', | ||
| currentDateMarker: 'red', | ||
| }); | ||
araujogui marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| return ( | ||
| <div | ||
| dangerouslySetInnerHTML={{ __html: svg.html() }} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While I understand the reason for this, is there a way to avoid this potentially dangerous situation?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not that I'm aware of, |
||
| className="h-auto w-auto" | ||
| /> | ||
|
Comment on lines
+28
to
+32
|
||
| ); | ||
| }; | ||
|
|
||
| export default ReleaseSchedule; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import { RELEASE_SCHEDULE_URL } from '#site/next.constants.mjs'; | ||
| import { fetchWithRetry } from '#site/util/fetch'; | ||
|
|
||
| async function fetchReleaseSchedule() { | ||
| const response = await fetchWithRetry(RELEASE_SCHEDULE_URL); | ||
|
|
||
| return response.json(); | ||
| } | ||
|
|
||
| export default fetchReleaseSchedule; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import { cache } from 'react'; | ||
|
|
||
| import generateReleaseSchdule from '#site/next-data/generators/releaseSchedule.mjs'; | ||
|
|
||
| export default cache(generateReleaseSchdule); |
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably need to exclude this file.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we do that, all our CI steps that rely on types will need to call For this PR, the change should just be reverted.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I meant exclude == reverting the change * |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| /// <reference types="next" /> | ||
| /// <reference types="next/image-types/global" /> | ||
| /// <reference types="next/navigation-types/compat/navigation" /> | ||
| import './.next/types/routes.d.ts'; | ||
| import './.next/dev/types/routes.d.ts'; | ||
|
|
||
| // NOTE: This file should not be edited | ||
| // see https://nextjs.org/docs/app/api-reference/config/typescript for more information. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,6 +58,7 @@ | |
| "feed": "~5.1.0", | ||
| "github-slugger": "~2.0.0", | ||
| "gray-matter": "~4.0.3", | ||
| "lts": "github:araujogui/lts-schedule#refactor-website", | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can use the upstream package once this pr is merged
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding blocked until then |
||
| "mdast-util-to-string": "^4.0.0", | ||
| "next": "16.0.10", | ||
| "next-intl": "~4.5.3", | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.