Skip to content

Commit 097294c

Browse files
authored
release v2.0.0-alpha.0
2 parents 8d728aa + efe402c commit 097294c

File tree

227 files changed

+25205
-16499
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

227 files changed

+25205
-16499
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ packages/core/platforms/android/include.gradle
1313
packages/core/react-android/bridge/src/main/java/com/bridge/Packages.java
1414
packages/core/react-android/bridge/modules.json
1515
packages/core/react-android/bridge/modulemap.json
16-
16+
packages/core/src/android/view-manager-types.d.ts
17+
packages/core/src/ios/view-manager-types.d.ts
1718
packages/core/platforms/ios/Podfile
1819
packages/core/platforms/ios/React-Native-Podspecs.podspec
1920
packages/core/platforms/ios/lib_community/RNPodspecs.h

apps/demo/application.android.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* eslint-disable @typescript-eslint/no-unused-vars */
2+
@NativeClass()
3+
@JavaProxy('com.tns.NativeScriptApplication')
4+
class Application extends com.facebook.react.ReactCustomApplication {
5+
public onCreate(): void {
6+
super.onCreate();
7+
}
8+
9+
public attachBaseContext(baseContext: android.content.Context) {
10+
super.attachBaseContext(baseContext);
11+
}
12+
}

apps/demo/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@
1010
},
1111
"devDependencies": {
1212
"@nativescript/android": "~8.5.0",
13-
"@nativescript/ios": "~8.4.0",
13+
"@nativescript/ios": "~8.5.2",
1414
"@rigor789/resolve-package-path": "1.0.5",
1515
"metro-react-native-babel-preset": "file:../../node_modules/metro-react-native-babel-preset"
16+
},
17+
"scripts": {
18+
"clean:android": "cd platforms/android && ./gradlew clean",
19+
"clean:ios": "cd platforms/ios && rm -rf build && rm -rf DerivedData"
1620
}
1721
}

apps/demo/src/app.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Application } from '@nativescript/core';
2-
import { init } from '@open-native/core';
32

43
if (!global.performance) {
54
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -15,6 +14,4 @@ if (!global.performance) {
1514
};
1615
}
1716

18-
init();
19-
2017
Application.run({ moduleName: 'app-root' });

apps/demo/src/plugin-demos/core.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Observable, EventData, Page } from '@nativescript/core';
1+
import { EventData, Page } from '@nativescript/core';
22
import { DemoSharedOpenNative } from '@demo/shared';
33
// import {} from '@open-native/core';
44

@@ -7,4 +7,14 @@ export function navigatingTo(args: EventData) {
77
page.bindingContext = new DemoModel();
88
}
99

10+
export function loadingFinish(args: EventData) {
11+
const page = <Page>args.object;
12+
page.bindingContext = new DemoModel();
13+
console.log('loading');
14+
}
15+
16+
export function onLoaded(data) {
17+
console.log('loading finish called', data.nativeEvent);
18+
}
19+
1020
export class DemoModel extends DemoSharedOpenNative {}

apps/demo/src/plugin-demos/core.xml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
<Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="navigatingTo" class="page">
1+
<Page xmlns="http://schemas.nativescript.org/tns.xsd" xmlns:ui="./view" navigatingTo="navigatingTo" class="page">
22
<Page.actionBar>
3-
<ActionBar title="React Native with NativeScript" icon="" class="action-bar">
3+
<ActionBar title="React Native Modules" icon="" class="action-bar">
44
</ActionBar>
55
</Page.actionBar>
6-
<StackLayout class="p-20">
7-
<ScrollView class="h-full">
8-
<StackLayout>
9-
<Button text="Promise Test" tap="{{ testPromise }}" class="btn btn-primary"/>
10-
</StackLayout>
11-
</ScrollView>
6+
7+
<StackLayout>
8+
<Button text="Test Primitives" tap="{{ testPrimitives }}" class="btn btn-primary"/>
9+
<Button text="Test Promise" tap="{{ testPromise }}" class="btn btn-primary"/>
10+
<Button text="Test Callback" tap="{{ testCallback }}" class="btn btn-primary"/>
11+
<ui:ModuleTestView style="width:100%;height:200px;background-color:#f0f0f0;">
12+
<Label text="I am a RN view with children" />
13+
</ui:ModuleTestView>
1214
</StackLayout>
1315
</Page>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export const Home = () => {
2+
return (
3+
<flex>
4+
<webview
5+
javaScriptEnabled={true}
6+
source={{uri: 'https://nativescript.org'}}
7+
style={{
8+
backgroundColor: 'red',
9+
}}
10+
/>
11+
</flex>
12+
);
13+
};

apps/demo/src/plugin-demos/view.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { requireNativeComponent } from 'react-native';
2+
3+
export const ModuleTestView = requireNativeComponent('ModuleTestView');

apps/demo/webpack.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ module.exports = (env) => {
1111
config.resolve.alias.set('react-native', '@open-native/core');
1212
config.resolve.alias.set('crypto', 'crypto-js');
1313

14+
config.entry('application').add('./application.android');
15+
1416
config.module
1517
.rule('rnmodules')
1618
.include.add(/node_modules(.*[/\\])+react-native-auth0/)

docgen.yaml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
---
2-
title: "Open Native"
2+
title: 'Open Native'
33
logo: logo.png
4-
#base_path: "/open-native"
4+
docs_dir: ./docs_md
5+
edit_root: https://github.com/OpenNative/open-native/tree/main/docs_md/
6+
base_url: https://open-native.org
7+
58
navigation:
6-
- path: docs/installation.md
7-
- path: docs/install-module.md
8-
- path: docs/finding-modules.md
9-
- path: docs/reference.md
10-
- path: docs/troubleshooting.md
9+
- path: installation.md
10+
- path: install-module.md
11+
- path: finding-modules.md
12+
- path: reference.md
13+
- path: troubleshooting.md
14+
1115
colors:
12-
main: "#2dd4bc"
16+
main: '#2dd4bc'
17+
18+
footer:
19+
copyright: Copyright © 2023 Ammar Ahmed
File renamed without changes.

docs/CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
open-native.org

docs/assets/app.f93b0a1c15e882d9.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)