[MOO-2401]: add mendix-native as dependency - #613
Conversation
d08d309 to
7083f68
Compare
| import { getLocales } from "react-native-localize"; | ||
| import { ImagePickerV2Options, ImagePickerV2Response, PictureQuality, PictureSource } from "../../typings/Camera"; | ||
| import { PictureQuality, PictureSource } from "../../typings/Camera"; | ||
|
|
There was a problem hiding this comment.
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"; | ||
|
|
There was a problem hiding this comment.
Since mobile-resources-native is mobile-only, we can and should use direct imports like
import {} from "mendix-native";
import {} from "react-native-permissions”;
| @@ -31,7 +31,7 @@ overrides: | |||
|
|
|||
| patchedDependencies: | |||
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
Here can we use
const { NativeFileSystem } = await import("mendix-native");
There was a problem hiding this comment.
It leads to error in the web build
There was a problem hiding this comment.
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();
There was a problem hiding this comment.
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 ?
Checklist
[XX-000]: description)? ✅ ❌Feature specific
Please remove unnecessary emojis and sections and this comment before proceeding
This PR contains
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