Context
The Expo SDK 56 / React Native 0.85 iOS build exposed a maintenance risk in react-native-esc-pos-printer@4.5.0: the package ships pre-generated New Architecture codegen output that is stale for RN 0.85 (Constants::Builder missing ResultT). We patched it locally, but this is a signal that our native printer dependency stack needs a longer-term review.
Upstream issue: tr3v3r/react-native-esc-pos-printer#249
Current WCPOS printer stack
- Epson native iOS/Android:
react-native-esc-pos-printer, an unofficial RN wrapper around Epson ePOS SDK.
- Star native iOS/Android:
react-native-star-io10.
- Generic native network: raw TCP on port 9100 via
react-native-tcp-socket.
- Web USB/Bluetooth:
@point-of-sale/webusb-receipt-printer and @point-of-sale/webbluetooth-receipt-printer.
- Web network: vendor-specific HTTP protocols (
Epson ePOS, Star WebPRNT); generic raw TCP is not available in browsers.
- Generic native USB/Bluetooth: currently unsupported.
packages/printer already gives us a useful abstraction boundary (PrinterService, vendor adapters, discovery adapters), so this can probably be explored without changing printing UI flows.
Proposal to investigate
Research/design a WCPOS-owned modern printer native layer for Expo/New Architecture, potentially as one consistent package/API for:
- Epson
- Star
- Generic ESC/POS
Possible package shape:
@wcpos/expo-printer-native
discover(options)
printRaw(options)
pairBluetoothDevice?(options)
getStatus?(options)
or vendor-focused modules behind a shared JS facade:
@wcpos/expo-epson-printer
@wcpos/expo-star-printer
@wcpos/expo-generic-printer
@wcpos/printer # existing cross-platform abstraction/facade
Questions to answer
- Should we build one native Expo module for all vendors, or separate vendor modules behind the existing
@wcpos/printer abstraction?
- Can we wrap only the small native surface we need instead of exposing entire vendor SDKs?
- Epson: discovery, raw ESC/POS via
Epos2Printer.addCommand, send, status, Bluetooth pairing.
- Star: discovery and raw print via StarIO10.
- Generic: network TCP, and possibly native USB/Bluetooth raw writes.
- How should we package vendor binaries/licensing?
- Epson SDK redistribution may need review before publishing publicly.
- Internal app-only use may have fewer constraints than a public npm package.
- What is the right migration path from
react-native-esc-pos-printer without breaking current printer profiles?
- What test hardware/simulator coverage do we need for Epson, Star, generic network, USB, and Bluetooth?
Success criteria for a spike
- A minimal Expo Modules API module builds on Expo SDK 56 / RN 0.85 iOS and Android.
- It can print raw ESC/POS bytes to at least one Epson printer using Epson's official SDK.
- It can preserve the existing
@wcpos/printer public API for app code.
- It documents whether a single consolidated package or vendor-specific packages are the better long-term shape.
Context
The Expo SDK 56 / React Native 0.85 iOS build exposed a maintenance risk in
react-native-esc-pos-printer@4.5.0: the package ships pre-generated New Architecture codegen output that is stale for RN 0.85 (Constants::BuildermissingResultT). We patched it locally, but this is a signal that our native printer dependency stack needs a longer-term review.Upstream issue: tr3v3r/react-native-esc-pos-printer#249
Current WCPOS printer stack
react-native-esc-pos-printer, an unofficial RN wrapper around Epson ePOS SDK.react-native-star-io10.react-native-tcp-socket.@point-of-sale/webusb-receipt-printerand@point-of-sale/webbluetooth-receipt-printer.Epson ePOS,Star WebPRNT); generic raw TCP is not available in browsers.packages/printeralready gives us a useful abstraction boundary (PrinterService, vendor adapters, discovery adapters), so this can probably be explored without changing printing UI flows.Proposal to investigate
Research/design a WCPOS-owned modern printer native layer for Expo/New Architecture, potentially as one consistent package/API for:
Possible package shape:
or vendor-focused modules behind a shared JS facade:
Questions to answer
@wcpos/printerabstraction?Epos2Printer.addCommand, send, status, Bluetooth pairing.react-native-esc-pos-printerwithout breaking current printer profiles?Success criteria for a spike
@wcpos/printerpublic API for app code.