From c019827fa69eae9414bd28c7579d9180a1fdddc5 Mon Sep 17 00:00:00 2001 From: "Amir H. Hashemi" <87268103+amirhhashemi@users.noreply.github.com> Date: Thu, 1 May 2025 09:02:12 +0330 Subject: [PATCH] Fix broken highlights --- .../reference/reactive-utilities/untrack.mdx | 4 ++-- .../reference/data-apis/use-submissions.mdx | 4 ++-- .../solid-start/guides/data-fetching.mdx | 24 +++++++++---------- .../solid-start/guides/data-mutation.mdx | 4 ++-- src/routes/solid-start/guides/security.mdx | 2 +- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/routes/reference/reactive-utilities/untrack.mdx b/src/routes/reference/reactive-utilities/untrack.mdx index 22afb01d15..136ed1d832 100644 --- a/src/routes/reference/reactive-utilities/untrack.mdx +++ b/src/routes/reference/reactive-utilities/untrack.mdx @@ -20,7 +20,7 @@ export function Component(props) { It is not necessary to manually untrack values that are suppose to serve as a default or initial value to a signal. Even with the linter configured to enforce tracking, the linter will accept it when a `prop` is prefixed with `default` or `initial` as it is a common pattern to use them as such. -```tsx tab title="initialValue" {4} +```tsx tab title="initialValue" {5} // component.tsx import { createSignal } from "solid-js" @@ -32,7 +32,7 @@ export function Component(props) { } ``` -```tsx tab title="defaultValue" {4} +```tsx tab title="defaultValue" {5} // component.tsx import { createSignal } from "solid-js" diff --git a/src/routes/solid-router/reference/data-apis/use-submissions.mdx b/src/routes/solid-router/reference/data-apis/use-submissions.mdx index 592de69d89..b17232eae5 100644 --- a/src/routes/solid-router/reference/data-apis/use-submissions.mdx +++ b/src/routes/solid-router/reference/data-apis/use-submissions.mdx @@ -91,7 +91,7 @@ When the form is submitted, the `submission` object will be updated with the new This allows you to provide feedback to the user that the action is in progress. Once the action is complete, the `pending` property will be set to `false` and the `result` property will be updated with final value. -```tsx tab title="TypeScript" {5,12-19} +```tsx tab title="TypeScript" {6,13-20} // component.tsx import { Show } from "solid-js"; import { useSubmissions } from "@solidjs/router"; @@ -122,7 +122,7 @@ function Component() { } ``` -```tsx tab title="JavaScript" {5,12-19} +```tsx tab title="JavaScript" {6,13-20} // component.jsx import { Show } from "solid-js"; import { useSubmissions } from "@solidjs/router"; diff --git a/src/routes/solid-start/guides/data-fetching.mdx b/src/routes/solid-start/guides/data-fetching.mdx index b0bd1abeb1..2c80537a53 100644 --- a/src/routes/solid-start/guides/data-fetching.mdx +++ b/src/routes/solid-start/guides/data-fetching.mdx @@ -64,7 +64,7 @@ To show a loading UI during data-fetching: 1. Import [`Suspense`](/reference/components/suspense) from `solid-js`. 2. Wrap your data rendering in ``, and use the `fallback` prop to show a component during data fetching. -```tsx tab title="TypeScript" {13} {15} +```tsx tab title="TypeScript" {14} {16} // src/routes/index.tsx import { Suspense, For } from "solid-js"; import { query, createAsync } from "@solidjs/router"; @@ -86,7 +86,7 @@ export default function Page() { } ``` -```jsx tab title="JavaScript" {13} {15} +```jsx tab title="JavaScript" {14} {16} // src/routes/index.jsx import { Suspense, For } from "solid-js"; import { query, createAsync } from "@solidjs/router"; @@ -115,7 +115,7 @@ To show a fallback UI if the data-fetching fails: 1. Import [`ErrorBoundary`](/reference/components/error-boundary) from `solid-js`. 2. Wrap the data rendering in ``, and use the `fallback` prop to show a component if an error occurs. -```tsx tab title="TypeScript" {13} {17} +```tsx tab title="TypeScript" {14} {18} // src/routes/index.tsx import { ErrorBoundary, Suspense, For } from "solid-js"; import { query, createAsync } from "@solidjs/router"; @@ -139,7 +139,7 @@ export default function Page() { } ``` -```jsx tab title="JavaScript" {13} {17} +```jsx tab title="JavaScript" {14} {18} // src/routes/index.jsx import { ErrorBoundary, Suspense, For } from "solid-js"; import { query, createAsync } from "@solidjs/router"; @@ -171,7 +171,7 @@ Data fetching can be optimized during user navigation by preloading the data: 2. Run your query inside the `preload` function. 3. Use the query as usual in your component. -```tsx tab title="TypeScript" {9-11} +```tsx tab title="TypeScript" {10-12} // src/routes/index.tsx import { ErrorBoundary } from "solid-js"; import { query, createAsync, type RouteDefinition } from "@solidjs/router"; @@ -197,7 +197,7 @@ export default function Page() { } ``` -```jsx tab title="JavaScript" {9-11} +```jsx tab title="JavaScript" {10-12} // src/routes/index.jsx import { ErrorBoundary } from "solid-js"; import { query, createAsync } from "@solidjs/router"; @@ -227,7 +227,7 @@ export default function Page() { When creating a query that accepts parameters, define your query function to take any number of arguments: -```tsx tab title="TypeScript" {4} {10} {15} +```tsx tab title="TypeScript" {5} {11} {16} // src/routes/posts/[id]/index.tsx import { ErrorBoundary } from "solid-js"; import { query, createAsync, type RouteDefinition } from "@solidjs/router"; @@ -254,7 +254,7 @@ export default function Page() { } ``` -```jsx tab title="JavaScript" {4} {10} {15} +```jsx tab title="JavaScript" {5} {11} {16} // src/routes/posts/[id]/index.jsx import { ErrorBoundary } from "solid-js"; import { query, createAsync } from "@solidjs/router"; @@ -285,7 +285,7 @@ export default function Page() { To safely interact with your database or ORM in a query, ensure it's server-only by adding [`"use server"`](/solid-start/reference/server/use-server) as the first line of your query: -```tsx tab title="TypeScript" {6-7} +```tsx tab title="TypeScript" {7-8} // src/routes/index.tsx import { For, ErrorBoundary } from "solid-js"; import { query, createAsync, type RouteDefinition } from "@solidjs/router"; @@ -312,7 +312,7 @@ export default function Page() { } ``` -```jsx tab title="JavaScript" {6-7} +```jsx tab title="JavaScript" {7-8} // src/routes/index.jsx import { For, ErrorBoundary } from "solid-js"; import { query, createAsync } from "@solidjs/router"; @@ -343,7 +343,7 @@ export default function Page() { To fetch data only on the client, use the [`createResource`](/reference/basic-reactivity/create-resource) primitive: -```tsx tab title="TypeScript" {4-7} +```tsx tab title="TypeScript" {5-8} {13} // src/routes/index.tsx import { createResource, ErrorBoundary, Suspense, For } from "solid-js"; @@ -364,7 +364,7 @@ export default function Page() { } ``` -```jsx tab title="JavaScript" {4-7} +```jsx tab title="JavaScript" {5-8} {13} // src/routes/index.jsx import { createResource, ErrorBoundary, Suspense, For } from "solid-js"; diff --git a/src/routes/solid-start/guides/data-mutation.mdx b/src/routes/solid-start/guides/data-mutation.mdx index 79b81476e2..f4b2d7fb8d 100644 --- a/src/routes/solid-start/guides/data-mutation.mdx +++ b/src/routes/solid-start/guides/data-mutation.mdx @@ -62,7 +62,7 @@ export default function Page() { To pass additional arguments to your action, use the `with` method: -```tsx tab title="TypeScript" {15} +```tsx tab title="TypeScript" {4} {15} // src/routes/index.tsx import { action } from "@solidjs/router"; @@ -85,7 +85,7 @@ export default function Page() { } ``` -```jsx tab title="JavaScript" {15} +```jsx tab title="JavaScript" {4} {15} // src/routes/index.jsx import { action } from "@solidjs/router"; diff --git a/src/routes/solid-start/guides/security.mdx b/src/routes/solid-start/guides/security.mdx index 605730afd5..7f05939551 100644 --- a/src/routes/solid-start/guides/security.mdx +++ b/src/routes/solid-start/guides/security.mdx @@ -56,7 +56,7 @@ export default createMiddleware({ }); ``` -```tsx tab title="entry-server.tsx" {6} +```tsx tab title="entry-server.tsx" {7} // src/entry-server.tsx // @refresh reload import { createHandler, StartServer } from "@solidjs/start/server";