Skip to content

[MOO-2401]: add mendix-native as dependency - #613

Open
SrirangK wants to merge 5 commits into
mx/11.12.xfrom
moo/MOO-2401/add-mendix-native-dependency
Open

[MOO-2401]: add mendix-native as dependency#613
SrirangK wants to merge 5 commits into
mx/11.12.xfrom
moo/MOO-2401/add-mendix-native-dependency

Conversation

@SrirangK

Copy link
Copy Markdown
Contributor

Checklist

  • Contains unit tests ✅ ❌
  • Contains breaking changes ✅ ❌
  • Compatible with: MX 8, 9, 10
  • Did you update version and changelog? ✅ ❌
  • PR title properly formatted ([XX-000]: description)? ✅ ❌
  • Works in Android ✅ ❌
  • Works in iOS ✅ ❌
  • Works in Tablet ✅ ❌

Feature specific

  • Comply with designs ✅ ❌
  • Comply with PM's requirements ✅ ❌

Please remove unnecessary emojis and sections and this comment before proceeding

This PR contains

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Other (describe)

What is the purpose of this PR?

...

Relevant changes

Please add a high level explanation of what was changed and how the initial problem was solved

What should be covered while testing?

...

Extra comments (optional)

Please add extra comments or delete the section if not required

@SrirangK
SrirangK requested a review from a team as a code owner August 31, 2026 06:29

// V3 dropped the feature of providing an action sheet so users can decide on which action to take, camera or library.
const nativeVersionMajor = NativeModules?.ImagePickerManager?.showImagePicker ? 2 : 4;
const nativeVersionMajor = getNativeModule<{ showImagePicker?: unknown }>("ImagePickerManager")?.showImagePicker

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would consider having the ImagePickerManager extracted in a separate scoped module under mendix-native, similar to file-system.
Since we are using it in more than 2 places here. It would be cleaner and more maintainable to end up with a simple
import { ImagePickerManager } from ....
const nativeVersionMajor = ImagePickerManager.version;

jest.mock("react-native", () => {
const RN = jest.requireActual("react-native");
RN.NativeModules.RNCWebView = { isFileUploadSupported: jest.fn(() => true) };
const nativeModules = RN["Native" + "Modules"];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This access via string concatenation looks redundant. Is there a reason why we are not keeping the direct access via RN.NativeModules?

// BEGIN USER CODE
// Documentation https://github.com/invertase/notifee
if (NativeModules && !NativeModules.NotifeeApiModule) {
if (!getNativeModule("NotifeeApiModule")) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the comment above , let's consider if having a separate declaration for this module in mendix-native would be better.
So we don't use a generic API to 'manually type and search' for modules, but rely on the exposed imports of mendix-native/*.


This affects the other statically typed modules below as well e.g. RNFBMessagingModule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants