Skip to content

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

Open
SrirangK wants to merge 13 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 13 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
Comment thread packages/jsActions/mobile-resources-native/src/camera/TakePicture.ts Outdated
Comment thread packages/pluggableWidgets/web-view-native/src/__tests__/WebView.spec.tsx Outdated
@SrirangK
SrirangK force-pushed the moo/MOO-2401/add-mendix-native-dependency branch from d08d309 to 7083f68 Compare September 7, 2026 14:24
import { getLocales } from "react-native-localize";
import { ImagePickerV2Options, ImagePickerV2Response, PictureQuality, PictureSource } from "../../typings/Camera";
import { PictureQuality, PictureSource } from "../../typings/Camera";

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.

Since mobile-resources-native is mobile-only, we can and should use direct imports like
import {} from "mendix-native";
import {} from "react-native-permissions”;

import { getLocales } from "react-native-localize";
import { ImagePickerV2Options, ImagePickerV2Response, PictureQuality, PictureSource } from "../../typings/Camera";
import { PictureQuality, PictureSource } from "../../typings/Camera";

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.

Since mobile-resources-native is mobile-only, we can and should use direct imports like
import {} from "mendix-native";
import {} from "react-native-permissions”;

Comment thread pnpm-lock.yaml
@@ -31,7 +31,7 @@ overrides:

patchedDependencies:

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.

Lot of unrelated changes here. I would reset these, delete node_modules and then run pnpm install to get and keep relevant changes

// Native platform
if (navigator && navigator.product === "ReactNative") {
try {
const { NativeFileSystem } = await loadMendixNative();

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.

Here can we use
const { NativeFileSystem } = await import("mendix-native");

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It leads to error in the web build

@YogendraShelke YogendraShelke Sep 8, 2026

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.

We can even go 1 step further with types

type MendixNative = typeof import("mendix-native");

const loadMendixNative = (): Promise<MendixNative> => import("mendix-native");;

const { NativeFileSystem } = await loadMendixNative();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

writing the type safety code in the EXTRA CODE section leads to losing all the code in the block when we build. is it worth creating a seperate file for one js-action. Also using import("mendix-native") will be treated as static import and may still cause issue in web build. Is their any good advantage for us to go with the above way ?

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.

4 participants