Bartłomiej Klocek (@barthap10) profile picture

Engineer at @SWMansion. @Expo enthusiast and SDK maintainer. Previously worked on @CommDotApp

Joined August 2021
Photo by Bartłomiej Klocek (@barthap10)Photo by Bartłomiej Klocek (@barthap10)Photo by Bartłomiej Klocek (@barthap10)Photo by Bartłomiej Klocek (@barthap10)Photo by Bartłomiej Klocek (@barthap10)Photo by Bartłomiej Klocek (@barthap10)Photo by Bartłomiej Klocek (@barthap10)Photo by Bartłomiej Klocek (@barthap10)Photo by Bartłomiej Klocek (@barthap10)Photo by Bartłomiej Klocek (@barthap10)
Bartłomiej Klocek retweeted
Expo Modules 2.0 on Android needed much cheaper JNI calls, so we built our own JNI library. It’s called Kolibri, and calls into C++ objects are up to 51x faster than with 𝚏𝚋𝚓𝚗𝚒 👏 Full blog post right here from Łukasz Kosmaty: expo.dev/blog/expo-modules-2…
21
34
8
397
19,532
Bartłomiej Klocek retweeted
I really love the idea of bringing fully-fledged Web Workers API to React Native - it's something we wanted to add in Worklets for a long time, but it's lot more complicated to do right than we anticipated initially. We keep finding more stuff we have to implement first, before we can do workers. Due to that, I have to debunk some claims in the comparison. 1. 🔄 Worklets also allow you to spawn as many JS environments as you'd like - all of them have an event loop, timers etc. from the start. In Bundle Mode you can also import on them any library you'd want. You can even customize them further, for example react-native-audio-api(-worklets) creates a Worklet Runtime for processing without an event loop and a thread/queue, since they provide these themselves github.com/software-mansion/… 2.❌Unfortunately that's not true. You can use *some* of the Native Modules without issues, but even these might now work as you'd expect. Native Modules in React Native are closely tied to the main React Native runtime (RN Runtime). For example, all events from the modules are sent to the RN Runtime. react-native-workers then forward these events to its own worker runtimes, copying the payloads etc. It means that even if you sent a HTTP request from a worker, the response comes to the RN Runtime, which runs on the JS thread. If the JS thread is busy, then your worker is starved too. Also Native Modules usually aren't thread safe - they often assume that they're always called from the RN Runtime and the JS thread. This is why in Worklets we had to implement fetch from scratch - currently it's gated behind a feature flag docs.swmansion.com/react-nat…. It runs truly off the JS thread and would never get bottlenecked. 3.✅Here I must agree. We know Worklets aren't beginner friendly and we continue to make the API more approachable and intuitive. 4.🔄I think it's a bit more complicated. If you send a worklet to be executed on a dedicated Worklets Runtime runtime it's effectively a Web Worker - just without the onMessage API etc. 5.✅That makes sense - Worklets are supposed to be an imperative, low-level building block to make all kind of solutions. Web Workers are a higher-level abstraction. 6.🔄Worklets allow you to do the threading as you'd like. You can create a Worklet Runtime and juggle it between threads as you'd like with the C++ API. This is what Reanimated has been doing for years with the UI Worklet Runtime. 7.✅Debuggability out-of-the box is impressive. We have been trying to add debugger support to Worklets for a long time, but it was very difficult pre-Bundle Mode - and also due to how fast the RN Dev Tools have changed recently. Now that the dust has settled we're definitely going to revise this issue. Let me add a few more points to the comparison in favor of react-native-workers (so I wouldn't look too salty 😇) 8.💎Bundle size loaded onto the Workers. With Bundle Mode we load the entire JS Bundle onto each extra runtime - this comes at little cost, since it's mmaped in production - but it uses a lot of memory in development. We want to explore some bundle splitting techniques to improve the DX here - Workers nailed it. 9.💎No-copy memory sharing. Worklets are still missing good no-copy memory abstractions - we've been working to make ArrayBuffers transferable without copies. We came into some threading and GC issues with Hermes when designing the imperative API and decided to postpone the idea. I haven't looked deeply into the code of Workers, but if Ammar got that feature right, huge respect for him. --- After giving it some thought, I think there's no need to compete here. I think react-native-worklets 👷 and react-native-worklets 🧵could work integrate on a deeper level and both benefit. Worklets can provide battle-tested, low-level abstractions and Workers deliver a high-level, familiar end-user API 👷🤜🤛🧵
I asked Ammar to explain the difference between Workers and worklets.
10
12
87
7,101
Gave Windows development another chance this weekend (hadn’t touched it much in years). After watching @birch_js's excellent Expo Desktop talk at @appjsconf on Friday, I got inspired and rebuilt my old C# Expo Modules experiment on top of his work.
2
1
15
1,202
Still very experimental and honestly pretty messy right now (lots of vibe-coding while testing different C# + JSI approaches). Native functions, async, simple views, events, and constants are working though. Curious to see where this can go.
2
109
Bartłomiej Klocek retweeted
We just cut the SDK 56 beta 😅 ◆ 50%+ faster iOS builds (precompiled XCFrameworks) ◆ 40% faster cold starts on Android ◆ Expo UI is stable ◆ iOS widgets are stable ◆ expo-router rebuilt from scratch ◆ Inline native modules ◆ Brownfield multi-app support The obvious themes are speed and stability. But there are a lot of other interesting changes (like Expo Router decoupling itself form React Navigation). Get all the nuance and detail in the changelog below ↓
68
109
49
1,000
196,440
Bartłomiej Klocek retweeted
‼️Expo SDK 55 beta is out now🧪 (RN 0.83.1 + React 19.2) Highlights: ♢ Legacy Architecture support is gone ♢ New default template (native tabs, /src/app) ♢ Hermes v1 opt-in ♢ Smaller OTA updates with Hermes bytecode diffing ♢ More native Router APIs + better brownfield support ♢...and more and more... We'll link to the release notes with details about breaking changes below ↓ Please give the beta a try and report your issues 🙏
41
85
32
729
264,188
Adding @expo-image support to my Photoshop PSD parsing lib was surprisingly seamless thanks to Expo Modules' "shared refs". They allow you to pass native object references between different libraries with ease. It "just worked".
1
1
132
Why this matters: - No "serialization tax" (no base64, ArrayBuffers, or temp files) - Zero copying—just direct native references - Convenient, type-safe API It’s the most efficient way to bridge native libraries without the overhead.
2
87
Check out the docs for more on shared objects & refs: docs.expo.dev/modules/shared… It’s not just for images; use it for file handles, audio players, SQLite DBs, and more. Adoption is constantly growing across the Expo ecosystem.
73
I loved this so much that I ported it to Neovim 😸
Thanks to ✨react-compiler-marker v1.3.4 now you can mark your uncompiled React components with 💩 Blame @fernandorojo for this one 😆
1
1
305
I really appreciate @appjsconf gadgets. They not only look cool but are also very useful 💯🎯
3
1
24
4,695
Bartłomiej Klocek retweeted
Stable version of the @Expo Modules API is finally out! 🥳 I'm so excited about what we've built and how it can help developers in building native modules for Expo and React Native in modern languages and with an easy to understand declarative syntax 🤩 More in the thread 🧵👇
7
38
1
239
Replying to @rnfirebase
@RNFirebase 16.4.0 now comes with an @Expo config plugin for Phone Auth (iOS reCAPTCHA verification). See the docs for more info: rnfirebase.io/auth/phone-aut…
2
3
21
And expo-firebase-recaptcha has been deprecated in SDK 47: docs.expo.dev/versions/v47.0…
3
Bartłomiej Klocek retweeted
SDK 47 beta is now available! Try upgrading your app and let us know if you run into any issues! ⏳The beta period will last for about a week. blog.expo.dev/expo-sdk-47-be…
1
55
6
266
TIL: I can annotate types in various config files like webpack.config.js, babelrc, eslintrc or Expo app.config.js In JSON-based configs I can add "$schema" property from this site: schemastore.org/json/ In JS-based ones use /** @ type { import("lib").Type } */ Some examples:
8
Bartłomiej Klocek retweeted
📢 Another day, another library migrated to Fabric! 📢Introducing react-native-svg v13.0.0 with Fabric support 🎉 github.com/react-native-svg/… Huge kudos to Wojtek Lewicki 👏👏👏 (who doesn't want to set up a TT account cause "he will get stuck scrolling")
1
30
201
Why are people using 'expo-firebase-analytics' together with 'react-native-firebase'? Why don't you migrate to 'react-native-firebase/analytics' to avoid version conflicts?
2
Bartłomiej Klocek retweeted
This is so 🔥 All expo modules are categorized and in one place!
2
13