Comparing native and web
Use the Octapus dev tool to see your app natively and in WebKit side by side, and find what differs.
The dev tool is a macOS app that ships with the Octapus checkout. Run it from there:
pnpm devtoolIt has two tabs: Octane, for checking an app, and Hermes, a JavaScript playground for the runtime itself.
The Octane tab
Edit .tsrx and CSS in the tab's editor (it starts from a sample project; paste in the components you want to check). Every edit rebuilds with oct build --target web,mac, bakes a snapshot and launches it, so you always see the current code.
Preview modes
| Mode | Shows |
|---|---|
| Native | Your app drawn by Octapus with AppKit views |
| Web | The web build in a WebKit view |
| Side by side | Both, next to each other |
| Overlay | Web on top of native, with an opacity slider |
The Hydrate picker switches the hydration strategy so you can watch the snapshot, the takeover and held taps at each setting.
Inspectors
| Inspector | Use it to |
|---|---|
| Native vs Web | Find layout differences: every element's position and size on both sides, with the difference |
| Launch | Read the launch metrics: phases, timings, held and replayed taps |
| Frame | See what the snapshot contains, row by row |
| Batches | Follow updates after launch: what caused each one, how long JS and native took |
| Host tree | See the native element tree your app produced |
| Console | Read console.log output from Hermes |
| Compiled | Read what the compiler made of App.tsrx |
The launch timeline above the preview shows snapshot read, draw, Hermes start and takeover with their durations. When the first render did not match the snapshot it shows where they differed.
The Hermes tab
A scratchpad for plain JavaScript on Hermes: edit code, it compiles to bytecode, and you can call any global function with JSON arguments and time repeated calls. Useful for checking whether a piece of logic is fast on Hermes before you put it in a component.