From 34c688374642d999afaaca137002536875675700 Mon Sep 17 00:00:00 2001 From: Ryan Christian Date: Mon, 4 Nov 2024 05:49:35 -0600 Subject: [PATCH 1/2] docs: Weaken language around suspense --- content/en/guide/v10/switching-to-preact.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/content/en/guide/v10/switching-to-preact.md b/content/en/guide/v10/switching-to-preact.md index 5859e69d0..f697a7b12 100755 --- a/content/en/guide/v10/switching-to-preact.md +++ b/content/en/guide/v10/switching-to-preact.md @@ -120,7 +120,7 @@ function App() { > Keep in mind that due to Preact reusing the browser's event system, events won't bubble up through a Portal container to the other tree. -## Suspense (experimental) +## Suspense The main idea behind `Suspense` is to allow sections of your UI to display some sort of placeholder content while components further down the tree are still loading. A common use case for this is code-splitting where you'll need to load a component from the network before you can render it. @@ -139,4 +139,6 @@ const SomeComponent = lazy(() => import('./SomeComponent')); In this example the UI will display the `loading...` text until `SomeComponent` is loaded and the Promise is resolved. -> This feature is experimental and may contain bugs. We have included it as an early preview to increase testing visibility. We don't recommend using it in production. +> Suspense in both React and Preact isn't quite finalized or set it stone as of yet. While the React team still actively discourages users interfacing with it directly for data fetching, it's a pattern some Preact users have been happily using over the last few years. There are a few known issues (please see [our tracker](https://github.com/preactjs/preact/issues) for an up-to-date reference) but it's generally considered stable enough for use in production if you so wish. +> +> This site, for instance, is built using a Suspense-based data fetching strategy used to load all content you see. From 87ec8545e253c724fbee79585cbf1e83485f3a18 Mon Sep 17 00:00:00 2001 From: Ryan Christian Date: Mon, 4 Nov 2024 06:05:37 -0600 Subject: [PATCH 2/2] docs: Link to suspense issues specifically --- content/en/guide/v10/switching-to-preact.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/guide/v10/switching-to-preact.md b/content/en/guide/v10/switching-to-preact.md index f697a7b12..90f8aaaab 100755 --- a/content/en/guide/v10/switching-to-preact.md +++ b/content/en/guide/v10/switching-to-preact.md @@ -139,6 +139,6 @@ const SomeComponent = lazy(() => import('./SomeComponent')); In this example the UI will display the `loading...` text until `SomeComponent` is loaded and the Promise is resolved. -> Suspense in both React and Preact isn't quite finalized or set it stone as of yet. While the React team still actively discourages users interfacing with it directly for data fetching, it's a pattern some Preact users have been happily using over the last few years. There are a few known issues (please see [our tracker](https://github.com/preactjs/preact/issues) for an up-to-date reference) but it's generally considered stable enough for use in production if you so wish. +> Suspense in both React and Preact isn't quite finalized or set it stone as of yet. While the React team still actively discourages users interfacing with it directly for data fetching, it's a pattern some Preact users have been happily using over the last few years. There are a few known issues (please see [our tracker](https://github.com/preactjs/preact/issues?q=is%3Aissue+is%3Aopen+suspense) for an up-to-date reference) but it's generally considered stable enough for use in production if you so wish. > > This site, for instance, is built using a Suspense-based data fetching strategy used to load all content you see.