2.0.0-alpha.29 • Published 26 days ago

@open-native/core v2.0.0-alpha.29

Weekly downloads
-
License
MIT
Repository
github
Last release
26 days ago

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

allprojects {

  // Nativescript by default runs this hook for all plugin builds,
  // but we want to run it only when the main app builds.
  if (!rootProject.projectDir.absolutePath.contains("tempPlugin")) {
    // We are replacing com.facebook.react:react-native with our local :react library in all linked libraries.
    // We could do this inside the module itself but we want the module to work in both
    // react-native & nativescript
    configurations {
      all {
        resolutionStrategy {
          dependencySubstitution {
            substitute module("com.facebook.react:react-native") using project(":react") because "we will replace this with our local react"
          }
        }
      }
    }
  }
}

Configure Webpack

Alias react-native with @open-native/core.

webpack.chainWebpack((config) => {
  config.resolve.alias.set('react-native', '@open-native/core');
});

If you install a react-natie module & get errors in webpack, 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.resolve.alias.set('react-native', '@open-native/core');
  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

2.0.0-alpha.32

26 days ago

2.0.0-alpha.31

27 days ago

2.0.0-alpha.30

27 days ago

2.0.0-alpha.29

5 months ago

2.0.0-alpha.28

5 months ago

2.0.0-alpha.27

5 months ago

2.0.0-alpha.26

5 months ago

2.0.0-alpha.25

5 months ago

2.0.0-alpha.24

5 months ago

2.0.0-alpha.23

5 months ago

2.0.0-alpha.22

5 months ago

2.0.0-alpha.21

5 months ago

2.0.0-alpha.20

5 months ago

2.0.0-alpha.19

5 months ago

2.0.0-alpha.18

6 months ago

2.0.0-alpha.7

10 months ago

2.0.0-alpha.8

10 months ago

2.0.0-alpha.9

10 months ago

2.0.0-alpha.11

8 months ago

2.0.0-alpha.3

10 months ago

2.0.0-alpha.10

9 months ago

2.0.0-alpha.4

10 months ago

2.0.0-alpha.5

10 months ago

2.0.0-alpha.6

10 months ago

2.0.0-alpha.0

10 months ago

2.0.0-alpha.1

10 months ago

2.0.0-alpha.2

10 months ago

2.0.0-alpha.17

6 months ago

2.0.0-alpha.16

6 months ago

2.0.0-alpha.15

6 months ago

2.0.0-alpha.14

6 months ago

2.0.0-alpha.13

7 months ago

2.0.0-alpha.12

8 months ago

1.0.0-alpha.38

12 months ago

1.0.0-alpha.37

12 months ago

1.0.0-alpha.34

12 months ago

1.0.0-alpha.33

1 year ago

1.0.0-alpha.36

12 months ago

1.0.0-alpha.35

12 months ago

1.0.0-alpha.30

1 year ago

1.0.0-alpha.32

1 year ago

1.0.0-alpha.31

1 year ago

1.0.0-alpha.27

1 year ago

1.0.0-alpha.26

1 year ago

1.0.0-alpha.29

1 year ago

1.0.0-alpha.28

1 year ago

1.0.0-alpha.21

1 year ago

1.0.0-alpha.20

1 year ago

1.0.0-alpha.23

1 year ago

1.0.0-alpha.22

1 year ago

1.0.0-alpha.25

1 year ago

1.0.0-alpha.24

1 year ago

1.0.0-alpha.19

1 year ago

1.0.0-alpha.16

1 year ago

1.0.0-alpha.15

1 year ago

1.0.0-alpha.18

1 year ago

1.0.0-alpha.17

1 year ago

1.0.0-alpha.14

1 year ago

1.0.0-alpha.9

2 years ago

1.0.0-alpha.8

2 years ago

1.0.0-alpha.7

2 years ago

1.0.0-alpha.6

2 years ago

1.0.0-alpha.10

1 year ago

1.0.0-alpha.5

2 years ago

1.0.0-alpha.4

2 years ago

1.0.0-alpha.3

2 years ago

1.0.0-alpha.12

1 year ago

1.0.0-alpha.11

1 year ago

1.0.0-alpha.13

1 year ago

1.0.0-alpha.2

2 years ago

1.0.0-alpha.1

2 years ago

1.0.0-alpha.0

2 years ago