Skip to content

Commit 792de6f

Browse files
authored
Separate uilib-native (#3395)
* Separate uilib-native * Fixes
1 parent a862dc4 commit 792de6f

File tree

15 files changed

+51
-23
lines changed

15 files changed

+51
-23
lines changed

android/app/build.gradle

-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ dependencies {
125125
implementation("com.facebook.react:flipper-integration:0.73.9")
126126

127127
implementation project(':react-native-navigation')
128-
implementation project(':react-native-ui-lib')
129128
implementation 'com.facebook.fresco:fresco:2.5.0'
130129
implementation 'com.facebook.fresco:animated-gif:2.5.0'
131130

android/app/src/main/java/com/rnuilib/MainApplication.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class MainApplication : NavigationApplication() {
2222
PackageList(this).packages.apply {
2323
// Packages that cannot be autolinked yet can be added manually here, for example:
2424
// add(UiLibPackageList(MainApplication.this).getPackageList())
25-
addAll(UiLibPackageList(this@MainApplication).getPackageList())
25+
// addAll(UiLibPackageList(this@MainApplication).getPackageList())
2626
// add(MyReactNativePackage())
2727
}
2828

android/settings.gradle

-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
21
pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") }
32
plugins { id("com.facebook.react.settings") }
43
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
54
rootProject.name = 'rnuilib'
6-
// apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
75
include ':app'
86
includeBuild('../node_modules/@react-native/gradle-plugin')
9-
10-
include ':react-native-ui-lib'
11-
project(':react-native-ui-lib').projectDir = new File(rootProject.projectDir, '../lib/android')

ios/Podfile

-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ if linkage != nil
2525
end
2626

2727
target 'rnuilib' do
28-
pod 'ReactNativeUiLib', :path => "../lib/ReactNativeUiLib.podspec"
29-
3028
config = use_native_modules!
3129

3230
use_react_native!(

ios/rnuilib.xcodeproj/project.pbxproj

+4-2
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,8 @@
878878
OTHER_CPLUSPLUSFLAGS = "$(inherited)";
879879
OTHER_LDFLAGS = (
880880
"$(inherited)",
881-
" ",
881+
"-Wl",
882+
"-ld_classic",
882883
);
883884
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
884885
SDKROOT = iphoneos;
@@ -939,7 +940,8 @@
939940
OTHER_CPLUSPLUSFLAGS = "$(inherited)";
940941
OTHER_LDFLAGS = (
941942
"$(inherited)",
942-
" ",
943+
"-Wl",
944+
"-ld_classic",
943945
);
944946
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
945947
SDKROOT = iphoneos;

jestSetup/jest-setup.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {NativeModules, AccessibilityInfo, Animated} from 'react-native';
1+
import {AccessibilityInfo, Animated} from 'react-native';
22
// ========= Mock Object.defineProperty to always allow overriding =========
33
const originalDefineProperty = Object.defineProperty;
44
Object.defineProperty = (obj, prop, desc) => {

lib/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "uilib-native",
3-
"version": "4.3.2",
3+
"version": "4.4.0",
44
"homepage": "https://github.com/wix/react-native-ui-lib",
55
"description": "uilib native components (separated from js components)",
6-
"main": "components/index.js",
6+
"main": "components/index",
77
"scripts": {
88
"releaseNative": "node ./scripts/releaseNative.js"
99
},

lib/react-native.config.js

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module.exports = {
2+
dependency: {
3+
platforms: {
4+
/* TODO: Once we upgrade to RN69 we should try using podspecPath again, for now I copied ReactNativeUiLib.podspec file to the root - it seems to work
5+
I copied it, because we need it for both the main uilib and the uilib-native package */
6+
// ios: {
7+
// podspecPath: './lib/ReactNativeUiLib.podspec'
8+
// },
9+
android: {
10+
sourceDir: './android/',
11+
packageImportPath: `import com.wix.reactnativeuilib.dynamicfont.DynamicFontPackage;
12+
import com.wix.reactnativeuilib.highlighterview.HighlighterViewPackage;
13+
import com.wix.reactnativeuilib.keyboardinput.KeyboardInputPackage;
14+
import com.wix.reactnativeuilib.textinput.TextInputDelKeyHandlerPackage;`,
15+
packageInstance: `new DynamicFontPackage(),
16+
new HighlighterViewPackage(),
17+
new TextInputDelKeyHandlerPackage(),
18+
new KeyboardInputPackage(getApplication())`
19+
}
20+
}
21+
}
22+
};

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"react-native-redash": "^12.0.3",
5555
"semver": "^5.5.0",
5656
"tinycolor2": "^1.4.2",
57+
"uilib-native": "^4.3.2",
5758
"url-parse": "^1.2.0",
5859
"wix-react-native-text-size": "1.0.9"
5960
},
@@ -137,7 +138,7 @@
137138
"jest": {
138139
"preset": "react-native",
139140
"transformIgnorePatterns": [
140-
"node_modules/(?!(@react-native|react-native|react-native-reanimated|react-native-redash)/)"
141+
"node_modules/(?!(@react-native|react-native|react-native-reanimated|react-native-redash|uilib-native)/)"
141142
],
142143
"testPathIgnorePatterns": [
143144
"/e2e/",

react-native.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = {
77
// podspecPath: './lib/ReactNativeUiLib.podspec'
88
// },
99
android: {
10-
sourceDir: './lib/android/',
10+
sourceDir: '../uilib-native/android/',
1111
packageImportPath: `import com.wix.reactnativeuilib.dynamicfont.DynamicFontPackage;
1212
import com.wix.reactnativeuilib.highlighterview.HighlighterViewPackage;
1313
import com.wix.reactnativeuilib.keyboardinput.KeyboardInputPackage;

scripts/build/buildPackages/buildCustomPackages.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const _ = require('lodash');
44
const packages = [
55
{
66
filename: 'keyboard.js',
7-
content: `module.exports = require('./lib/components/Keyboard').default;\n`
7+
content: `module.exports = require('uilib-native').Keyboard;\n`
88
},
99
{
1010
filename: 'assets.js',

src/components/featureHighlight/index.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@ import {
1010
TouchableWithoutFeedbackProps,
1111
LayoutChangeEvent
1212
} from 'react-native';
13+
import {HighlighterOverlayView} from 'uilib-native';
1314
import {Colors, Typography} from '../../style';
1415
import {Constants, asBaseComponent} from '../../commons/new';
1516
import View from '../view';
1617
import Text from '../text';
1718
import Button, {ButtonProps, ButtonSize} from '../button';
1819
import PageControl, {PageControlProps} from '../pageControl';
19-
//@ts-expect-error
20-
import {HighlighterOverlayView} from '../../nativeComponents';
2120

2221
const defaultOverlayColor = Colors.rgba(Colors.black, 0.82);
2322
const defaultTextColor = Colors.white;

src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export {default as Assets} from './assets';
33
export type {emojis as EmojisAssetsType} from './assets/emojis';
44
export * from './style';
55
export * from './services';
6-
export * from '../lib/components';
6+
export * from 'uilib-native';
77
export {
88
asBaseComponent,
99
Config,

src/nativeComponents/index.js

-2
This file was deleted.

yarn.lock

+15-1
Original file line numberDiff line numberDiff line change
@@ -8412,7 +8412,7 @@ __metadata:
84128412
languageName: node
84138413
linkType: hard
84148414

8415-
"lodash@npm:4.17.x, lodash@npm:4.x.x, lodash@npm:^4, lodash@npm:^4.17.10, lodash@npm:^4.17.21":
8415+
"lodash@npm:4.17.x, lodash@npm:4.x.x, lodash@npm:^4, lodash@npm:^4.0.0, lodash@npm:^4.17.10, lodash@npm:^4.17.21":
84168416
version: 4.17.21
84178417
resolution: "lodash@npm:4.17.21"
84188418
checksum: eb835a2e51d381e561e508ce932ea50a8e5a68f4ebdd771ea240d3048244a8d13658acbd502cd4829768c56f2e16bdd4340b9ea141297d472517b83868e677f7
@@ -10367,6 +10367,7 @@ __metadata:
1036710367
shell-utils: ^1.0.10
1036810368
tinycolor2: ^1.4.2
1036910369
typescript: 5.0.4
10370+
uilib-native: ^4.3.2
1037010371
url-parse: ^1.2.0
1037110372
wix-react-native-text-size: 1.0.9
1037210373
peerDependencies:
@@ -12037,6 +12038,19 @@ __metadata:
1203712038
languageName: node
1203812039
linkType: hard
1203912040

12041+
"uilib-native@npm:^4.3.2":
12042+
version: 4.3.2
12043+
resolution: "uilib-native@npm:4.3.2"
12044+
dependencies:
12045+
lodash: ^4.0.0
12046+
prop-types: ^15.5.10
12047+
peerDependencies:
12048+
react: ^16.0.0
12049+
react-native: ^0.51.0
12050+
checksum: 051fbba7a351f5ab098c8471a8b35f05c1b61df55b94b0fbb56d594e2fb856bc4ed1bc0575aedaa0659da5f14c4a0d2b4e6b4d48e5bce6eefab0067b5352b95f
12051+
languageName: node
12052+
linkType: hard
12053+
1204012054
"unbox-primitive@npm:^1.0.2":
1204112055
version: 1.0.2
1204212056
resolution: "unbox-primitive@npm:1.0.2"

0 commit comments

Comments
 (0)