T.J. Żelawski

T.J. Żelawski

@tjzel.dev

Software Engineer @Software Mansion I maintain some React Native open-source libraries

158 followers70 following32 posts

I'll be speaking at ReactCon Berlin this October! If you're crazy about low-level stuff like me and want to know just how much overhead the JavaScript layer adds in React Native apps, don't miss my talk!

T.J. Żelawski reposted

My talk titled "Your GPU is a JavaScript Runtime*" just landed on YouTube! 👨‍💻 I answer WHY and HOW we compile JS/TS to WGSL, how it improves interop for the whole ecosystem, and the added dimension of customizability it unlocks for WebGPU libraries Video below ⬇️ #webgpu #typegpu #typescript

View full thread

If you want to test it in your app, keep in mind that Reanimated 3 doesn't work with standalone `react-native-worklets`. However, a nightly version of Reanimated 4 works just fine.

View full thread

While the feature allows you to use virtually any library, there are some constraints. For example, some side-effects are problematic. A library that would directly import React Native can't be used on a Worklet Runtime. Don't worry, you will get a friendly error in that case.

Libraries that fetch data will also have a hard time - `fetch` is not yet available on Worklet Runtimes. We aim to add it soon™. For now, libraries that focus on the UI are the best bet to use with Bundle Mode - like `react-native-wgpu` or `react-native-live-markdown`.

View full thread

To run it, you need to install `react-native-worklets@bundle-mode-preview` and apply some patches to React Native, which expose additional APIs. The patches are non-invasive and won't change your app's behavior outside of worklets. More in the docs docs.swmansion.com/react-native...

docs.swmansion.comBundle Mode | React Native WorkletsBundle Mode is a feature that gives worklets access to your whole JavaScript bundle - meaning that any code that's present in the bundle can be executed in any worklet and on any runtime. This means t...

Ultimately this will be a plug-and-play solution, without cumbersome configurations. However, it's not that simple. Bundle Mode needs APIs that aren't yet available in React Native. Please give a thumbs up on my PR so we can ship it to React Native faster github.com/facebook/rea...

github.comproposal: BundleConsumer interface for TurboModules by tjzel · Pull Request #50788 · facebook/react-nativeSummary: With the development of react-native-worklets library I want to align it more with the tools inside React Native ecosystem and reduce the amount of hacks needed to provide multithreading J...

Every package you import in your application will be available to use in worklets. We call this feature "Bundle Mode". This is so because worklets and your app now share the very same JavaScript bundle.

C++ enjoyers, is there some syntax sugar to reduce boilerplate of `weak_ptr` locking in memory-safe lambdas referencing `this`? I'm tired of making the `return` block everytime and I don't want to nest either.

We have just released an RC version of Reanimated, 3.17.0-rc.0 🥳 It has significant changes in the native code structure. It's an important milestone for our goal of moving Worklets to a separate library. If you can, please check if it compiles in your project 🙏 All feedback is welcome!

You are up to date.