docs(react-native): add AIO components guides - #432
Conversation
|
ilber
left a comment
There was a problem hiding this comment.
🤖 Review pass with one lens: a React Native dev who has never touched a Scandit API. The prose is good and the ordering of the four steps is right. What I found splits into snippets that don't run as pasted, a few concepts that arrive before they're defined, and two things a first-timer will look for and not find. Inline below.
Takes a React Native developer from an empty app to two working scanning screens using the AIO components, which ship public in 8.7 with no guide. Covers mounting ScanditProvider, rendering SparkScanAioView and handling results, navigating between two scanning screens, camera position and torch, camera permissions, and the architecture support statement. The navigation section leads with the `navigation` prop, since passing the screen's navigation object is what actually suspends and resumes scanning on blur and focus. The example crosses SparkScanAioView (exclusive camera claim) to BarcodeCaptureAioView (shared), which is the transition applications get wrong. No shared partial is imported: the common get-started partial builds a DataCaptureContext by hand, which is the work ScanditProvider removes. SDC-33129
0d8c65e to
bce6d9f
Compare
Get Started keeps the linear path from empty app to first scanner and now summarises the camera handover in three sentences, linking onward. Navigating Between Screens covers it properly: which views take a shared claim and which takes an exclusive one, the navigation prop, and the `disabled` / `appStateHandlingDisabled` props that decide when a view scans.
ilber
left a comment
There was a problem hiding this comment.
🤖 Follow-up pass on 94841c09 (the page split). The split is an improvement — the ownership model has its own page now, and the shared-vs-exclusive view list is the concrete detail the original was missing. Three new findings on navigating-between-screens.md below, same lens as before.
Two carry-overs worth noting rather than duplicating as new threads: LICENSE_KEY is now undefined in both files, and the new page has no prerequisites of its own despite importing @react-navigation/native and @react-navigation/stack — someone landing there from search has no install path at all. Both are covered by the existing open threads on get-started.
Snippets now run as pasted: LICENSE_KEY is declared, useEffect is imported, the torch example is a component rather than a bare JSX expression, and the first scanning screen is mounted so step 2 ends in something runnable. Prerequisites names both Scandit packages and flags React Navigation as not part of the SDK. New "Calling the View Directly" section introduces the handle through a ref, so enable() and disable() are reachable and the term is defined before the navigation page uses it. frameSourceState is dropped from this page instead: no snippet here uses it, and the provider reference covers it. didScan's promise now says what it buys the reader. Symbologies link to the reference. Adds a Troubleshooting section, an AIO-versus-classic sentence, and two more entries under Where to Go Next. On the navigation page, disabled gets a snippet, and the prop-versus-handle hazard now states the observable behaviour: the focus and foreground handlers read the disabled prop, so an imperative disable() is undone at the next focus or foreground event.
|
🤖 All 18 open threads addressed in Snippets that did not run as pasted. Terms used before they were defined. A new Calling the View Directly section introduces the handle through a Framing. "Keep the frame alive" is replaced by what it buys the reader — doing asynchronous work such as a product lookup before the next scan is processed — with the Additions. A three-symptom Troubleshooting section: symbology not enabled, two views competing for the camera, and no permission dialog. An AIO-versus-classic sentence in the intro linking to the classic Barcode Capture guide. Where to Go Next now has four entries including the provider API reference and that classic guide. On the One item is deliberately not done: linking the classic-versus-AIO comparison guide. That page is in flight under SDC-33130 and does not exist yet, and |
…130] The intro carried a TODO instead of a live link because onBrokenLinks is "throw" and the page did not exist yet. #432 published it, so the link works now. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Heads-up: this is being reverted in #441, and not because of anything wrong with the content. These pages document components that ship in 8.7, but Nothing is lost. The branch |
Documents the React Native AIO components, which ship public in 8.7 with no guide. For most readers these pages are their first contact with the API.
Jira: SDC-33129 · Fix version
8.7.0-beta.1What's here
A new AIO Components category in the React Native sidebar, with two pages.
aio/get-started.md— the linear path from an empty app to a working scanner: mountingScanditProvider, adding aSparkScanAioViewand handling results, camera position and torch, camera permissions, and the architecture support statement. The intro states that the components are available from 8.7.aio/navigating-between-screens.md— the advanced page. Which views take a shared claim on the provider's camera and which one takes an exclusive claim, thenavigationprop that suspends and resumes scanning on blur and focus, and thedisabled/appStateHandlingDisabledprops for when focus and foreground are not the whole story.Decisions worth reviewing
Navigation earns its own page. A single scanning screen is straightforward; a second one is where applications go wrong, and the material did not fit the linear shape of a getting-started guide. Get Started summarises the handover in three sentences and links onward.
The navigation page leads with the
navigationprop. Passing the screen's navigation object is the concrete answer to "how do I use two scanning screens", so the ownership model is explained around it rather than on its own. The example crossesSparkScanAioView(exclusive claim) toBarcodeCaptureAioView(shared), because that transition is the one that breaks.No shared partial is imported. Nine of the eleven React Native get-started pages import
_create-data-capture-context-react-native.mdx, which builds aDataCaptureContextby hand. That is the workScanditProviderremoves, so reusing it would contradict the guide.Three things were deliberately left out.
reset()is too specific for a getting-started reader and belongs on the view reference page. Passing application data between screens is not something the SDK provides —ScanditProvidershares the capture context and the camera, and the only React context in the packages is internal — so that guidance would be generic React advice under Scandit's name. And a separateScanditProviderpage was folded into Get Started once the reference page in SDC-33126 was accounted for.Verification
yarn buildclean.onBrokenMarkdownLinksandonBrokenAnchorsare boththrow, so internal links and anchors between the two pages are verified.yarn docs:gateclean (Vale, cspell, frontmatter).ts/index.tsondevelop.frameSourceStateclaim release on unmount, and the Android/iOS split inuseCameraPermission.Note on links
The
core/api/scandit-provider.htmllinks point at the reference page added by SDC-33126, which is not merged yet. They resolve once it lands.