chore(computer-vision): upgrade vision-camera to 5.0.6 and refresh doc links#1088
chore(computer-vision): upgrade vision-camera to 5.0.6 and refresh doc links#1088NorbertKlockiewicz wants to merge 5 commits intomainfrom
Conversation
…c links Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Hmm, why is lint failing here? |
vision-camera 5.0.4 ships a buggy `postinstall: "tsc || exit 0"` that
runs at install time. On CI Linux runners (where tsc is on PATH) the
script invokes tsc with no args; tsc walks up to the monorepo root
tsconfig.json (which has no outDir) and emits compiled .js files next
to every .ts source across the monorepo. The `|| exit 0` swallows the
error, so install "succeeds" — then yarn lint trips on the stray .js
files via its `**/*.{js,ts,tsx}` glob and the whole CI run fails.
It only manifests on PRs that bump vision-camera (or otherwise
invalidate the per-version build state cache) AND on Linux. macOS
hides the bomb because tsc isn't on PATH inside the postinstall
scope, so the `|| exit 0` silently no-ops.
Use Yarn's `dependenciesMeta.<pkg>.built: false` to opt out of
vision-camera's install scripts entirely. The package ships pre-built
`lib/` so the postinstall is redundant for consumers anyway.
This is a local workaround. Tracking upstream fix at vision-camera
(remove the postinstall, or rename it to prepare so it doesn't run for
consumers).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Pushed a workaround commit ( The lint failure here was not caused by your changes — it was triggered by them. It only manifested here because this PR is the first to bump vision-camera to 5.0.4, invalidating Yarn's per-version build state cache and triggering a fresh build. macOS hides the bomb because The commit uses Yarn's We'll file an upstream issue against vision-camera (recommended fix: remove the |
vision-camera 5.0.4 dropped `getCameraFormat`, `Templates`, and several `<Camera>` props (`outputs`, `format`, `orientationSource`) that the example screen in `app/vision_camera/index.tsx` still references. With the install-script bomb defused in the previous commit, the typecheck step now actually runs and these long-standing incompatibilities surface. Add a `.d.ts` shim that augments the `react-native-vision-camera` module so `tsc --noEmit` passes. The runtime behavior of the screen is broken regardless — these declarations only silence the typecheck so unrelated PRs aren't blocked. The real fix is to migrate the screen to the new 5.x hook-based API (`useCamera`, `useFrameOutput`, etc.); a TODO is documented in the shim file. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Followup: with the install-script bomb defused, the typecheck step now actually runs and surfaces several real API incompatibilities between vision-camera 5.0.0-beta.7 (previous) and 5.0.4 (this PR). The example screen at Pushed The real fix is migrating the |
vision-camera 5.0.4 dropped `getCameraFormat`, `Templates`, and the
`<Camera format={...}>` prop. Their previous use in `vision_camera/index.tsx`
was a single `useMemo` that selected `Templates.FrameProcessing` and
passed the resulting format to `<Camera>`. In 5.x this is achieved
implicitly via `useFrameOutput`'s defaults (`HD_16_9` resolution,
`'native'` pixel format), so the explicit format selection is no
longer needed.
Drop the unused imports and the `format` block, and remove the
`vision-camera-shims.d.ts` workaround introduced in 54d1c66 — with the
consumer code aligned to the 5.x API surface, no shims are needed.
Other vision-camera APIs the screen and task files use (`Camera`,
`useCameraDevices`, `useCameraPermission`, `useFrameOutput`, `Frame`)
are unchanged across the 4.x → 5.x rewrite.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Followup: pushed Turns out the migration was much smaller than the shim's TODO suggested. The only 5.x breaking changes affecting our code were:
All of these were used in a single Everything else the screen and task files used ( Net diff: −13 lines from
CI green on all three steps. |
…to 0.13.1 Fixes iOS build error: 'RuntimeError' cannot be constructed because it has no accessible initializers. vision-camera 5.0.6 was built with nitrogen 0.35.4; older nitro-modules 0.35.2 lacked the public RuntimeError init. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Description
Upgrades
react-native-vision-camerain thecomputer-visionexample app from5.0.0-beta.7to^5.0.4, adds the now-requiredreact-native-vision-camera-workletscompanion package (needed for Frame Processors /useFrameOutputin v5 stable), and updates VisionCamera documentation links in the docs site to point to the new official location athttps://visioncamera.margelo.com(previously the temporaryreact-native-vision-camera-v5-docs.vercel.apppreview domain).Introduces a breaking change?
Type of change
Tested on
Testing instructions
yarn installat the repo root.cd apps/computer-vision && yarn ios(pods will reinstall for the new native module).Cannot use Frame Processors - react-native-vision-camera-worklets is not installed!error.cd docs && yarn start) and confirm the VisionCamera Integration page links resolve to the newvisioncamera.margelo.comURLs.Screenshots
N/A
Related issues
None
Checklist
Additional notes
version-0.8.xversioned copy.^5.0.4matches the latest published stable release;react-native-vision-camera-workletsis pinned to the same major/minor to stay in sync.