new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Expo & React Native · all subjects

expo-go

5 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Vendored modules in Expo Go and patching process

Anything in the modules directory in Expo Go is vendored and has Expo-Go-specific patches applied. These patches are located in tools/src/vendoring/config. To update a vendored module to a specific version, use the command et uvm [module-name] -c "[version]", for example et uvm react-native-view-shot -c "4.0.3". This command updates the module to the specified version and automatically applies the patches.

Device transformer exposes transformModule function

The device transformer is a Babel payload used by Expo Go to transpile edits to published projects. It runs in the standalone Hermes JSI runtime and exposes a transformModule function with signature: transformModule(source, filename, moduleId, depIds) which returns an object with code and depNames properties.

Device transformer build process steps

The device transformer build is performed from apps/expo-go/tools/device-transformer by running three commands in sequence: node build-slim.js, node baseline-slim.js, and node test-extraction.js. The build-slim.js command writes intermediate files to dist/ and copies the minified payload to apps/expo-go/ios/Exponent/DevMenu/ProjectSource/Resources/device-transformer.js. The EXPO_DIR environment variable can be set to build against a different checkout.

Hermes compatibility transformations for device transformer

The device transformer build applies three Hermes compatibility steps: (1) esbuild lowers dynamic import() calls that Hermes cannot parse, (2) Babel's V8-specific deprecation warning helper is replaced with a no-op, and (3) Babel's block scoping transform lowers per-iteration bindings for Hermes.

Verify Hermes compilation of device transformer

To verify that Hermes can compile the device transformer result, use hermesc from the Expo monorepo with the command: hermesc -emit-binary -out /tmp/device-transformer.hbc with the path to dist/device-transformer-slim.min.js. The hermesc binary can be found at node_modules/.pnpm with path '*osx-bin*'.

Give your agent this brain