Skip to content

Commit 5ae99f8

Browse files
committed
docs: Fix plant images (#9208)
1 parent 54d4b7b commit 5ae99f8

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

packages/dev/s2-docs/.parcelrc-s2-docs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@
2121
},
2222
"packagers": {
2323
"*.json": "parcel-packager-docs"
24-
}
24+
},
25+
"namers": ["./S2DocsNamer.js", "..."]
2526
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const {Namer} = require('@parcel/plugin');
2+
const path = require('path');
3+
4+
module.exports = new Namer({
5+
name({bundle}) {
6+
// Content hashing plant images messes up RSC parsing, and we don't expect these to ever change.
7+
let asset = bundle.getMainEntry();
8+
if (asset && asset.filePath.startsWith(path.join(__dirname, 'pages/react-aria/examples/plants/plants'))) {
9+
return 'assets/plants/' + path.basename(asset.filePath);
10+
}
11+
}
12+
});

packages/dev/s2-docs/pages/react-aria/examples/plants/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export default function App(): React.ReactNode {
121121
};
122122

123123
return (
124-
<div className="h-full flex flex-col gap-4 p-4 max-w-[600px] mx-auto">
124+
<div className="flex flex-col gap-4 p-4 max-w-[600px] mx-auto">
125125
<div className="grid grid-cols-[1fr_auto_auto] sm:grid-cols-[1.1fr_auto_auto_1fr_auto] gap-2 items-end">
126126
<SearchField
127127
aria-label="Search"

packages/dev/s2-docs/src/CodeBlock.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// @ts-ignore
2-
import assets from 'url:../pages/**/*.{png,jpg,svg}';
2+
import assets from 'url:../pages/**/*.{png,jpg,svg}' with {env: 'react-client'};
33
import {cache, ReactNode} from 'react';
44
import {Code, ICodeProps} from './Code';
55
import {CodePlatter, FileProvider, Pre} from './CodePlatter';

0 commit comments

Comments
 (0)