Skip to content

Commit 5d4b3e1

Browse files
authored
Merge pull request #38 from flexn-io/main
Update release
2 parents 3235903 + 8c6da1c commit 5d4b3e1

File tree

7 files changed

+108
-32
lines changed

7 files changed

+108
-32
lines changed

docs/overview/migrating-react-native.md

Lines changed: 84 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,105 @@ sidebar_label: Migrating react-native
55
original_id: migrating_react_native
66
---
77

8-
9-
108
ReNative supports react-native projects pretty much out of the box in terms of your application code
119

1210
Due to variety of possibilities / complexity fo react-native projects (ie plugins, custom build scripts and so on) there might be some extra work required to reconnect existing plugins
1311

1412
---
13+
1514
## Migration Guide
1615

1716
1. Install rnv
1817
2. Create new project `rnv new` (pick @rnv/template-starter)
19-
3. follow rest of the steps
20-
4. After first `rnv run ...` check out the codebase and pay attention to:
18+
3. Follow rest of the steps of new project installation.
19+
4. After first `rnv run ...` check out the codebase.
20+
21+
### ReNative Project Folder Structure
22+
For more information about the project structure, please visit this <a href="/docs/overview/architecture#build-process">link</a>.
23+
24+
The `src/` folder contains the source content for your application. The initial structure of the `src/` folder includes the following subfolders:
25+
26+
- `app`: This folder contains the main files for your application.
27+
- `entry`: This folder allows you to configure the launch settings of your app. It is intended for advanced configuration and customization.
28+
- `pages`: This folder is needed for web in case you are using Next.js engine, if you don't plan to support web or don't want to use Next.js, don't include it
29+
30+
:::info
31+
You are not restricted to the three specified folders. Within the `src/` directory, you have the flexibility to create your own folders to organize styles, components, and any other necessary resources.
32+
:::
33+
34+
If you also installed some react native plugins in your project make sure to move them to `./renative.json` config file under `plugins` object.
35+
36+
Renative uses standard react native plugins so plugin names will stay same!
37+
38+
ReNative does not utilize autolinking as React Native does.
39+
Therefore, it's important to manually move and configure packages in your renative.json file.
40+
Proper handle of dependencies:
41+
42+
- Transfer the necessary packages to the renative.json file.
43+
For example:
44+
```
45+
"plugins": {
46+
"react-native": "source:rnv"
47+
}
48+
```
49+
- As in the above example all the necessary linking will be handled by ReNative, however some dependencies do not have existing mappings in ReNative (can be checked [here](https://github.com/flexn-io/commonwealth/blob/main/packages/plugins/pluginTemplates/renative.plugins.json)), you will need to implement them manually. For more information, please visit this <a href="/docs/concepts/plugins#custom-plugin-support">link</a>.
50+
51+
### Update Project Configuration Files
52+
When transferring your project, it's essential not to overlook updating your configuration files. This includes:
53+
- babel.config.js
54+
- tsconfig.json
55+
- next.config.js
56+
- react-native.config.js
57+
- And any other relevant configuration files
2158
22-
- `./index.ios.js` file
23-
- `./index.android.js` file
24-
- `src/` folder
59+
Ensuring these files are correctly configured will help avoid issues and ensure smooth operation of your project.
2560
26-
replace `src/` folder content with source content of your app (JS files)
61+
You can utilize ReNative's configuration methods to add your custom configurations. Here is example for `react-native.config.js`:
62+
```js title="react-native.config.js"
63+
const { withRNVRNConfig } = require('@rnv/adapter');
2764
28-
make sure that your main app.js is initialized in both
65+
const config = withRNVRNConfig({
66+
//custom configurations
67+
...
68+
});
2969
30-
- `./index.ios.js` file
31-
- `./index.android.js` file
70+
module.exports = config;
71+
```
72+
73+
By incorporating custom configurations in this manner, the basic ReNative configurations and your custom settings are merged and applied together when the app is run.
74+
75+
## Common Errors
76+
77+
#### Resolving `requestAnimationFrame` Error in `react-native-reanimated`
78+
##### Error
79+
```
80+
ReferenceError: requestAnimationFrame is not defined
81+
```
82+
##### Solution
83+
This error in `react-native-reanimated` has been addressed in [this pull request (PR)](https://github.com/software-mansion/react-native-reanimated/pull/4665).
84+
##### Steps
85+
To resolve this issue, ensure you update `react-native-reanimated` to version 3.5.0 or higher.
86+
87+
---
88+
#### Resolving Module Parse Error for `react-native/Libraries/NewAppScreen`
89+
90+
##### Error
91+
```
92+
Module parse failed for react-native/Libraries/NewAppScreen
93+
```
94+
95+
##### Solution
96+
To fix this error, you need to remove or replace the `Colors` import from `react-native/Libraries/NewAppScreen` with an alternative.
97+
98+
##### Steps
99+
1. **Remove the `Colors` import** from `react-native/Libraries/NewAppScreen` in your code.
100+
2. **Replace it with an alternative** color import or define your own color scheme to use in its place.
101+
102+
By following these steps, you should be able to resolve the module parse error and continue with your project.
103+
104+
---
32105

33-
that's it really.
34106

35-
if you also installed some react native plugins in your project make sure to move them to
36107

37-
`./renative.json` config file under `plugins` object. renative uses standard react native plugins so plugin names will stay same!
38108

39109
if you have any issues you can always raise a question or a bug in https://github.com/pavjacko/renative/issues

docs/platforms/androidwear.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,9 @@ or `renative.json:platforms.android.buildSchemes.[SCHEME].reactNativeEngine`
132132
## App Config
133133

134134
[see: Android based config](../api/schemas/rnv.project.md#android-props)
135+
136+
---
137+
## Connect WearOS with Mobile Device via Bluetooth
138+
139+
Follow the instructions at [react-native-wear-connectivity](https://github.com/fabOnReact/react-native-wear-connectivity?tab=readme-ov-file).
140+

docs/templates/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ sidebar_label: Templates
77

88
## @rnv/template-starter
99

10-
Version: `1.6.0`
10+
Version: `1.7.0`
1111

1212
<table>
1313
<tr>

docusaurus.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ const config = {
160160
},
161161
{
162162
position: 'left',
163-
label: 'v1.6',
164-
href: 'https://github.com/flexn-io/renative/releases/tag/1.6.0',
163+
label: 'v1.7',
164+
href: 'https://github.com/flexn-io/renative/releases/tag/1.7.0',
165165
},
166166
{
167167
type: 'doc',

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "renative-docs",
3-
"version": "1.6.0",
3+
"version": "1.7.0",
44
"private": true,
55
"scripts": {
66
"docusaurus": "docusaurus",
@@ -43,19 +43,19 @@
4343
"@docusaurus/tsconfig": "^3.1.1",
4444
"@docusaurus/types": "^3.1.1",
4545
"@flexn/prettier-config": "^1.0.0",
46-
"@rnv/core": "1.6.0",
47-
"@rnv/engine-lightning": "1.6.0",
48-
"@rnv/engine-rn": "1.6.0",
49-
"@rnv/engine-rn-electron": "1.6.0",
50-
"@rnv/engine-rn-macos": "1.6.0",
51-
"@rnv/engine-rn-next": "1.6.0",
52-
"@rnv/engine-rn-tvos": "1.6.0",
53-
"@rnv/engine-rn-web": "1.6.0",
54-
"@rnv/engine-rn-windows": "1.6.0",
55-
"@rnv/renative": "1.6.0",
46+
"@rnv/core": "1.7.0",
47+
"@rnv/engine-lightning": "1.7.0",
48+
"@rnv/engine-rn": "1.7.0",
49+
"@rnv/engine-rn-electron": "1.7.0",
50+
"@rnv/engine-rn-macos": "1.7.0",
51+
"@rnv/engine-rn-next": "1.7.0",
52+
"@rnv/engine-rn-tvos": "1.7.0",
53+
"@rnv/engine-rn-web": "1.7.0",
54+
"@rnv/engine-rn-windows": "1.7.0",
55+
"@rnv/renative": "1.7.0",
5656
"@types/mocha": "^10.0.6",
5757
"docusaurus-plugin-typedoc": "^0.22.0",
58-
"rnv": "1.6.0",
58+
"rnv": "1.7.0",
5959
"typedoc": "^0.25.8",
6060
"typedoc-plugin-markdown": "^3.17.1",
6161
"typedoc-plugin-zod": "1.1.2",

src/components/HomepageFeatures.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ const FeatureList = [
137137
? What's your project Name? (folder will be created) hello-renative
138138
? What workspace to use? rnv
139139
? What template to use? @rnv/template-starter
140-
? What @rnv/template-starter version to use? 1.6.0 (@latest)
140+
? What @rnv/template-starter version to use? 1.7.0 (@latest)
141141
? How to create config renative.json? Extend template (cleaner, overridable)
142142
? What's your project Title? My Renative App
143143
? What's your App ID? com.mycompany.hellorenative

src/pages/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ function HomepageHeader() {
1313
<div className="container">
1414
<p className={clsx(styles.h2, styles.version_link)}>
1515
Currently{' '}
16-
<a className="link" href="https://github.com/flexn-io/renative/releases/tag/1.6.0" target="_blank">
17-
v1.6
16+
<a className="link" href="https://github.com/flexn-io/renative/releases/tag/1.7.0" target="_blank">
17+
v1.7
1818
<img className="link_img" src="/img/link.svg" />
1919
</a>
2020
</p>

0 commit comments

Comments
 (0)