Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44721
For iOS builds of `react-native`, the [react-native-xcode.sh](https://www.internalfb.com/code/fbsource/[7ad79aae3e8bf565d53f087ac7f7b7622b19acec]/xplat/js/react-native-github/packages/react-native/scripts/react-native-xcode.sh) script is executed as one of the build phases. This phase bundles the JS application (dev or production).
I've updated this to use the new `bundle.js` script instead of calling the `react-native/cli.js`. This is identical except with how the config is captured:
{F1669960016}
This is similar to our approach with the Gradle plugin, giving Framework authors more control.
**Other:** formatting changes for the Privacy Manifest that Xcode keeps updating.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D57915368
fbshipit-source-id: f52ea4b3cb94212ac97a3d7edeb68747418fe0a9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42267
In case anyone was to try linting the react-native repo with desktop out-of-tree platform files there, this makes things easier.
## Changelog
[Internal]
Reviewed By: christophpurrer
Differential Revision: D52746379
fbshipit-source-id: d59a1c1f9c84c6bee529d6bdd151a7ba680b6680
Summary:
This PR adds build generated files to *ignore config files. This allows to locally run `yarn lint`
## Changelog:
[INTERNAL] [ADDED] - Add build generated files to local config files
Pull Request resolved: https://github.com/facebook/react-native/pull/41826
Test Plan: CI Green
Reviewed By: huntie
Differential Revision: D51939024
Pulled By: cortinico
fbshipit-source-id: cfd6c1c13dd23c692859cd06fa5955024fafc522
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39161
Changelog: [Internal]
Creates a new stub package named `react-native/debugger-frontend`, which will contain a minimal build of the Chrome DevTools frontend adapted for React Native. Initially, the compiled frontend assets will be checked into the React Native repo, but we intend to replace this with a fully automated build in CI at a later date.
Reviewed By: huntie
Differential Revision: D48680624
fbshipit-source-id: a24c8b019881187963d0be88e773bc0a97a2437d
Summary:
Creates a new `valid-flow-typed-signature` ESLint rule that validates the `flow-typed` signatures at the top of each file.
This lint rule will discourage contributors from locally forking the `flow-typed` definitions. Instead, any changes should be submitted as patches to the upstream definition in: https://github.com/flow-typed/flow-typed
Changelog:
[Internal]
Reviewed By: rickhanlonii
Differential Revision: D39868721
fbshipit-source-id: e5e3ffe7568dbe52c9b598b53110b0fcbcad3e38
Summary:
Introduces a portable bundle that implements the `sort-imports` ESLint rule that we use internally at Meta, to the React Native repository.
As a consequence of the rapid changes that occur to this rule internally (and the desire to minimize red tape for Meta engineers), the portable bundle is built with Rollup with a lot of context omitted.
Changelog:
[Internal]
Reviewed By: skinsshark
Differential Revision: D39907799
fbshipit-source-id: 58fb6dc08030f20ac02c0e3fd1b175e22e4d74c0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34713
Changelog: [Internal] - Fix up missing bots usage after we moved everything to packages/react-native-bots in 767f8e0249
Reviewed By: NickGerleman
Differential Revision: D39583230
fbshipit-source-id: 6cc6b7923e67139dc3c81dfe0c39005dde905248
Summary:
Sometime over the past few months (and with changes such as migrating to the `hermes-eslint` parser), a bunch of lint warnings crept into the codebase.
This does a pass to clean them all up, ignore generated files, and refactor some code to be... better.
There should be no observable behavior changes as a result of this.
Changelog:
[Internal]
Reviewed By: NickGerleman
Differential Revision: D38646643
fbshipit-source-id: a7b55d1e4cd5700340cc5c21f928baf3ea1d5a58
Summary:
This small PR fixes few "no-unused-var" issues and and removes two old entries for no longer existing files from the `.eslintignore`.
## Changelog
[Internal] [Fixed] - Lint: fix few "no-unused-var" warnings for imports
Pull Request resolved: https://github.com/facebook/react-native/pull/30157
Test Plan: Successfully run of `yarn lint` script. Warnings count has been reduced from `61` to `58`.
Reviewed By: yungsters
Differential Revision: D24288226
Pulled By: appden
fbshipit-source-id: 06e4ef015a331e3f2eac3b9aa6f757a3764e3ed9
Summary:
*This is a follow-up to https://github.com/facebook/react-native/issues/28645, redone using a build script based off of Metro's build script instead of using `flow-remove-types` and `flow-copy-source`.*
This pull request adds a build step to `react-native-codegen` that builds the Flow-annotated JS files so that users of the NPM module `react-native-codegen` do not need to use require hooks to be able to import it.
A new build script, `scripts/build.js` is added that builds every JS file in `src/` into a `lib/` folder, and also copies over the original Flow annotated files to `lib/` with a `.js.flow` extension, so users of `react-native-codegen` can still typecheck against it using Flow. The shell scripts in `src` are also copied over. It is based off of the [build script from Metro](00867816eb/scripts/build.js)
## Changelog
[General] [Added] - Codegen: Add prepublish script to build Flow files
Pull Request resolved: https://github.com/facebook/react-native/pull/28827
Test Plan:
I am able to make use of the Codegen scripts without needing to use the `flow-node` CLI or the `flow-remove-types/register`
require hook.
Reviewed By: cpojer
Differential Revision: D21412173
Pulled By: hramos
fbshipit-source-id: 26ae67cdd04652ca4700a069a234a25558773cb1
Summary:
I was annoyed by warnings from yarn/npm about eslint peer dependencies not being met, so I dived in to try and get rid of some of them. Sometimes it meant bumping a plugin, but then that plugin needed a newer babel-eslint, so it was a dance.
Some we can't easily update to latest (eslint-plugin-prettier) because the rule format has changed a bit. Happy to do that in this PR if folks think its a good idea. eslint-config-fbjs itself needs to be updated and republished to eliminate the last few warnings.
There are a few new warnings (the repo wasn't linting cleanly for me from the start). I can fix those in this PR, or a separate one, based on people's preferences.
[internal] [chore] - Eliminate some peer dependency warnings and bump some eslint packages to latest.
Pull Request resolved: https://github.com/facebook/react-native/pull/23969
Differential Revision: D14519076
Pulled By: cpojer
fbshipit-source-id: aa44cfd05814d7b79069414aa78d089e448c2235
Summary:
This PR expands the code analysis script to allow for customizing the GitHub Review left by analysis-bot whenever it finds code-level issues.
Some, but not all, `eslint` errors are fixable by running `yarn lint --fix`. When the `eslint` converter finds warnings or errors, the bot will suggest running the command as part of the review.
The script could be adjusted to only suggest this when `eslint` returns a non-zero `fixableErrorCount` or `fixableWarningCount`, but I think this is a good first step to get people to unblock themselves when they see this type of review from the bot.
I've also excluded `bots/` and `scripts/` from eslint as these have several `eslint` errors that need to be addressed. These directories do not contain core RN code, so they can be excluded for now.
[GENERAL] [Changed] - analysis-bot will suggest fixing eslint warnings on code reviews
Pull Request resolved: https://github.com/facebook/react-native/pull/23413
Differential Revision: D14065757
Pulled By: cpojer
fbshipit-source-id: cc588643f7ddb3c4631d89c26b799f7a7244e616
Summary:
There were still some references to "packager/" that are no longer used since the `packager` directory has been deleted after moving to Metro. Cleaned up the ones that were doing nothing and updated the references that are still meaningful.
Closes https://github.com/facebook/react-native/pull/14881
Reviewed By: cpojer
Differential Revision: D5380731
Pulled By: javache
fbshipit-source-id: 1355268f48db47343d0d38fae2598b64c8c01475
Summary:
I suggest we grab our own version of worker-farm, since there are a few changes we'd like to do. There are two reasons for forking:
* the original project does not seem maintained anymore, with a PR remaining unanswered (https://github.com/rvagg/node-worker-farm/pull/42);
* we don't need to keep the level of genericity of the original project: for example, we don't need the option `maxConcurrentCallsPerWorker`, that we always keep to one.
Forking gives us opportunity to simplify the code for our use case. Later on we could reuse it for other projects such as `jest`.
A few things we'd like to do:
* remove special node options from the forks, such as `--inspect`, or even, allow adding special options (if you want to debug a worker specifically for example);
* allow us to pipe `stdout` and `stderr` instead of having transform spit stuff out to the parent process output;
* remove code managing `maxConcurrentCallsPerWorker` and clean up the code in general;
* add `flow` typing.
Reviewed By: davidaurelio
Differential Revision: D4993300
fbshipit-source-id: 10f0c2a18b010c2a8b2e2afebcb3aab3504d7923