Skip to content

Commit e6221f0

Browse files
ci: apply automated fixes
1 parent 4fe254f commit e6221f0

File tree

10 files changed

+71
-52
lines changed

10 files changed

+71
-52
lines changed

rsc-migration-report.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,16 @@ Notes:
4343

4444
Gzipped client JS, before vs after.
4545

46-
| Page | Before | After | Delta |
47-
|---|---:|---:|---:|
48-
| `/blog/react-server-components` | 547,196 B | 394,207 B | -152,989 B |
49-
| `/router/latest/docs/overview` | 563,295 B | 410,644 B | -152,651 B |
50-
| `/router/latest/docs/framework/react/examples/basic` | 421,421 B | 381,079 B | -40,342 B |
51-
| `/table/latest` | 451,744 B | 409,455 B | -42,289 B |
52-
| `/query/latest` | 405,185 B | 412,671 B | +7,486 B |
53-
| `/router/latest` | 403,281 B | 411,259 B | +7,978 B |
54-
| `/form/latest` | 401,951 B | 409,389 B | +7,438 B |
55-
| `/virtual/latest` | 401,535 B | 409,044 B | +7,509 B |
46+
| Page | Before | After | Delta |
47+
| ---------------------------------------------------- | --------: | --------: | ---------: |
48+
| `/blog/react-server-components` | 547,196 B | 394,207 B | -152,989 B |
49+
| `/router/latest/docs/overview` | 563,295 B | 410,644 B | -152,651 B |
50+
| `/router/latest/docs/framework/react/examples/basic` | 421,421 B | 381,079 B | -40,342 B |
51+
| `/table/latest` | 451,744 B | 409,455 B | -42,289 B |
52+
| `/query/latest` | 405,185 B | 412,671 B | +7,486 B |
53+
| `/router/latest` | 403,281 B | 411,259 B | +7,978 B |
54+
| `/form/latest` | 401,951 B | 409,389 B | +7,438 B |
55+
| `/virtual/latest` | 401,535 B | 409,044 B | +7,509 B |
5656

5757
### Bundle Takeaways
5858

@@ -145,11 +145,11 @@ Architectural simplifications:
145145

146146
Captured before shipping these changes.
147147

148-
| Page | Score | FCP | LCP | Speed Index | TBT | CLS | Interactive | Bytes | Requests |
149-
|---|---:|---:|---:|---:|---:|---:|---:|---:|---:|
150-
| `/query/latest` | 80 | 2.8s | 3.4s | 3.4s | 300ms | 0.001 | 6.1s | 765 KiB | 89 |
151-
| `/blog/react-server-components` | 52 | 3.3s | 3.7s | 3.6s | 1,200ms | 0.15 | 7.8s | 1,101 KiB | 60 |
152-
| `/router/latest/docs/overview` | 78 | 3.0s | 3.6s | 3.9s | 280ms | 0.002 | 7.5s | 917 KiB | 81 |
148+
| Page | Score | FCP | LCP | Speed Index | TBT | CLS | Interactive | Bytes | Requests |
149+
| ------------------------------- | ----: | ---: | ---: | ----------: | ------: | ----: | ----------: | --------: | -------: |
150+
| `/query/latest` | 80 | 2.8s | 3.4s | 3.4s | 300ms | 0.001 | 6.1s | 765 KiB | 89 |
151+
| `/blog/react-server-components` | 52 | 3.3s | 3.7s | 3.6s | 1,200ms | 0.15 | 7.8s | 1,101 KiB | 60 |
152+
| `/router/latest/docs/overview` | 78 | 3.0s | 3.6s | 3.9s | 280ms | 0.002 | 7.5s | 917 KiB | 81 |
153153

154154
Notes:
155155

@@ -162,11 +162,11 @@ Notes:
162162

163163
Fill this in after deploy to `main` and re-run Lighthouse on the same production URLs.
164164

165-
| Page | Before Score | After Score | Before LCP | After LCP | Before TBT | After TBT | Before Bytes | After Bytes | Notes |
166-
|---|---:|---:|---:|---:|---:|---:|---:|---:|---|
167-
| `/query/latest` | 80 | | 3.4s | | 300ms | | 765 KiB | | |
168-
| `/blog/react-server-components` | 52 | | 3.7s | | 1,200ms | | 1,101 KiB | | |
169-
| `/router/latest/docs/overview` | 78 | | 3.6s | | 280ms | | 917 KiB | | |
165+
| Page | Before Score | After Score | Before LCP | After LCP | Before TBT | After TBT | Before Bytes | After Bytes | Notes |
166+
| ------------------------------- | -----------: | ----------: | ---------: | --------: | ---------: | --------: | -----------: | ----------: | ----- |
167+
| `/query/latest` | 80 | | 3.4s | | 300ms | | 765 KiB | | |
168+
| `/blog/react-server-components` | 52 | | 3.7s | | 1,200ms | | 1,101 KiB | | |
169+
| `/router/latest/docs/overview` | 78 | | 3.6s | | 280ms | | 917 KiB | | |
170170

