npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@parallax-rn/babel-plugin

v0.1.0-beta.17

Published

Babel plugin for Parallax for React Native: per-file source tables in dev builds (opt-in testID injection, dev-only safeguards) and the parallax-bundle-check command. Tested on React Native 0.87.1 (no third-party runtime dependencies).

Readme

@parallax-rn/babel-plugin

Build time part of Parallax. In development builds the plugin writes, for every file with JSX, a table of its elements (where each is used, which component it is in, what it was imported from, the testID the author wrote) and registers it at run time on the documented global __PARALLAX_RN__.sources, so a tool can map what is on screen to code. It never changes the code you wrote: it appends one statement. Optionally it also gives react-native primitives a testID that the accessibility tree shows (off by default, decision 0008).

Zero third-party runtime dependencies; the only dependency is @parallax-rn/protocol at the exact same version.

Install

  1. Add the package to the project (npm i -D @parallax-rn/babel-plugin, or your package manager's equivalent).
  2. Babel config: list the plugin before react-native-worklets/plugin if the project uses it (that plugin must be last).
    // babel.config.js
    module.exports = {
      presets: ['module:@react-native/babel-preset'],
      plugins: ['@parallax-rn/babel-plugin', 'react-native-worklets/plugin'],
    };
  3. Restart Metro with --reset-cache. Metro's transform cache does not notice a change of babel.config.js or of the plugin (measured in S10: with the same cache the tables are missing after adding the plugin, and the old ones stay after updating it).
  4. Check with the Parallax doctor tool: it reads the tables from the running app.

Update the plugin

Update the package, then restart Metro with --reset-cache. This one matters more than at install: until the cache is reset, tables written by the older version stay in the bundle and silently point to wrong files and lines. Every table carries the version of the plugin that wrote it (plugin), and doctor and status warn "source tables are stale" when it differs from the installed version.

Options

['@parallax-rn/babel-plugin', { injectTestIDs: false, root: process.cwd(), exclude: ['/stories/'] }]

| Option | Default | | |---|---|---| | injectTestIDs | false | Give react-native primitives without a testID (and without a spread) one named prn:<file>::<n>. It adds nodes to the accessibility tree (95 to 115 on one screen in spike 0004); its effect on E2E suites and VoiceOver is not measured. Elements that have a testID are never touched. | | root | Babel's working directory (Metro's project root) | File paths in the tables are relative to it. A file outside root gets no table. For sources outside the project (a monorepo package) set root to a directory that contains them; the keys are then relative to that directory, not to the project root. Each table records the root relative to the directory Babel ran in (root: "../.."; empty when they are the same, never absolute), and the Parallax tools use it to show paths relative to the project root. Sources under the project root are what stage 1 supports. | | exclude | [] | Regular expressions (strings) matched against the relative path; node_modules is always excluded. | Unknown options are an error. There is no option to force the plugin on in a release build, on purpose.

Files with no JSX, files in node_modules, files marked @generated or codegen in their first three comments, and files outside root get no table.

Dev-only safeguards (decision 0009)

  1. Active only when Babel's environment is development (Metro sets it only for dev bundles). Otherwise the output is exactly what it would be without the plugin (tested; a release bundle built with the plugin configured is byte-identical to one built without it).
  2. A build error when the Babel environment is development but NODE_ENV is production (a release pipeline told to build a dev bundle): "Fix: build releases with dev=false...".
  3. The emitted code is guarded by __DEV__.
  4. parallax-bundle-check <bundle> [--json], for CI: searches a release bundle, or the Hermes bytecode made from it, for what the plugin and the SDK leave behind (__PARALLAX_RN__, __PARALLAX_RN_PUSH__, injected prn:…::n ids). Exit code 0 clean, 1 found (listed with counts), 2 usage or file error.
    npx parallax-bundle-check ios/build/main.jsbundle

What a table looks like

{ p: [0, 3], file: 'src/Home.tsx', injected: false, plugin: '0.1.0', root: '', comps: [['HomeScreen', 6, 17]], els: [[0, 8, 5, 'View', 'HomeScreen', 6, 17, false, 'home/root', 'react-native'], …] }: element number, line, column (1-based, at the <), tag, enclosing component and where it is declared, whether a testID was injected, the author's testID (a literal, a pattern with * for the dynamic parts, or <expr>), and the module the tag was imported from. The contract is in @parallax-rn/protocol.

Cost (spike 0011, a real application)

Dev bundle +0.6% (+0.7% with injection), build time unchanged (4.2 s cold, 1.0 s warm); release bundle byte-identical; about 16 KB of tables are loaded for one screen.

Checks that need a React Native toolchain (not in CI)

scripts/verify-plugin-bundles.mjs <rn project dir> (throwaway project: dev and release bundles, the forgotten gate, Metro's cache), scripts/analyze-app.mjs <app dir> (runs the plugin over an app's sources, read only), scripts/measure-bundles.mjs <app dir> (offline bundle timings with an isolated cache), scripts/hermes-check.mjs (the check on Hermes bytecode).

License

Proprietary and free to use (decision 0014): see LICENSE in the package. The text is the beta terms, version 1. Tested on React Native 0.87.1.