Jan Nicklas's Avatar

Jan Nicklas

@jantimon.bsky.social

living in Switzerland ๐Ÿ‡จ๐Ÿ‡ญ mainly working on typescript, css and compiler related frontend topics https://github.com/jantimon

771 Followers  |  1,574 Following  |  86 Posts  |  Joined: 31.10.2024  |  2.1971

Latest posts by jantimon.bsky.social on Bluesky

it makes sense to me that useEffectEvent solves only one thing and not two

but still - could you please show an example of lost reactivity?

01.10.2025 11:10 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
Video thumbnail

you were right!

it took me some time to test all cases manually and migrated them to playwright - but it behaves exactly as you described
github.com/jantimon/rea...

I also ran the playwright tests with react-compiler and the results were quite impressive

21.09.2025 12:29 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

I believe you are right

Do you know why act might cause problems when testing useTransition?

Maybe I should switch to playwright tests for this repo

16.09.2025 22:21 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Post image

You can clearly see that the modal backdrop is cut off

16.09.2025 13:40 โ€” ๐Ÿ‘ 5    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Video thumbnail

Here is Apple.โ com struggling with these viewport bugs:

16.09.2025 13:40 โ€” ๐Ÿ‘ 9    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Screenshot of Safari 26 in "tabs at the top" mode showing a webpage that is set to `viewport-fit=cover` and the dynamic toolbars scrolled away (minimized). The viewport is too short and the safe area insets are all wrong. Device: iPhone 13 Pro.

Screenshot of Safari 26 in "tabs at the top" mode showing a webpage that is set to `viewport-fit=cover` and the dynamic toolbars scrolled away (minimized). The viewport is too short and the safe area insets are all wrong. Device: iPhone 13 Pro.

Screenshot of Safari 26 in "tabs at the top" mode showing a webpage with the dynamic toolbars scrolled away (minimized). The viewport (blue box) is way too short and does not toch the very top of the screen. Device: iPhone 13 Pro.

Screenshot of Safari 26 in "tabs at the top" mode showing a webpage with the dynamic toolbars scrolled away (minimized). The viewport (blue box) is way too short and does not toch the very top of the screen. Device: iPhone 13 Pro.

Viewport behavior in Safari 26 is utterly broken. ๐Ÿ™„๐Ÿ˜ญ

Time to get Viewports into #Interop2026 because viewports on iOS have gotten only worse since I did the initial research in, *checks notes*, 2022 โ€” github.com/web-platform...

15.09.2025 21:14 โ€” ๐Ÿ‘ 137    ๐Ÿ” 24    ๐Ÿ’ฌ 8    ๐Ÿ“Œ 7

useTransition (without memo -> no fallback)
github.com/jantimon/rea...

useDeferredValue (without memo -> forces fallback)
github.com/jantimon/rea...

16.09.2025 12:48 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Post image Post image

here `isPending` is NOT RENDERED and does NOT force the suspense boundary into its fallback

but in the second example the state is NOT RENDERED and DOES force suspense boundary into its fallback

both the isPending and the count state changed - but only one forces suspense boundary fallbacks

๐Ÿ˜ตโ€๐Ÿ’ซ

16.09.2025 12:31 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

why is that memo not needed for isPending from useTransition()?

16.09.2025 07:22 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

unfortunately the react compiler must be the first compile step..

that limits using compile time optimizations e.g. for css-in-js, i18n, โ€ฆ

and the compiler is written in babel which makes it quite slow for large codebases

16.09.2025 05:53 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

it's truly amazing that your memo trick works but who is supposed to understand this code ๐Ÿ˜„

15.09.2025 19:46 โ€” ๐Ÿ‘ 2    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Post image

here is a useDeferredValue example and unit test

it shows that useDeferredValue has no effect at all and causes the Suspense barrier to render its fallback

for me this does not match the documentation which says "useDeferredValue is a React Hook that lets you defer updating a part of the UI"

15.09.2025 19:43 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
react-hydration-rules/src/tests/SuspenseTriggerOnExternalStoreComponent.test.tsx at main ยท jantimon/react-hydration-rules Comprehensive guide documenting React hydration and Suspense fallback behaviors during SSR - jantimon/react-hydration-rules

github.com/jantimon/rea...

15.09.2025 19:19 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
the render function is called many many times - although its inside `memo` and it is only once in the tree

"react": "19.1.1",
"react-dom": "19.1.1"

the render function is called many many times - although its inside `memo` and it is only once in the tree "react": "19.1.1", "react-dom": "19.1.1"

Here is something else what confuses me and where I also don't know what I don't know

This is a component inside memo and I don't understand why its render function is called 30+ times in this example

stackblitz.com/edit/vitejs-...

Are there any docs which explain this behaviour?

10.09.2025 08:19 โ€” ๐Ÿ‘ 2    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
for the prompt "Does SSR with React lazy render the suspense fallback or the content of the lazy component?" 

Claude gives a very confusing answer

for the prompt "Does SSR with React lazy render the suspense fallback or the content of the lazy component?" Claude gives a very confusing answer

for the prompt "Does SSR with React lazy render the suspense fallback or the content of the lazy component?" 

Chat GPT gives a kind of okayish answer

for the prompt "Does SSR with React lazy render the suspense fallback or the content of the lazy component?" Chat GPT gives a kind of okayish answer

Now that I invested more time I feel it is fine

My problem was that I didn't know what I didn't know and where to start when Suspense caused CLS

For example the docs say "non-blocking Transition update" - does that mean there are blocking Transition updates too?

Maybe I was just confused by AI ๐Ÿ˜„

