Conversation
The camera was producing portrait-oriented photos when the tablet was held landscape, and the captured photo showed more content than what was visible in the preview. Root cause: SCREEN_WIDTH/SCREEN_HEIGHT were static module-level values that did not update on rotation, causing screenAspectRatio to be < 1 (portrait) — which doesn't match any landscape camera sensor format. - Use useWindowDimensions() for reactive dimensions that update on rotation - Calculate screenAspectRatio as max/min to always be >= 1, matching camera sensor formats (e.g. 4:3 = 1.33, 16:9 = 1.77) - Fix ESLint errors: == → ===, merge duplicate imports in useIsForeground.ts and usePreferredCameraDevice.ts - Fix .eslintrc.js: exclude jest plugin (incompatible with Node 22 / ESLint 8) - Bump version to 1.1.2 Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
`npm run lint` failed on these two files, which also blocked `npm run release` (prerelease runs lint). Formatting only, no functional change. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Studio Pro 11.10+ (native template 19+) no longer ships react-native-vector-icons: the template moved to the scoped @react-native-vector-icons/* packages and only includes material-icons. pluggable-widgets-tools still treats react-native-vector-icons as an external dependency, so it is neither bundled nor copied into the .mpk. On Mendix 11.12 every deploy therefore fails in the native bundling step: Unable to resolve module react-native-vector-icons/MaterialCommunityIcons from .../nativevisioncamera/NativeVisionCamera.ios.js - Add a small Icon component that draws SVG paths with react-native-svg, which is part of every Mendix native template (external, nothing to link) - Take the path data from @mdi/js (pure JS, tree-shaken into the bundle, Apache-2.0): camera flip, flash on/off, HDR on/off, night mode on/off - Drop react-native-vector-icons and its typings from package.json - Bump the version to 1.1.3, also in src/package.xml so Studio Pro shows it Works on older templates (which still had vector-icons) as well as 19+. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…rea-context react-native-static-safe-area-insets (last release 2022) does not build with Gradle 9 / AGP 8 as used by Mendix native template 19 (Studio Pro 11.10+): "Could not find method jcenter()" in its build.gradle, and it has no namespace. react-native-safe-area-context ships with every Mendix native template and is treated as external by pluggable-widgets-tools, so the widget no longer has to declare a native dependency for the safe area at all. - Wrap the widget in its own SafeAreaProvider so useSafeAreaInsets() works regardless of what the host app renders - Compute the safe area padding from the insets at render time instead of static module-level constants; positions that depend on it moved from the static StyleSheet into dynamic styles - The bottom inset is now applied on Android too (previously iOS only), which is needed with the edge-to-edge setting of template 19 - Remove the unused SCREEN_WIDTH / SCREEN_HEIGHT constants Co-Authored-By: Claude Fable 5.1 <[email protected]>
4.6.4 fails to compile against React Native 0.84.1 (native template 19.1): - CameraViewManager.kt: getExportedCustomDirectEventTypeConstants return type - CameraViewModule.kt: unresolved reference 'currentActivity' Both are fixed upstream in 4.7.x; 4.7.3 is the latest 4.x release. Verified with a full Gradle build of native template 19.1.5 (assembleAppstoreDebug). Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes the widget build and run on Mendix 11.10+ (native template 19+, React Native 0.84, new architecture). Version 1.1.3.
Builds on #4 (v1.1.2); until that one is merged this PR also shows that commit.
Problems on Mendix 11.12 / native template 19.1
Unable to resolve module react-native-vector-icons/MaterialCommunityIcons.Native template 19 dropped
react-native-vector-iconsin favour of the scoped@react-native-vector-icons/*packages (onlymaterial-icons), while pluggable-widgets-tools still treatsreact-native-vector-iconsas external, so it is neither bundled nor shipped in the .mpk.react-native-static-safe-area-insets: its build.gradle usesjcenter(), which no longer exists in Gradle 9, and it has nonamespace. The package has not been updated since 2022.react-native-vision-camera4.6.4 against React Native 0.84.1:getExportedCustomDirectEventTypeConstantsreturn type mismatch and unresolvedcurrentActivity.react-native-mmkv2.x: "Failed to create a new MMKV instance: React Native is not running on-device". mmkv 2.x checks forglobal.nativeCallSyncHook, which does not exist in bridgeless mode (the default with the new architecture). The message about a remote debugger is misleading.Changes
react-native-svg(part of every Mendix native template, external in the tooling) using path data from@mdi/js(pure JS, tree-shaken into the bundle).react-native-vector-iconsand its typings are removed. Same Material icons as before; the "night mode off" state is now an outlined moon.react-native-static-safe-area-insetsreplaced byreact-native-safe-area-context(also part of every template and external). The widget wraps itself in aSafeAreaProvider, and the safe-area padding is computed from the insets at render time instead of static module constants. One behaviour change: the bottom inset now also applies on Android (was iOS-only), which is needed with the edge-to-edge setting of template 19.react-native-vision-camerabumped to 4.7.3, the latest 4.x, which contains the React Native 0.8x fixes.react-native-mmkvremoved together with theusePreferredCameraDevicehook. The hook only ever read a stored device id; nothing in the widget called its setter, so the preference could never be set and the hook always returnedundefined. No behaviour change for users. If a preferred-device setting is wanted later, mmkv 3.x (TurboModule based) works on the new architecture, or the choice could live in a Mendix attribute.@react-native-community/blurandreact-native-vision-cameraas native dependencies.src/package.xmlso Studio Pro shows it. README lists the tested versions.npm run lint(and thereforenpm run release) passes.Verification
npm run releaseandnpm run lintpass.assembleAppstoreDebug, React Native 0.84.1, new architecture) succeeds.Note for users on Mendix 11
The nanoflow or JavaScript action that stores the captured file must read it through
NativeModules.MxFileSystem(the wayNativeMobileResources.TakePicturedoes in Mendix 11).fetch("file://...")no longer works on Android with the new architecture and fails with "Network request failed".🤖 Generated with Claude Code