JSPM

  • Created
  • Published
  • Downloads 64
  • Score
    100M100P100Q69926F
  • License MIT

Open Native helps cross platform communities work better together.

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@open-native/core) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Open Native is an effort to bring cross platform communities together & help them collaborate and share work.

    Installation

    npm install @open-native/core

    Android Setup

    Create `App_Resources/Android/before-plugins.gradle with the following contents

    apply from: new File(["node", "--print", "require.resolve('@open-native/core/package.json')"].execute(null, rootDir).text.trim(), "../scripts/open-native.gradle");
    ext {
            // The versions used here should be same as the one's set in app.gradle file.
            buildToolsVersion = '33.0.0'
            minSdkVersion = 23
            compileSdkVersion = 33
            targetSdkVersion = 33
            reactNativeProjects = []
    
            androidXCoreVersion = "1.8.0"
            androidXCompatVersion = "1.5.1"
    }

    Create App_Resources/Android/settings.gradle and paste the following contents:

    apply from: new File(["node", "--print", "require.resolve('@open-native/core/package.json')"].execute(null, rootDir).text.trim(), "../scripts/native_modules.gradle");

    Configure Webpack (Optional)

    If you install a react-native module & get errors during webpack complation, install metro-react-native-babel-preset via npm/yarn.

    npm install -D metro-react-native-babel-preset

    add the following preset to your webpack config.

    webpack.chainWebpack((config) => {
      config.module
        .rule('rnmodules')
        // Add each react-native module that gives errors in webpack build here
        // like this:
        .include.add(/node_modules(.*[/\\])+react-native-module/)
        .end()
        .use('babel-loader')
        .before('ts-loader')
        .loader('babel-loader')
        .options({
          babelrc: false,
          presets: ['module:metro-react-native-babel-preset'],
        });
    });

    That's all, try out some react-native modules & feel free to open and issue if you face a problem.

    Join the NativeScript Discord Community

    Contributing

    If you want to contribute, feel free to open an issue or join our discord community to discuss your ideas.

    MIT License

    Copyright (c) 2022 Ammar Ahmed