Граф коммитов

567 Коммитов

Автор SHA1 Сообщение Дата
Frieder Bluemle efe5f62f91 Fix whitespace and newline at EOF (#35939)
Summary:
Just a couple of minor fixes in the `template/` folder:

- Remove a trailing space in `rn_edit_text_material.xml` (this was the _only_ trailing space present in a newly generated RN project), which results in the check against the empty tree object failing:
  ```
  $ git diff --check 4b825dc -- template/
  template/android/app/src/main/res/drawable/rn_edit_text_material.xml:23: trailing whitespace.
  +        <!--
  ```
- Add missing newline at end of file in `.watchmanconfig` and `app.json` - Both are text files, and each line (including the last) is expected to end with a newline character (flagged by Git, and also visible as a warning on GitHub):
  <img width="369" alt="image" src="https://user-images.githubusercontent.com/743291/214195867-81c8e622-2130-44d4-bdaf-588e3510c109.png">

## Changelog

[GENERAL] [FIXED] - Fix whitespace and newline at EOF in template

Pull Request resolved: https://github.com/facebook/react-native/pull/35939

Reviewed By: christophpurrer

Differential Revision: D42698256

Pulled By: rshest

fbshipit-source-id: 765fd41d4f501aec578755c754ea0ecb290ae6ca
2023-01-24 03:00:08 -08:00
sottar 3876368f0c Update Podfile in template (#35931)
Summary:
Added comment on Podfile under template directory.
I'm working with monorepo and didn't realize it easily to specify the path for react_native_post_install, so I thought it would be better to add this comment.

## Changelog

[IOS] [ADDED] - add comments for specifying the path to React Native

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

Pull Request resolved: https://github.com/facebook/react-native/pull/35931

Reviewed By: cipolleschi

Differential Revision: D42673707

Pulled By: jacdebug

fbshipit-source-id: 39e424a051d238f6dad42cb0b7748d4f4c400787
2023-01-24 02:29:00 -08:00
Jean-Baptiste LARRIVIERE b314e6f147 feat: add initialProps property to RCTAppDelegate (#35848)
Summary:
Hi there,

While upgrading to 0.71 we realised the RCTAppDelegate doesn't offer a way to set custom `initProps` that would depend on `launchOptions`.

This PR adds an `initialProps` property to the RCTAppDelegate. This would let us set this property based on `launchOptions` in our implementation of `didFinishLaunchingWithOptions` before calling `[super didFinishLaunchingWithOptions]`

Thanks !

## Changelog

[IOS] [ADDED] - Add `initialProps` property to `RCTAppDelegate`

Pull Request resolved: https://github.com/facebook/react-native/pull/35848

Reviewed By: rshest

Differential Revision: D42543027

Pulled By: cipolleschi

fbshipit-source-id: 55374914890445f8193c12a06a943b7796edb457
2023-01-18 06:42:39 -08:00
Adnan Bacic 473eb1dd87 Move jest config from package.json to dedicated jest.config.js file (#35856)
Summary:
According to: https://jestjs.io/docs/configuration

> It is recommended to define the configuration in a dedicated JavaScript, TypeScript or JSON file. The file will be discovered automatically, if it is named jest.config.js|ts|mjs|cjs|json.

react-native projects have the jest config in package.json, this change aims to follow jest recommendations and have a dedicated file for jest configs.

Originally suggested here: https://github.com/react-native-community/discussions-and-proposals/discussions/583

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[GENERAL] [CHANGED] - Moved jest config from package.json to dedicated jest.config.js file

Pull Request resolved: https://github.com/facebook/react-native/pull/35856

Test Plan:
1. cd template
2. yarn
3. yarn test

The test should (still) pass

Reviewed By: christophpurrer

Differential Revision: D42544351

Pulled By: robhogan

fbshipit-source-id: e27d1dad2b52d757777c40a77d0639f381557c88
2023-01-18 02:00:19 -08:00
Adnan Bacic 3c03aef151 rename App-test.tsx to App.test.tsx (#35826)
Summary:
The starter test file when creating a `create-react-app` project is `App.test.js`, while in react-native its `App-test.js`_(recently changed to `.tsx` instead of `.js`)_

This aims to unify the naming convention between `create-react-app` and `react-native init`.

Originally suggested here: https://github.com/react-native-community/discussions-and-proposals/discussions/570

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[GENERAL] [CHANGED] - Renamed App-test.tsx to App.test.tsx to unify naming convention with create-react-app

Pull Request resolved: https://github.com/facebook/react-native/pull/35826

Test Plan:
1. cd template
2. yarn
3. yarn test

The test inside `__tests__/App.test.tsx` should (still) pass

Reviewed By: cipolleschi

Differential Revision: D42527535

Pulled By: NickGerleman

fbshipit-source-id: 5247c5a65760973afe39a4b37abb5a6b52c1fadc
2023-01-16 03:03:53 -08:00
David f47b5b8b5d Exclude `react-native-flipper` when `NO_FLIPPER=1` to prevent iOS build fail (#35686)
Summary:
- Flipper issue: https://github.com/facebook/flipper/issues/3995#issuecomment-1333863641

iOS build fail with an error:

```sh
node_modules/react-native-flipper/ios/FlipperReactNativeJavaScriptPlugin.h:9:9: 'FlipperKit/FlipperConnection.h' file not found

#import <FlipperKit/FlipperConnection.h>
```

## Changelog

[IOS] [FIXED] - Exclude `react-native-flipper` when `NO_FLIPPER=1` to prevent iOS build fail

Pull Request resolved: https://github.com/facebook/react-native/pull/35686

Test Plan:
```sh
npx react-native init RN0710RC5 --version 0.71.0-rc.5
cd RN0710RC5
yarn add react-native-flipper
NO_FLIPPER=1 pod install --project-directory=ios
yarn ios # will fail
```

Reviewed By: rshest

Differential Revision: D42368444

Pulled By: cipolleschi

fbshipit-source-id: a8614ccadb98970ebae15d8743136fa60ead318c
2023-01-12 02:53:28 -08:00
Adnan-Bacic 7324c22ff9 add-coverage-to-gitignore (#35809)
Summary:
There is a large amount of autogenerated files in the coverage folder when running `jest --coverage`.

This folder is also in .gitignore for react projects created with `create-react-app`

Originally suggested here: https://github.com/react-native-community/discussions-and-proposals/discussions/569

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[GENERAL] [ADDED] - Added "coverage" folder generated på `jest --coverage` to .gitignore

Pull Request resolved: https://github.com/facebook/react-native/pull/35809

Test Plan:
1. cd template
2. yarn
3. yarn test --coverage

Im not sure why many of the files in the template folder have an underscore(_) in the filenames instead of a dot(.). When creating a react-native project they have a dot. So if you run the above commands, the coverage folder will not be ignored since its not in `.gitingore` but in `_gitignore`. However, if you temporarily create a `.gitignore` file, you will see that the coverage folder is ignored.

4. Temporarily create `.gitignore` file to verify that coverage folder is ignored

Reviewed By: cortinico

Differential Revision: D42454560

Pulled By: jacdebug

fbshipit-source-id: 0be007d3ba3dde47814c0ce0fb8b0ff9f67d637b
2023-01-11 10:13:15 -08:00
Nicola Corti 51a48d2e2c Remove unnecessary repositories{} block from top level build.gradle (#35644)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35644

The `repositories{}` block in the top level build.gradle is not needed anymore
The React Native Gradle Plugin is taking care of it.
Users can still specify if they need to provide custom repositories.

Changelog:
[Android] [Changed] - Remove unnecessary repositories{} block from top level build.gradle

Reviewed By: cipolleschi

Differential Revision: D42033953

fbshipit-source-id: 8ec1c12147fae68302ab47c60045869c72d1812c
2022-12-14 11:25:57 -08:00
Nicola Corti 46ffeca3b0 De-bump AGP to 7.3.1 and do not use `addGeneratedSourceDirectory` (#35631)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35631

Fixes #35592
I'm de-bumping AGP from 7.4 to 7.3 as per #35592. There is no stable release
of AGP that is working fine with the `addGeneratedSourceDirectory` API for resources.
Here I'm reverting to use the older APIs.

Changelog:
[Internal] [Changed] - De-bump AGP to 7.3.1 and do not use `addGeneratedSourceDirectory`

allow-large-files

Reviewed By: cipolleschi

Differential Revision: D42004813

fbshipit-source-id: f1a2b0f7c2233402749a3e4f3828be80111ad3a7
2022-12-14 03:33:58 -08:00
Lorenzo Sciandra 326109ba5d fix(metro): realign "leftover" metro packages from 0.73.3 to 0.73.5 (#35625)
Summary:
I just noticed while working on 0.71 that the PR https://github.com/facebook/react-native/pull/35580 was incomplete. This PR takes care of re-aligning the leftovers. (in 0.71 I've taken care of the changes locally)

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[INTERNAL] [FIXED] - realign "leftover" metro packages from 0.73.3 to 0.73.5

Pull Request resolved: https://github.com/facebook/react-native/pull/35625

Test Plan: N/A

Reviewed By: cortinico, cipolleschi

Differential Revision: D41996338

Pulled By: dmytrorykun

fbshipit-source-id: bc1c95b0159f639e33835b922555d2f5b8c22c66
2022-12-13 09:52:30 -08:00
Nicola Corti 3ab6274f0d Bump further patch packages to unblock nightly as they have unreleased changes on main
Summary:
There are other 3 packages which have unreleased changes on main:
```
babel-plugin-codegen/
eslint-plugin-specs/
eslint-config-react-native-community/
```
I'm bumping them in order to be able to publish them to NPM.

Changelog:
[Internal] [Changed] - Bump further patch packages to unblock nightly as they have unreleased changes on main

Reviewed By: hoxyq

Differential Revision: D41874749

fbshipit-source-id: 0b8cd69cab6fcb116f2635c964490927f4fb20be
2022-12-10 04:03:11 -08:00
David Angulo 032bed45a9 remove hermes note (#35555)
Summary:
This note was added when upgrading from 0.69x to 0.70.x when `hermes_enabled` is explicitly set to `true`.

<img width="669" alt="Screenshot 2022-12-05 at 11 26 15" src="https://user-images.githubusercontent.com/36528176/205543104-b4a72c1c-57c0-422b-881e-8a0cb9d5c2a1.png">

But on 0.71, we are now using  `get_default_flags` again which makes the note obsolete.

## Changelog

[Internal] [Removed] - removed hermes note

Pull Request resolved: https://github.com/facebook/react-native/pull/35555

Test Plan: N/A

Reviewed By: dmytrorykun

Differential Revision: D41731004

Pulled By: cortinico

fbshipit-source-id: d5f377062bf94fa73bc6e73d1f108e37ad68c715
2022-12-05 05:02:39 -08:00
Tommy Nguyen 4df793f75b Don't use the internal `native_modules.rb` script yet (#35531)
Summary:
Revert the template `Podfile` to using `react-native-community/cli-platform-ios/native_modules`. The new internal script currently has a hard-coded path to `react-native-community/cli-platform-ios` which may not work in monorepos. The path in the `Podfile` is also hard-coded, but this is a file that the user has access to and can fix themselves if necessary.

## Changelog

[iOS] [Fixed] - Don't use the internal `native_modules.rb` script yet, as it hides a hard-coded path

Pull Request resolved: https://github.com/facebook/react-native/pull/35531

Test Plan: n/a

Reviewed By: rshest

Differential Revision: D41682119

Pulled By: cortinico

fbshipit-source-id: 1822fcd20a794dc9df6e8d6f36615e90b42c1a94
2022-12-02 04:09:02 -08:00
Nick Gerleman 68d6214a18 Simplify Template ESLint Configuration (#35529)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35529

ESLint configuration is derived from `react-native/eslint-config`, which has supported Flow, vanilla JS, and TypeScript.

https://github.com/react-native-community/react-native-template-typescript/pull/238 and a related PR ended up adding new rules to the TypeScript config, to fix bugs with TS linting. It required a followup change, to specify the parser/plugin, and explicity reference them as devDependencies. https://github.com/react-native-community/react-native-template-typescript/pull/240

`react-native/eslint-config` already includes setting the plugin/parser. But overriding rules requires declaring that again, and directly referencing a plugin means a need for the app to declare dependencies, since ESLint resolves modules from the current config.

The rules overridedn were later fixed in `react-native/eslint-config`, which is really the right place for the fix (e.g. https://github.com/facebook/react-native/pull/32644). I noticed this when deriving from the TS template in https://github.com/facebook/react-native/pull/32644 and removed the rule overrides, but didn't have the historical context to realize this means we can then:
1. Remove the explicit parser/plugins since `react-native/eslint-config` already sets them, and we are no longer overriding any rules.
2. Remove the devDependencies, to let the versions be managed entirely by `react-native/eslint-config`.

Changelog:
[General][Changed] - Simplify Template ESLint Configuration

Reviewed By: cortinico

Differential Revision: D41652699

fbshipit-source-id: 8e3313dbf27407c5866f3c2432cffc2ecec1b01d
2022-12-01 09:28:16 -08:00
Rob Hogan 3e19c97646 Bump remaining build-time Babel deps
Summary:
Update `babel/*` dependencies specifying `^7.x.y` where `x > 0` to the latest available semver minor, and corresponding superficial snapshot updates reflecting a small decrease in JS bundle size.

 - `babel/core` to `^7.20.0`
 - `babel/parser` to `^7.20.0`
 - `babel/preset-env` to `^7.20.0`
 - `babel/traverse` to `^7.20.0`
 - `babel/cli` to `^7.19.0`
 - `babel/eslint-parser` to `^7.19.0`
 - `babel/preset-flow` to `^7.18.0`
 - `babel/preset-syntax-flow` to `^7.18.0`
 - Deduplicate / refresh others to take in patch updates

Changelog: [Internal] Bump Babel dependencies to latest 7.x

Reviewed By: JoeyMou

Differential Revision: D41449678

fbshipit-source-id: f04fe837a7961c4e2dde45fed59fcd138c2f8723
2022-11-30 19:16:23 -08:00
Riccardo Cipolleschi 4e8526c829 Add CircleCI tests for use frameworks (#35497)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35497

In 0.71.0-RC.2, we had a regression in `use_frameworks!`.

This adds some CircleCI jobs to make sure we do not regress on those. It also updates the template to support these tests.

## Changelog
[iOS][Added] - CircleCI jobs to keep the use_framework! setup in check for the Old Arch

Reviewed By: cortinico

Differential Revision: D41551288

fbshipit-source-id: 531fabb1a7b6aceab2926bb83cf2887129df1776
2022-11-29 08:53:50 -08:00
shivenmian b7a85b59b5 chore: renamed react-native-codegen to @react-native/codegen (#34804)
Summary:
Renamed react-native-codegen package to react-native/codegen and updated references, without changing the folder name; part of RFC480 (https://github.com/facebook/react-native/issues/34692). Follow-up from https://github.com/facebook/react-native/pull/34578

## Changelog

[General] [Changed] - Renamed react-native-codegen package to react-native/codegen and updated references

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

Pull Request resolved: https://github.com/facebook/react-native/pull/34804

Reviewed By: cortinico

Differential Revision: D39883584

Pulled By: hoxyq

fbshipit-source-id: 0ef384b75c6edd248b31e37b8f05f64b4d39ca6f
2022-11-28 08:28:51 -08:00
Nicola Corti 10a8f186eb Bump Gradle to 7.6 (#35481)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35481

The next stable of Gradle just landed. I'm bumping it then.

Changelog:
[Android] [Changed] - Bump Gradle to 7.6

allow-large-files

Reviewed By: cipolleschi

Differential Revision: D41533430

fbshipit-source-id: 56f8ec3c491991730612aad100f6781fd67f260e
2022-11-28 02:14:35 -08:00
Ruslan Lesiutin 6f11b10a88 refactor(react-native-gradle-plugin): rename react-native-gradle-plugin to @react-native/gradle-plugin (#35480)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35480

Changelog:
[General][Changed] - rename react-native-gradle-plugin to react-native/gradle-plugin

Reviewed By: cipolleschi

Differential Revision: D41532746

fbshipit-source-id: 67b936a211ec8b91a2a96ca22145cbea94ba3e8c
2022-11-25 10:29:36 -08:00
LeoTM f75b92a12b Bump node version from 16 to 18 (#35443)
Summary:
Node 18: https://nodejs.org/de/blog/announcements/v18-release-announce/

Node 16 EOL: 2023-09-11
https://nodejs.org/en/blog/announcements/nodejs16-eol/

Node 18 EOL: 2025-04-30

Follow-up
- https://github.com/facebook/react-native/pull/34171
- https://github.com/facebook/react-native/pull/32980

Ref
- https://github.com/react-native-community/docker-android/pull/187

cc ramonmedel cortinico gengjiawen

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[JavaScript] [Changed] - Bump node version from 16 to 18

Pull Request resolved: https://github.com/facebook/react-native/pull/35443

Test Plan: Everything builds and runs as expected

Reviewed By: cipolleschi

Differential Revision: D41531161

Pulled By: cortinico

fbshipit-source-id: 305888f55ed179f75bef34548aebf22fc2951308
2022-11-25 06:44:21 -08:00
Adam Foxman 5aead70e80 eslint config & plugin packages - prep for monorepo RFC (#34581)
Summary:
The [monorepo RFC](https://github.com/react-native-community/discussions-and-proposals/pull/480) calls for renaming:

* `react-native-community/eslint-config` -> `react-native/eslint-config`
* `react-native-community/eslint-plugin` -> `react-native/eslint-plugin`

It also calls for the versions to be aligned with the rest of main -- currently `0.72.0`.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[General][Changed] - Renamed `react-native-community/eslint-config` to `react-native/eslint-config` v0.72.0 to align with other packages
[General][Changed] - Renamed `react-native-community/eslint-plugin` to `react-native/eslint-plugin` v0.72.0 to align with other packages

Pull Request resolved: https://github.com/facebook/react-native/pull/34581

Test Plan:
First test is to run `yarn lint`, and verify that output matches before and after this change.

Second test is to change the ESLint config to use the "old" packages (under `react-native-commnuity`) and run `yarn lint` to make sure that they work as expected. This is what customers will experience, until they manually move to the new ESLint packages.

Reviewed By: cortinico

Differential Revision: D41520500

Pulled By: hoxyq

fbshipit-source-id: a61e5ae15d5aaf11f0143a3b0257a60a03b1550b
2022-11-25 05:44:17 -08:00
Nicola Corti 4c5eb8dd2a Bump AGP to 7.4.x (#35456)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35456

Fixes #35439

There is a bug in AGP 7.3.x which is causing assets to don't be copied properly inside the
final artifact: issuetracker.google.com/issues/237421684
As AGP 7.4.x is really close to release (is in Beta5, should be released stable in the next weeks)
we should be fine by bumping to beta5.

This also requires a bump of RNGP

Changelog:
[Android] [Changed] - Bump AGP to 7.4.x

allow-large-files

Reviewed By: cipolleschi

Differential Revision: D41519549

fbshipit-source-id: 60d568a3e49798a23f1d7bf4839ab58bd5549aba
2022-11-24 09:18:36 -08:00
Lorenzo Blasa db3ac93001 Bump Flipper to 0.174.0 (#35445)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35445

As Flipper version is a bit old, let's bump it to the latest stable: 0.174.0.

This is a follow-up from D33583090 (50057158ca).

At the time, it wasn't possible to update to the latest stable Flipper as crashes were observed due to NDK mismatch.

Changelog:
[Android] [Changed] - Bump Flipper to 0.174.0

Reviewed By: cortinico

Differential Revision: D41492705

fbshipit-source-id: 9ec205bb0b8e4ddcb56355a194cae0a64f3345d6
2022-11-24 07:46:00 -08:00
David Angulo cb7f1b1f0b Read `.ruby-version` file in `Gemfile` (#35410)
Summary:
When updating the Ruby version, 2 files are always needed to be updated (`.ruby-version` and `Gemfile`). When not in sync it can lead to an error like `Your Ruby version is 2.7.6, but your Gemfile specified 2.7.5`.

This lessens the files that need to be updated when upgrading the Ruby version and makes it in sync always. It makes the `.ruby-version` the source of truth.

### Example 1:

<img width="481" alt="Screenshot 2022-11-20 at 13 56 08" src="https://user-images.githubusercontent.com/36528176/202888191-450ab6d0-32a4-4d37-ad82-0beb2b22fa82.png">

When upgrading from `0.70.0` to `0.71.0-rc.0`. 2 files needs to be updated when it could have been just 1.

Source: https://react-native-community.github.io/upgrade-helper/?from=0.70.0&to=0.71.0-rc.0

### Example 2:

21c8837c12 updates 4 files (`.ruby-version`, `Gemfile`, `template/Gemfile`, `template/_ruby-version`) when it could have been just 2.

### Other Sources:
* https://andycroll.com/ruby/read-ruby-version-in-your-gemfile/
* https://render.com/docs/ruby-version (Heroku alternative)
* https://stackoverflow.com/a/35823132/9375533

## Changelog

[General] [Changed] - Read `.ruby-version` file in `Gemfile`

Pull Request resolved: https://github.com/facebook/react-native/pull/35410

Test Plan: Only `.ruby-version` and `template/_ruby-version` needs to be updated when upgrading Ruby version.

Reviewed By: christophpurrer, cipolleschi

Differential Revision: D41429147

Pulled By: rshest

fbshipit-source-id: 9e541a1d84aed5dca1e6f465c61bb0ba15574211
2022-11-21 05:59:19 -08:00
Riccardo Cipolleschi 25132c8490 Fix: Avoid path in the template import (#35394)
Summary:
Investigating [this comment](https://github.com/reactwg/react-native-releases/discussions/41#discussioncomment-4170008), I made some tests.
It seems like we can simply use `#import <RCTAppDelegate.h>` instead of the `#import <React-RCTAppDelegate/RCTAppDelegate.h>` in both setups:
- default setup
- `use_frameworks! :linkage => :static`

## Changelog

[iOS] [Fixed] - Support `use_framework! :linkage => :static` in template

Pull Request resolved: https://github.com/facebook/react-native/pull/35394

Test Plan:
1. Manually tested with a new app
2. CircleCI
3. Sandcastle

Reviewed By: cortinico

Differential Revision: D41402060

Pulled By: cipolleschi

fbshipit-source-id: e1ed8196ed860b3663a88f5283f2745e39b0e944
2022-11-21 03:55:21 -08:00
Mike Hardy 81e441ae8a fix(template): reference App.tsx vs App.js in template text (#35377)
Summary:
The template has moved to typescript now, the self-reference needed an update

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[GENERAL] [FIXED] - reference App.tsx vs App.js in text of new typescript template

Pull Request resolved: https://github.com/facebook/react-native/pull/35377

Test Plan: It is just a text change - it either makes sense or it doesn't. I think it makes sense?

Reviewed By: cipolleschi

Differential Revision: D41386912

Pulled By: NickGerleman

fbshipit-source-id: 6e62c11567e8fbff70b123446a827b18af43e864
2022-11-18 15:56:58 -08:00
Nicola Corti 55b1670aa6 Void the Maven coordinates for react-native and hermes-engine (#35379)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35379

This diff moves the publishing coordinates from:
```
com.facebook.react:react-native
com.facebook.react:hermes-engine
```

to

```
com.facebook.react:react-android
com.facebook.react:hermes-android
```

I've picked those they are the most layout friendly when building from source, but we can discuss if we want others.
I've updated the Gradle plugin to have a dependencySubstitution rule + update the template with those changes.

It should now be possible to still use `implementation("com.facebook.react:react-native:+")` inside libraries
on 0.71+ and RNGP will resolve dependencies correctly.

Changelog:
[Android] [Changed] - Void the Maven coordinates for react-native and hermes-engine

Reviewed By: cipolleschi

Differential Revision: D41380525

fbshipit-source-id: 91e059fa261acb89bee7ca0c79c30c3d856a2c80
2022-11-18 04:46:16 -08:00
Nick Gerleman 418e95799f Fixup template devDependencies (#35372)
Summary:
Fixes missing/incorrect devDependencies in a newly built app. The previous set did not pull in prettier, causing linting to fail.  There was a peerDependency warning on yarn install. We also saw a separate lint warning at runtime specific to TS 4.9 being pulled in now, so we constrain in that version a bit.

Prettier and preset-env versions match the constraints and lockfiles of other RN packages.

## Changelog

[General] [Fixed] - Fixup template devDependencies

Pull Request resolved: https://github.com/facebook/react-native/pull/35372

Test Plan:
Created a new app targeting 0.71 via `react-native init`.

1. `yarn install --force` no longer shows warnings
2. `prettier` is installed, `yarn lint` no longer fails, and shows no warnings or errors
3. ~Tentatively a test step to add tests against linting in new app, but last time doing that in CircleCI led to timeouts with no output  that I didn't have time to debug, so maybe that's fixed now? �‍♀️.~ (edit: still hangs)

Reviewed By: NickGerleman

Differential Revision: D41363021

Pulled By: lunaleaps

fbshipit-source-id: d6163b01e8934d75a231fa0fd849d7bde7b3500c
2022-11-16 18:47:42 -08:00
Marc Rousavy 3d9a3b7af6 fix: Add missing space in method documentation (#35303)
Summary:
probably the smallest PR I ever submitted, but it was bothering me lol

There was a missing space in the method doc.

## Changelog

Add space to the method doc
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[iOS] [Fixed] - Add missing space in method documentation comment

Pull Request resolved: https://github.com/facebook/react-native/pull/35303

Reviewed By: jacdebug

Differential Revision: D41182765

Pulled By: cipolleschi

fbshipit-source-id: ebe5d56072137547e543a312c66cc3234142db13
2022-11-10 04:55:37 -08:00
Oleksandr Melnykov 394486eec5 Bump OSS Android build to SDK 33 (#35196)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35196

Changelog:
[Android][Changed] - Bump Android compile and target SDK to 33

Reviewed By: cortinico

Differential Revision: D41007003

fbshipit-source-id: e7866107fdcfafa778faa6c7f31835b8dd15647a
2022-11-08 19:12:02 -08:00
Thibault Malbranche 38e35df47c chore: fix typo in build.gradle (#35209)
Summary:
## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[Android] [Fixed] - fixed typo in template build.gradle

Pull Request resolved: https://github.com/facebook/react-native/pull/35209

Reviewed By: cipolleschi

Differential Revision: D41080347

Pulled By: cortinico

fbshipit-source-id: d2e36f232f798a636f98843edbc5651730125fc4
2022-11-07 06:30:33 -08:00
Nick Gerleman aaf1990287 Use TypeScript by default for new applications (#35165)
Summary:
This change moves the default new application template in OSS from Flow to TypeScript. This better aligns with the communities usage, and aligns to the great work that has been happening for TS codegen and built-in types. This used [`react-native-community/react-native-template-typescript`](https://github.com/react-native-community/react-native-template-typescript) as a main reference, maintained by radko93. A few things are different:
1. Updated `types/*` devDependencies to match bumped libraries (e.g. Jest 26 to 20).
2. Removed `types/react-native`
3. Removed explicit `moduleFileExtensions` to Jest config in package.json (TS and TSX and added by default in current versions)
4. Removed overrides to eslint config to disable `no-shadow` and `no-undef`, since this was fixed in the underlying eslint config with https://github.com/facebook/react-native/pull/32644 and https://github.com/facebook/react-native/pull/32655
5. Re-translated `App.js` to be a direct translation (e.g. still a raw function instead of React.FC which is sometimes discouraged)
6. Aligns completely to `tsconfig/react-native` maintained configuration (We no longer have the opinionated override of `skipLibCheck`). The important settings are that `strict` is enabled for, but `allowJS` is also enabled to let users import JS modules without anything unexpected. `esModuleInterop` is enabled, which is needed for consistency with Babel import transformations used by Metro. Consistent with our [current documentation](https://reactnative.dev/docs/typescript) built against the community template, `tsc` will typecheck your code without emitting(building) anything.

[Documentation](https://reactnative.dev/docs/typescript) will need to be updated as a followup.

Changelog:
[General][Changed] - Use TypeScript by default for new applications

Pull Request resolved: https://github.com/facebook/react-native/pull/35165

Test Plan: Added usage of `tsc` and `jest` when validating a newly built app. Passes in CircleCI `test_js` job. This also meant removing some cases of copying packages into the users app to pull in the root Metro config (we seem to be able to use the template Metro config consistent with what real apps would get).

Reviewed By: cortinico

Differential Revision: D40911951

Pulled By: NickGerleman

fbshipit-source-id: 15994534235695e91cf994ad06ba2183dfc89a50
2022-11-02 21:40:58 -07:00
Nicola Corti cec9a34f6c Sets the namespace via Gradle and not via AndroidManifest (#35094)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35094

Currently the build on console is firing this warning:
```
> Task :app:processDebugMainManifest
package="com.androidtemplateproject" found in source AndroidManifest.xml: /tmp/AndroidTemplateProject/android/app/src/main/AndroidManifest.xml.
Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated.
Please instead set the namespace (or testNamespace) in the module's build.gradle file, as described here: https://developer.android.com/studio/build/configure-app-module#set-namespace
This migration can be done automatically using the AGP Upgrade Assistant, please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information.
```

This diff fixes it so users won't see it anymore on 0.71

Changelog:
[Android] [Fixed] - Sets the namespace via Gradle and not via AndroidManifest

Reviewed By: cipolleschi

Differential Revision: D40724654

fbshipit-source-id: 9b01748a22e9993b60e17bf25acbc68ba8e4eb77
2022-10-29 06:35:38 -07:00
Marshall Roch d0f94e6c2d Upgrade to Flow 0.191.0
Summary: Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D40768442

fbshipit-source-id: a8e4301d731a8be4ce21d19c6276795d1127bd6d
2022-10-28 08:11:57 -07:00
Nicola Corti 6a43fafd78 Cleanup the template documentation after RNGP & hermesEnabled to gradle.properties (#35108)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35108

I've rewritten the comment in the android/app/build.gradle.
They were really old, contained wrong links and most of the people ignored it.

I've also moved the enabling of Hermes to the `gradle.properties` file.
RNGP still supports the old method, but we must be sure that we notify
library authors if they were reading project.ext.react.enableHermes in the past
(also the website needs to be updated).

I've also cleaned up the CircleCI setup as now we can specify Hermes enabled/disabled
via the CLI (this will also make easier to do e2e testing).

Changelog:
[Android] [Changed] - Cleanup the template documentation after RNGP & hermesEnabled to gradle.properties

Reviewed By: cipolleschi

Differential Revision: D40762872

fbshipit-source-id: 2c09245e0a923faac53cc6c8a89e99788ae47f8a
2022-10-27 14:40:27 -07:00
Lorenzo Sciandra f550606d4c chore(cli, metro): bump cli and metro to latest ahead of 71 (#35107)
Summary:
Small PR with bump to the new versions of CLI and Metro in preparation of the branch cut for 0.71.

While at it, did a cheeky `npx yarn-deduplicate` to clean up a bit the deps.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[General] [Changed] - Bump CLI to 10.0.0-alpha.1 and Metro to 0.73.3

Pull Request resolved: https://github.com/facebook/react-native/pull/35107

Test Plan: CI is green

Reviewed By: motiz88

Differential Revision: D40762683

Pulled By: huntie

fbshipit-source-id: e523a49c78588ca80351f44cb02bcd4c0137475e
2022-10-27 14:09:03 -07:00
Nicola Corti 2097278d2a Update the template to load the correct JS engine at runtime. (#35095)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35095

This change will make sure that we load the correct JS engine at runtime,
by using the BuildConfig flag that RNGP sets for us.

This will solve a lot of noise in adb logcat for users seeing
stacktraces mentioning failing to load `jscexecutor` library.

This is also a breaking change, but as the API was not widely used nor
advertised in the template, we should be fine by just mentioning this in the release notes.

Changelog:
[Android] [Changed] - Update the template to load the correct JS engine at runtime

Reviewed By: cipolleschi

Differential Revision: D40710597

fbshipit-source-id: d59a7a52b22a9bf273ea89094c6620c3ecf6eb00
2022-10-27 04:47:25 -07:00
Nicola Corti 1f42ff0815 Bump AGP to 7.3.1 (#35100)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35100

That's just a minor bump of AGP before the branch cut.

Changelog:
[Android] [Changed] - Bump AGP to 7.3.1

allow-large-files

Reviewed By: cipolleschi

Differential Revision: D40752006

fbshipit-source-id: 4856bc7ca275cf46d3afcc7c24928c5f1d5e6e33
2022-10-27 03:33:29 -07:00
Nicola Corti 07252b81f6 Do not import/use the deprecated ReactFlipperPlugin (#35099)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35099

I'm removing the ReactFlipperPlugin from the new app template.
That plugin is effectively empty and is a stub + is deprecated
so is generating a warning for all the users.

Changelog:
[Android] [Changed] - Do not import/use the deprecated ReactFlipperPlugin

Reviewed By: cipolleschi

Differential Revision: D40751984

fbshipit-source-id: 1f1fdf9c7dfccb9e7bbd4c8c2292df71e00c644f
2022-10-27 03:13:39 -07:00
Nicola Corti 1069841837 Make it easier for user to toggle only Fabric or TurboModules in New Architecture (#35091)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35091

This diff refines the DefaultNewArchitectureEntryPoint to make it easier for user to
either turn on Fabric, TurboModules or both.

Changelog:
[Internal] [Changed] - Make it easier for user to toggle only Fabric or TurboModules in New Architecture

Reviewed By: cipolleschi

Differential Revision: D40710596

fbshipit-source-id: 236060b2ebccb1bf25e7f5c0fc15f54c5ce5f608
2022-10-26 13:03:33 -07:00
Nicola Corti c96c76eb91 Update the template to use RNGP (#35075)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35075

This diff updates the New App template for Android to use the React Native Gradle Plugin.
With this we can:
1. Get rid of all the C++ code.
2. Remove a lot of New Architecture logic in the build.gradle
3. Reuse the prebuilts of React Native/Hermes via prefab

Changelog:
[Android] [Changed] - Update the template to use RNGP

Reviewed By: cipolleschi

Differential Revision: D40673732

fbshipit-source-id: 70935248993d1e24904c982e75f12ad580faa9d8
2022-10-25 13:13:14 -07:00
Nicola Corti 6a3bfa7a62 Bump NDK to 23 and fbjni to 0.3.0 (#35066)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35066

This just bumps the NDK version used inside the template to be 23.
We can't merge this as it is but we have to wait for a bump of the Docker image for Android.

Changelog:
[Android] [Changed] - Bump NDK to 23

allow-large-files

Reviewed By: cipolleschi

Differential Revision: D40637103

fbshipit-source-id: e637140cbe6052e94a6efedf12f4b5b81b90a7eb
2022-10-25 02:31:10 -07:00
Marshall Roch 6e18f1fab1 upgrade to flow 0.190.1
Summary: Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D40611965

fbshipit-source-id: 56c6dc10557fdb3a302a862fe80a1227df83850b
2022-10-22 06:38:54 -07:00
Pieter Vanderwerff 7dc249920a Revert styles order change in sample app
Reviewed By: yungsters

Differential Revision: D40597645

fbshipit-source-id: 34a75f49cf4674cadb13d99fac4b058265f17c3b
2022-10-21 15:02:47 -07:00
Rob Hogan 45db65be7e Update Jest to ^29.2.1 (#35014)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35014

X-link: https://github.com/facebook/metro/pull/881

Following on from https://github.com/facebook/react-native/pull/34724 and https://github.com/facebook/react-native/pull/34972, this updates Jest to the latest version 29.2.1 across projects and in the OSS React Native new app template.

Importantly this version includes the [new `jest.now()` API](https://github.com/facebook/jest/pull/13245), which will be useful for exposing internally consistent fake timer mocks of `requestAnimationFrame`, etc., in the new React Native Jest environment.

Changelog:
[General] [Changed] - Upgrade Jest in React Native template to ^29.2.1

Reviewed By: jacdebug

Differential Revision: D40386349

fbshipit-source-id: 43f5a69cf546df09e2f02542ebf50130d65f0436
2022-10-19 12:17:39 -07:00
Nicola Corti 27cb501481 Cleanup BUCK files from template - Part 2 (#35020)
Summary:
The `template/android/app/build_defs.bzl` file can be removed as it's unused in the Template.

## Changelog

[Internal] - Remove build_defs.bzl from Android Template

Pull Request resolved: https://github.com/facebook/react-native/pull/35020

Test Plan: n/a

Reviewed By: cipolleschi

Differential Revision: D40506250

Pulled By: cortinico

fbshipit-source-id: 14d8522a995a4b19b5b6610fcb2c5b1dda3374c8
2022-10-19 06:41:59 -07:00
Lorenzo Sciandra 33e140fd05 fix(template, ios): add marketing version to template project (#35012)
Summary:
Recently this PR got merged https://github.com/facebook/react-native/pull/34919 that aligned the info.plist to the current default. Problem: the variable `MARKETING_VERSION` was not set in the template, so generating a new project and testing on iOS would fail accordingly:

<img width="1400" alt="Screenshot 2022-10-18 at 15 27 27" src="https://user-images.githubusercontent.com/16104054/196461640-470079f5-0f64-471f-8221-0d17f2b0114f.png">

This PR takes care of setting the variable so that the app can build successfully.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[iOS] [Fixed] - add MARKETING_VERSION to template project

Pull Request resolved: https://github.com/facebook/react-native/pull/35012

Test Plan: Run `yarn test-e2e-local -t RNTestProject`, apps builds correctly and runs on simulator.

Reviewed By: cipolleschi

Differential Revision: D40472420

Pulled By: cortinico

fbshipit-source-id: 18ddd57ce54186a101321583a7a8391e97ca9511
2022-10-18 10:32:59 -07:00
Lorenzo Sciandra 8f337538ae feat(jest): bump jest to 29 in the template (#34972)
Summary:
This PR is the follow up of https://github.com/facebook/react-native/pull/34724 for the template; this way, we'll have version alignment and RN71 will use this.

This wants to be merged along https://github.com/facebook/react-native/pull/34971

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[General] [Changed] - upgrade Jest in template to 29

Pull Request resolved: https://github.com/facebook/react-native/pull/34972

Test Plan: Generated a test project via `yarn test-e2e-local -t RNTestProject` and then run `yarn test` in that project to verify that there's no regression. 

Reviewed By: huntie

Differential Revision: D40379963

Pulled By: robhogan

fbshipit-source-id: 618207ed6bf7921d13f0b6a9220dc52c9cf78b14
2022-10-18 04:43:38 -07:00
Sam Zhou 3e58a9c531 Deploy 0.190.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: jbrown215

Differential Revision: D40393734

fbshipit-source-id: cc7a5e1fd28512c8141a0f705580a447efcd5575
2022-10-14 14:07:54 -07:00
Jiamin Zhu 4631cf933e Revert D40374535: Deploy 0.190.0 to xplat
Differential Revision:
D40374535 (5359f1de12)

Original commit changeset: 92788a21a4f2

Original Phabricator Diff: D40374535 (5359f1de12)

fbshipit-source-id: a0115dc24590bc50fa1aee2770dbb13b2edaf580
2022-10-14 10:45:04 -07:00