Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b440d66
fix(links): update internal links (#8136)
okeken Nov 10, 2025
27576f1
fix(useTransition): correct anchors pointing to non-blocking updates …
SecondThundeR Nov 14, 2025
2534424
fix: Stop SmartyPants from altering TerminalBlock commands (like `--s…
smikitky Nov 15, 2025
4704ce6
blog post (#8170)
rickhanlonii Dec 3, 2025
9c880bd
fix: use correct function name (#8171)
FelixTraxler Dec 3, 2025
e2b59da
add update instructions (#8172)
rickhanlonii Dec 3, 2025
0828d50
Update React releases (#8173)
eps1lon Dec 3, 2025
ac47e52
Update upgrade instructions for React Server Components (Waku section…
dai-shi Dec 4, 2025
d8b1fe8
Upgrade Next from 15.1.0 to 15.1.9 (#8175)
mattcarrollcode Dec 4, 2025
5876ed5
blog: update RSC security vulnerability guidance for Expo (#8177)
vonovak Dec 5, 2025
e22544e
Add Vulnerability in React Server Components to sidebarBlog.json (#8178)
SSakutaro Dec 5, 2025
cffb6a7
Specify that Effects run on commit, not render (#8162)
eps1lon Dec 11, 2025
2a0fed0
12/11 blog post (#8193)
rickhanlonii Dec 11, 2025
1a955f0
rm localhost link (#8194)
rickhanlonii Dec 11, 2025
72f8998
Update instructions (#8195)
rickhanlonii Dec 11, 2025
e44d3b7
Add additional DoS CVE (#8196)
rickhanlonii Dec 11, 2025
9527378
update nextjs instructions (#8197)
rickhanlonii Dec 12, 2025
1e74023
[Blog] Update safe Next.js versions (#8199)
mattcarrollcode Dec 12, 2025
2da4f7f
Update to Next.js 15.1.11 (#8200)
mattcarrollcode Dec 12, 2025
a1ddcf5
Add caveat to useId for cache keys (#8242)
rickhanlonii Jan 16, 2026
ed87618
Update DoS blog post with additional CVE (#8263)
rickhanlonii Jan 26, 2026
303e6b4
Init claude config (#8265)
rickhanlonii Jan 27, 2026
3938fbf
Update deps (#8268)
rickhanlonii Jan 28, 2026
dcc5deb
Add llms.txt (#8267)
gaearon Jan 28, 2026
61b1f51
Add sections to llms.txt and sitemap footer to *.md (#8270)
rickhanlonii Jan 28, 2026
d340c41
Remove feedback (#8271)
rickhanlonii Jan 28, 2026
a2a19ba
feat: Add Accept header content negotiation for markdown (#8272)
icyJoseph Jan 28, 2026
ec13a90
remove outdated note about streaming ssr (#8277)
hernan-yadiel Jan 29, 2026
24ec67e
fix: use beforeFiles (#8276)
icyJoseph Jan 30, 2026
29743d0
Revamp useOptimistic docs (#8264)
rickhanlonii Jan 30, 2026
4c52ab8
Update separating-events-from-effects.md (#8257)
wheresrhys Jan 30, 2026
38b52cf
More claude stuff (#8280)
rickhanlonii Jan 30, 2026
ff17a86
fix: correct typos and improve clarity in useOptimistic.md (#8283)
aurorascharff Feb 2, 2026
e05afa5
useEffectEvent revamp (#8279)
rickhanlonii Feb 4, 2026
bd87c39
Rephrase the rendering explanation paragraph (#8240)
BartoszKlonowski Feb 5, 2026
e117929
merging all conflicts
react-translations-bot Feb 9, 2026
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: Stop SmartyPants from altering TerminalBlock commands (like `--s…
…ave-dev` to `—save-dev`) (#8146)

* Skip smartypants on TerminalBlock

* Improve TerminalBlock HTML tags

* Remove unnecessary TerminalBlock escapes from docs

* Bump DISK_CACHE_BREAKER
  • Loading branch information
smikitky authored Nov 15, 2025
commit 2534424ec6c433cc2c811d5a0bd5a65b75efa5f0
22 changes: 20 additions & 2 deletions plugins/remark-smartypants.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,24 @@ const visit = require('unist-util-visit');
const retext = require('retext');
const smartypants = require('retext-smartypants');

function check(parent) {
function check(node, parent) {
if (node.data?.skipSmartyPants) return false;
if (parent.tagName === 'script') return false;
if (parent.tagName === 'style') return false;
return true;
}

function markSkip(node) {
if (!node) return;
node.data ??= {};
node.data.skipSmartyPants = true;
if (Array.isArray(node.children)) {
for (const child of node.children) {
markSkip(child);
}
}
}

module.exports = function (options) {
const processor = retext().use(smartypants, {
...options,
Expand All @@ -43,8 +55,14 @@ module.exports = function (options) {
let startIndex = 0;
const textOrInlineCodeNodes = [];

visit(tree, 'mdxJsxFlowElement', (node) => {
if (['TerminalBlock'].includes(node.name)) {
markSkip(node); // Mark all children to skip smarty pants
}
});

visit(tree, ['text', 'inlineCode'], (node, _, parent) => {
if (check(parent)) {
if (check(node, parent)) {
if (node.type === 'text') allText += node.value;
// for the case when inlineCode contains just one part of quote: `foo'bar`
else allText += 'A'.repeat(node.value.length);
Expand Down
10 changes: 6 additions & 4 deletions src/components/MDX/TerminalBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,15 @@ function TerminalBlock({level = 'info', children}: TerminalBlockProps) {
</div>
</div>
</div>
<div
<pre
className="px-8 pt-4 pb-6 text-primary-dark dark:text-primary-dark font-mono text-code whitespace-pre overflow-x-auto"
translate="no"
dir="ltr">
<LevelText type={level} />
{message}
</div>
<code>
<LevelText type={level} />
{message}
</code>
</pre>
</div>
);
}
Expand Down
18 changes: 9 additions & 9 deletions src/content/blog/2025/10/07/react-compiler-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,17 @@ To install the compiler:

npm
<TerminalBlock>
{`npm install --save-dev --save-exact babel-plugin-react-compiler@latest`}
npm install --save-dev --save-exact babel-plugin-react-compiler@latest
</TerminalBlock>

pnpm
<TerminalBlock>
{`pnpm add --save-dev --save-exact babel-plugin-react-compiler@latest`}
pnpm add --save-dev --save-exact babel-plugin-react-compiler@latest
</TerminalBlock>

yarn
<TerminalBlock>
{`yarn add --dev --exact babel-plugin-react-compiler@latest`}
yarn add --dev --exact babel-plugin-react-compiler@latest
</TerminalBlock>

As part of the stable release, we've been making React Compiler easier to add to your projects and added optimizations to how the compiler generates memoization. React Compiler now supports optional chains and array indices as dependencies. These improvements ultimately result in fewer re-renders and more responsive UIs, while letting you keep writing idiomatic declarative code.
Expand All @@ -101,17 +101,17 @@ To install:

npm
<TerminalBlock>
{`npm install --save-dev eslint-plugin-react-hooks@latest`}
npm install --save-dev eslint-plugin-react-hooks@latest
</TerminalBlock>

pnpm
<TerminalBlock>
{`pnpm add --save-dev eslint-plugin-react-hooks@latest`}
pnpm add --save-dev eslint-plugin-react-hooks@latest
</TerminalBlock>

yarn
<TerminalBlock>
{`yarn add --dev eslint-plugin-react-hooks@latest`}
yarn add --dev eslint-plugin-react-hooks@latest
</TerminalBlock>

```js {6}
Expand Down Expand Up @@ -153,19 +153,19 @@ We have partnered with the Expo, Vite, and Next.js teams to add the compiler to
[Expo SDK 54](https://docs.expo.dev/guides/react-compiler/) and up has the compiler enabled by default, so new apps will automatically be able to take advantage of the compiler from the start.

<TerminalBlock>
{`npx create-expo-app@latest`}
npx create-expo-app@latest
</TerminalBlock>

[Vite](https://vite.dev/guide/) and [Next.js](https://nextjs.org/docs/app/api-reference/cli/create-next-app) users can choose the compiler enabled templates in `create-vite` and `create-next-app`.

<TerminalBlock>
{`npm create vite@latest`}
npm create vite@latest
</TerminalBlock>

<br />

<TerminalBlock>
{`npx create-next-app@latest`}
npx create-next-app@latest
</TerminalBlock>

## Adopt React Compiler incrementally {/*adopt-react-compiler-incrementally*/}
Expand Down
6 changes: 3 additions & 3 deletions src/content/learn/build-a-react-app-from-scratch.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The first step is to install a build tool like `vite`, `parcel`, or `rsbuild`. T
[Vite](https://vite.dev/) is a build tool that aims to provide a faster and leaner development experience for modern web projects.

<TerminalBlock>
{`npm create vite@latest my-app -- --template react-ts`}
npm create vite@latest my-app -- --template react-ts
</TerminalBlock>

Vite is opinionated and comes with sensible defaults out of the box. Vite has a rich ecosystem of plugins to support fast refresh, JSX, Babel/SWC, and other common features. See Vite's [React plugin](https://vite.dev/plugins/#vitejs-plugin-react) or [React SWC plugin](https://vite.dev/plugins/#vitejs-plugin-react-swc) and [React SSR example project](https://vite.dev/guide/ssr.html#example-projects) to get started.
Expand All @@ -46,7 +46,7 @@ Vite is already being used as a build tool in one of our [recommended frameworks
[Parcel](https://parceljs.org/) combines a great out-of-the-box development experience with a scalable architecture that can take your project from just getting started to massive production applications.

<TerminalBlock>
{`npm install --save-dev parcel`}
npm install --save-dev parcel
</TerminalBlock>

Parcel supports fast refresh, JSX, TypeScript, Flow, and styling out of the box. See [Parcel's React recipe](https://parceljs.org/recipes/react/#getting-started) to get started.
Expand All @@ -56,7 +56,7 @@ Parcel supports fast refresh, JSX, TypeScript, Flow, and styling out of the box.
[Rsbuild](https://rsbuild.dev/) is an Rspack-powered build tool that provides a seamless development experience for React applications. It comes with carefully tuned defaults and performance optimizations ready to use.

<TerminalBlock>
{`npx create-rsbuild --template react`}
npx create-rsbuild --template react
</TerminalBlock>

Rsbuild includes built-in support for React features like fast refresh, JSX, TypeScript, and styling. See [Rsbuild's React guide](https://rsbuild.dev/guide/framework/react) to get started.
Expand Down
2 changes: 1 addition & 1 deletion src/content/learn/react-compiler/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Please refer to the [Next.js docs](https://nextjs.org/docs/app/api-reference/nex
Install `vite-plugin-babel`, and add the compiler's Babel plugin to it:

<TerminalBlock>
{`npm install vite-plugin-babel`}
npm install vite-plugin-babel
</TerminalBlock>

```js {3-4,16}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/compileMDX.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {MDXComponents} from 'components/MDX/MDXComponents';

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ~~~~ IMPORTANT: BUMP THIS IF YOU CHANGE ANY CODE BELOW ~~~
const DISK_CACHE_BREAKER = 10;
const DISK_CACHE_BREAKER = 11;
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

export default async function compileMDX(
Expand Down