171171
## Conclusions So Far
172172

src/components/markdown/CodeBlock.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ import { fetchRenderedCodeBlock } from '~/utils/codeBlock.functions'
1212

1313
const renderCache = new Map<string, Promise<RenderedCodeBlockData>>()
1414

15-
function getRenderPromise(key: string, data: { code: string; lang: string; title?: string }) {
15+
function getRenderPromise(
16+
key: string,
17+
data: { code: string; lang: string; title?: string },
18+
) {
1619
const cached = renderCache.get(key)
1720

1821
if (cached) {
@@ -27,7 +30,9 @@ function getRenderPromise(key: string, data: { code: string; lang: string; title
2730

2831
export function CodeBlock(props: CodeBlockProps) {
2932
const { code, lang, title } = extractCodeBlockData(props)
30-
const [rendered, setRendered] = React.useState<RenderedCodeBlockData | null>(null)
33+
const [rendered, setRendered] = React.useState<RenderedCodeBlockData | null>(
34+
null,
35+
)
3136

3237
React.useEffect(() => {
3338
let cancelled = false

src/components/markdown/FrameworkContent.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ type FrameworkContentProps = {
1010
children?: ReactNode
1111
}
1212

13-
function isFrameworkPanel(
14-
child: ReactNode,
15-
): child is React.ReactElement<{
13+
function isFrameworkPanel(child: ReactNode): child is React.ReactElement<{
1614
'data-framework': string
1715
children?: ReactNode
1816
}> {
@@ -22,9 +20,7 @@ function isFrameworkPanel(
2220
)
2321
}
2422

25-
export function FrameworkContent({
26-
children,
27-
}: FrameworkContentProps) {
23+
export function FrameworkContent({ children }: FrameworkContentProps) {
2824
const { framework: paramsFramework } = useParams({ strict: false })
2925
const localCurrentFramework = useLocalCurrentFramework()
3026
const userQuery = useCurrentUserQuery()
@@ -39,8 +35,9 @@ export function FrameworkContent({
3935
const panels = Children.toArray(children).filter(isFrameworkPanel)
4036
const fallbackPanel = panels[0]
4137
const activePanel =
42-
panels.find((child) => child.props['data-framework'] === normalizedFramework) ||
43-
fallbackPanel
38+
panels.find(
39+
(child) => child.props['data-framework'] === normalizedFramework,
40+
) || fallbackPanel
4441

4542
if (!activePanel || !isValidElement(activePanel)) {
4643
return null

src/components/markdown/MdComponents.tsx

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ export function MdCommentComponent({
5757
}: MdCommentComponentProps) {
5858
const parsedAttributes = parseJson(rawAttributes)
5959
const attributes =
60-
parsedAttributes && typeof parsedAttributes === 'object' ? parsedAttributes : {}
60+
parsedAttributes && typeof parsedAttributes === 'object'
61+
? parsedAttributes
62+
: {}
6163

6264
const normalizedComponentName = componentName?.toLowerCase()
6365

@@ -74,7 +76,10 @@ export function MdCommentComponent({
7476
typeof parsedPackageManagerMeta.packagesByFramework === 'object'
7577
) {
7678
const frameworkPanels = Object.entries(
77-
parsedPackageManagerMeta.packagesByFramework as Record<string, string[][]>,
79+
parsedPackageManagerMeta.packagesByFramework as Record<
80+
string,
81+
string[][]
82+
>,
7883
).flatMap(([framework, packageGroups]) => {
7984
return PACKAGE_MANAGERS.map((packageManager) => {
8085
const commandText = getInstallCommand(
@@ -105,9 +110,14 @@ export function MdCommentComponent({
105110

106111
const parsedFilesMeta = parseJson(filesMeta)
107112

108-
if (parsedFilesMeta && typeof parsedFilesMeta === 'object' && panels.length) {
113+
if (
114+
parsedFilesMeta &&
115+
typeof parsedFilesMeta === 'object' &&
116+
panels.length
117+
) {
109118
const tabs = Array.isArray((attributes as { tabs?: unknown }).tabs)
110-
? ((attributes as { tabs: Array<{ name: string; slug: string }> }).tabs ?? [])
119+
? ((attributes as { tabs: Array<{ name: string; slug: string }> })
120+
.tabs ?? [])
111121
: []
112122

113123
return (
@@ -118,14 +128,17 @@ export function MdCommentComponent({
118128
}
119129

120130
const tabs = Array.isArray((attributes as { tabs?: unknown }).tabs)
121-
? ((attributes as { tabs: Array<{ name: string; slug: string }> }).tabs ?? [])
131+
? ((attributes as { tabs: Array<{ name: string; slug: string }> }).tabs ??
132+
[])
122133
: []
123134

124135
if (!tabs.length) {
125136
return <div>{children}</div>
126137
}
127138

128-
return <Tabs tabs={tabs}>{panels.map((panel) => panel.props.children)}</Tabs>
139+
return (
140+
<Tabs tabs={tabs}>{panels.map((panel) => panel.props.children)}</Tabs>
141+
)
129142
}
130143

131144
if (normalizedComponentName === 'framework') {

src/routes/intent/registry/$packageName.$skillName.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ import {
77
intentVersionSkillsQueryOptions,
88
intentSingleSkillHistoryQueryOptions,
99
} from '~/queries/intent'
10-
import { getIntentSkillPage, type SkillVersionEntry } from '~/utils/intent.functions'
10+
import {
11+
getIntentSkillPage,
12+
type SkillVersionEntry,
13+
} from '~/utils/intent.functions'
1114
import { CopyPageDropdown } from '~/components/CopyPageDropdown'
1215
import { SkillSparkline } from '~/components/intent/SkillSparkline'
1316
import {

src/utils/blog.functions.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@ export const fetchBlogPost = createServerFn({ method: 'GET' })
9393
${post.content}`
9494

9595
const { contentRsc, headings } = await renderMarkdownToRsc(blogContent)
96-
const isUnpublished =
97-
post.draft || !isPublishedDateReleased(post.published)
96+
const isUnpublished = post.draft || !isPublishedDateReleased(post.published)
9897

9998
return {
10099
authors: post.authors,

src/utils/codeBlock.functions.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ export const fetchRenderedCodeBlock = createServerFn({ method: 'POST' })
1212
}),
1313
)
1414
.handler(async ({ data }) => {
15-
const { renderCodeBlockData } = await import(
16-
'~/components/markdown/renderCodeBlock.server'
17-
)
15+
const { renderCodeBlockData } =
16+
await import('~/components/markdown/renderCodeBlock.server')
1817

1918
return renderCodeBlockData(data)
2019
})

src/utils/intent.functions.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,10 @@ function stripFrontmatter(content: string) {
513513
return content
514514
}
515515

516-
return lines.slice(closing + 1).join('\n').trimStart()
516+
return lines
517+
.slice(closing + 1)
518+
.join('\n')
519+
.trimStart()
517520
}
518521

519522
export const getIntentSkillPage = createServerFn({ method: 'GET' })
@@ -526,7 +529,9 @@ export const getIntentSkillPage = createServerFn({ method: 'GET' })
526529
)
527530
.handler(async ({ data }) => {
528531
const versions = await getPackageVersions(data.packageName)
529-
const versionRecord = versions.find((version) => version.version === data.version)
532+
const versionRecord = versions.find(
533+
(version) => version.version === data.version,
534+
)
530535

531536
if (!versionRecord) {
532537
return null
@@ -562,7 +567,9 @@ export const getIntentSkillMarkdown = createServerFn({ method: 'GET' })
562567
)
563568
.handler(async ({ data }) => {
564569
const versions = await getPackageVersions(data.packageName)
565-
const versionRecord = versions.find((version) => version.version === data.version)
570+
const versionRecord = versions.find(
571+
(version) => version.version === data.version,
572+
)
566573

567574
if (!versionRecord) {
568575
return null

src/utils/landing-code-example.functions.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ export const fetchLandingCodeExample = createServerFn({ method: 'GET' })
1010
}),
1111
)
1212
.handler(async ({ data }) => {
13-
const { renderLandingCodeExample } = await import(
14-
'~/components/landing/codeExamples.server'
15-
)
13+
const { renderLandingCodeExample } =
14+
await import('~/components/landing/codeExamples.server')
1615
const content = renderLandingCodeExample(data.libraryId)
1716

1817
if (!content) {

vite.config.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@ const rscSsrExternals = [
3333
'discord-interactions',
3434
]
3535

36-
const sentrySsrExternals = [
37-
'@sentry/node',
38-
'@sentry/tanstackstart-react',
39-
]
36+
const sentrySsrExternals = ['@sentry/node', '@sentry/tanstackstart-react']
4037

4138
export default defineConfig({
4239
resolve: {

0 commit comments

Comments
 (0)