09.09.2025 18:11 โ€” ๐Ÿ‘ 2    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Many thanks Ricky for the hints - you were absolutely right..

After removing the `isPending` part the useTransition test is no longer breaking the Suspense Fallback!

I updated the text and adjusted the tests

09.09.2025 07:06 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
GitHub - jantimon/react-hydration-rules: Comprehensive guide documenting React hydration and Suspense fallback behaviors during SSR Comprehensive guide documenting React hydration and Suspense fallback behaviors during SSR - jantimon/react-hydration-rules

@danabra.mov did I miss anything in github.com/jantimon/rea... ?

08.09.2025 20:00 โ€” ๐Ÿ‘ 15    ๐Ÿ” 4    ๐Ÿ’ฌ 4    ๐Ÿ“Œ 0

that could potentially speed up projects a lot - especially if those projects use babel on node_modules

26.08.2025 14:20 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

We would be curios to track down cross file react context usages - but it seems to be quite hard to do because of custom hooks, lazy loaded components, lazy loaded hooks, styled components, โ€ฆ

23.08.2025 06:35 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

I recently wrote something like react-scanner from scratch in rust using swc as parser (claude code helped a lot)

it scanned 12.000 tsx files in under 1s and was a lot of fun to build

i can share the code if it helps

21.08.2025 05:42 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

I wouldnโ€™t bet on 2025, but my hopes are high for 2026.
Firefox has had an experimental implementation for years. Safari also has one now. And weโ€™re implementing in Edge/Chrome.
Itโ€™s a matter of agreeing on the spec now. Once done, it wonโ€™t take long for the feature to ship.

12.07.2025 06:55 โ€” ๐Ÿ‘ 4    ๐Ÿ” 1    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

That would be really amazing

Currently the only existing CSS solution is CSS columns and that one comes with really big drawbacks like wrong tab order and limited control over the order in responsive designs

grid-template-rows: masonry
would solve both problems

12.07.2025 07:01 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
can i use screenshot of https://caniuse.com/?search=masonry

can i use screenshot of https://caniuse.com/?search=masonry

what does soon mean?

we would love to use it but it feels like an abandoned feature

do you think it might become stable by 2025 or 2026?

12.07.2025 06:42 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Preview
Announcing Oxlint 1.0 The first stable version of Oxlint, a fast & easy-to-use Rust-powered linter for JavaScript and TypeScript, is out. Learn about its 50~100x speed advantage over ESLint, support for 500+ rules, real-wo...

We're thrilled to announce the first stable release of Oxlint - version 1.0!

Our Rust-powered JavaScript/TypeScript linter delivers 50~100x faster performance than ESLint with 500+ rules and zero configuration required.

Time to give it a try!

voidzero.dev/posts/announ...

10.06.2025 10:13 โ€” ๐Ÿ‘ 309    ๐Ÿ” 62    ๐Ÿ’ฌ 10    ๐Ÿ“Œ 9
Preview
Core Web Vitals for Search Engine Optimisation: What Do We Need to Know? โ€“ CSS Wizardry Thereโ€™s still a lot of misunderstanding about CWV for SEO. Letโ€™s work it out together.

There is a great article about SEO and performance

It has a dedicated section called:
"Ignore Lighthouse and PageSpeed Insights Scores"

csswizardry.com/2023/07/core...

08.06.2025 05:23 โ€” ๐Ÿ‘ 4    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
refactor!: bump required node version to 20.19+, 22.12+ and remove cjs build by sapphi-red ยท Pull Request #20032 ยท vitejs/vite Description Built on top of #19972 Bumps required node version to 20.19+, 22.12+ so that we can remove cjs build. I haven't tested yet.

Vite 7 (to be released in ~2 weeks) will be distributed as ESM-only, unblocked by require(esm). We decided to bump node versions to 20.19+, 22.12+ to have it unflagged. Here is @sapphi.red's PR removing the bits of CJS we were still shipping.

28.05.2025 12:14 โ€” ๐Ÿ‘ 34    ๐Ÿ” 3    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Next-Yak playground showing an editor on the left hand side, the rendered output on the right side on the upper two thirds and the transpiled CSS output on the lower third. You can see that next-yak transpiles styled-components looking code to static CSS

Next-Yak playground showing an editor on the left hand side, the rendered output on the right side on the upper two thirds and the transpiled CSS output on the lower third. You can see that next-yak transpiles styled-components looking code to static CSS

We found a way to run our custom SWC plugin on the client in WASM ๐ŸŽ‰

If you want to see how next-yak transpiles your input to static CSS have a look here: yak.js.org/playground

19.05.2025 19:11 โ€” ๐Ÿ‘ 2    ๐Ÿ” 1    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

I ported React Router RSC Movies demo to Vite. github.com/hi-ogawa/rsc... RSC bundler feature is encapsulated in the package `@hiogawa/vite-rsc` and React Router RSC API integration is found in `./react-router-vite`. The latter part is mostly a copy of `parcel-plugin-react-router`.

18.05.2025 05:19 โ€” ๐Ÿ‘ 15    ๐Ÿ” 3    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
example of the css-in-js approach

tsx in - js and css out

example of the css-in-js approach tsx in - js and css out

maybe I can give you an idea of what I would have in mind - it's rather a css-in-js postprocessor that extracts css from your tsx

so you can keep writing ordinary css

it only imports the css - so you could still configure your bundler to split or combine the css as you wish

simple example

12.05.2025 19:03 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

"you can implement new features without needing library support"

I never ran into such an issue - can you give an example where you couldn't use a css feature because of missing library support?

12.05.2025 18:46 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

@jantimon is following 20 prominent accounts