text:
Peer dependencies of eslint-config-react-app should probably be regular dependencies

If user wants only the config and nothing else the one should still install all the deps, which can be done automatically and with no hassle.
Currently, I have to install eslint-plugin-flowtype which I am not even using in my project...
Moreover, version of babel-eslint is outdated (available: 10, listed: 9).
As one of the solutions, maybe, we can create one extra package in this repo and name it like eslint-config-react-app-pack, which will have all the needed deps?

Anti-stale-bot-ping )

Anti stale bot ping

I have a project that is just a component library so I'm not using create-react-app but I wanted the tooling to be consistent with our CRA projects so using babel-preset-react-app and eslint-config-react-app is a great option (I really appreciate that they are published as they are).
I did find it odd that babel-preset-react-app includes all of the plugins as dependencies and eslint-config-react-app uses peer dependencies.
I admit that I could totally be missing the reason for why they are different, but in my case this change would be helpful.

I agree with @kirill-konshin and @skoestler that eslint-config-react-app should mirror the behavior of babel-preset-react-app by including its dependencies as regular dependencies.
I set up a project that mirrors create-react-app's Babel and ESLint config and about half of the dependencies in my package.json are eslint-config-react-app's dependencies. It would be nice to trim that down so that one could just add eslint-config-react-app without having to track down all of the dependencies.

The usage of typescript as a peer dependency in react-scripts and eslint-config-react-app is incorrect, as they don't always require TypeScript. TypeScript and all related dependencies should be removed from these packages, then another pair of packages should be made that add the peer dependencies when used with create-react-app --typescript. If this makes sense I can propose a pull request.

Hi!
Just faced with the same issue. Little more details:
I have the following project structure:
namespace-project
  | subpackage-project-1
  | subpackage-project-2
  | subpackage-project-N

Where namespace-project is a Lerna root and subpackage-project is either a local lib or an app built with CRA.
After I run npm run start (react-scripts start) the console is clear and it says that the app is running:
Starting the development server...
Files successfully emitted, waiting for typecheck results...
Compiled successfully!

You can now view @namespace/subpackage-project-1 in the browser.

  Local:            http://localhost:3000
  On Your Network:  http://***.***.*.***:3000

BUT after I make some changes and hot-reload updates the app, I see the following warnings in the console:
Failed to load plugin 'flowtype' declared in 'BaseConfig » C:\Users\goodwin64\WebstormProjects\namespace-project\packages\subpackage-project\node_modules\eslint-config-react-app\index.js': Cannot find module 'eslint/lib/rules/no-unused-expressions'
Require stack:
- C:\Users\goodwin64\WebstormProjects\namespace-project\packages\subpackage-project\node_modules\eslint-plugin-flowtype\dist\rules\noUnusedExpressions.js
- C:\Users\goodwin64\WebstormProjects\namespace-project\packages\subpackage-project\node_modules\eslint-plugin-flowtype\dist\index.js
- C:\Users\goodwin64\WebstormProjects\namespace-project\packages\subpackage-project\node_modules\react-scripts\node_modules\eslint\lib\cli-engine\config-array-factory.js
- C:\Users\goodwin64\WebstormProjects\namespace-project\packages\subpackage-project\node_modules\react-scripts\node_modules\eslint\lib\cli-engine\cascading-config-array-factory.js
- C:\Users\goodwin64\WebstormProjects\namespace-project\packages\subpackage-project\node_modules\react-scripts\node_modules\eslint\lib\cli-engine\cli-engine.js
- C:\Users\goodwin64\WebstormProjects\namespace-project\packages\subpackage-project\node_modules\react-scripts\node_modules\eslint\lib\cli-engine\index.js
- C:\Users\goodwin64\WebstormProjects\namespace-project\packages\subpackage-project\node_modules\react-scripts\node_modules\eslint\lib\api.js
- C:\Users\goodwin64\WebstormProjects\namespace-project\packages\subpackage-project\node_modules\eslint-loader\dist\getOptions.js
- C:\Users\goodwin64\WebstormProjects\namespace-project\packages\subpackage-project\node_modules\eslint-loader\dist\index.js
- C:\Users\goodwin64\WebstormProjects\namespace-project\packages\subpackage-project\node_modules\eslint-loader\dist\cjs.js
- C:\Users\goodwin64\WebstormProjects\namespace-project\packages\subpackage-project\node_modules\loader-runner\lib\loadLoader.js
- C:\Users\goodwin64\WebstormProjects\namespace-project\packages\subpackage-project\node_modules\loader-runner\lib\LoaderRunner.js
- C:\Users\goodwin64\WebstormProjects\namespace-project\packages\subpackage-project\node_modules\react-scripts\node_modules\webpack\lib\NormalModule.js
- C:\Users\goodwin64\WebstormProjects\namespace-project\packages\subpackage-project\node_modules\react-scripts\node_modules\webpack\lib\NormalModuleFactory.js
- C:\Users\goodwin64\WebstormProjects\namespace-project\packages\subpackage-project\node_modules\react-scripts\node_modules\webpack\lib\Compiler.js
- C:\Users\goodwin64\WebstormProjects\namespace-project\packages\subpackage-project\node_modules\react-scripts\node_modules\webpack\lib\webpack.js
- C:\Users\goodwin64\WebstormProjects\namespace-project\packages\subpackage-project\node_modules\react-scripts\scripts\start.js

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

What can I do to resolve it? Shall I install the flowtype as a devDependency in all my subpackage projects?
Are there some other eslint plugins that are also required?

UPD: warnings have gone after I've installed eslint-plugin-flowtype as a dev dependency to subpackage-1:
lerna add eslint-plugin-flowtype --dev --scope=@namespace/subpackage-project

In react-scripts/package.json (react-scripts@3.4.1), all the eslint plugins are now as dependencies (not peerDependencies)
  "dependencies": {
    ....
    "eslint": "^6.6.0",
    "eslint-config-react-app": "^5.2.1",
    "eslint-loader": "3.0.3",
    "eslint-plugin-flowtype": "4.6.0",
    "eslint-plugin-import": "2.20.1",
    "eslint-plugin-jsx-a11y": "6.2.3",
    "eslint-plugin-react": "7.19.0",
    "eslint-plugin-react-hooks": "^1.6.1",

Can this issue be closed now?
I found this issue, because in my created issue https://github.com/facebook/create-react-app/issues/9083 i suggest something different: to be able to use own installed versions of eslint-plugins. But probably this doesn't mean, that they cannot be defined as regular dependencies when being able to resolve them with an .env flag from root directory in webpack config (see proposal of #9083)

This is related to the discussion here, so I think we can close this - thanks @tobiaskraus for the reminder.
https://github.com/facebook/create-react-app/discussions/9069

Why is this closed? Package.json of eslint-config-react-app is still having peerDependencies: https://github.com/facebook/create-react-app/blob/master/packages/eslint-config-react-app/package.json#L17, it is still an issue.

@kirill-konshin please see the discussion I linked to.

@mrmckeb yes, I'm well aware of the issues with shared configs and ESLint, especially with Yarn 2 with PNP mode on: https://github.com/eslint/eslint/issues/3458. The issue has to remain open because at some point ESLint will be fixed.

@kirill-konshin when the root problem is fixed, we'll definitely make the required changes. All of the team are tracking this.
As this issue stands, it's not possible to resolve, and leaving it open creates confusion and noise for the volunteers working on this project.

authors: goodwin64 kirill-konshin mrmckeb nickmccurdy skoestler tlrobinson tobiaskraus

repo: facebook/create-react-app


text:
Fix floating caret position incorrect while scrolling overlay

As screenshots, notice the position of "caret" symbol.
Before

After

I haven't noticed this bug before. I'm curious when it might have been introduced and what browsers it affects. What browser are you using in the screenshots above?

@iansu Chrome Version 64.0.3282.167 (Official Build) (64-bit)

I've tried following browsers have same issue:

Chrome Canary Version 66.0.3350.0 (Official Build) canary (64-bit)
Safari Version 11.0.3 (13604.5.6)

I've created an demo project: https://github.com/jihchi/create-react-app-4024

Looks fine to me. Thanks!

#4231

source: gharchive/pull-request

authors: Timer iansu jihchi marta20201

license: MIT

license_type: permissive

license_source: github-api


text:
RFC: validate plugin options with Yup

💥 Proposal
The client-redirects plugin uses Yup to validate user inputs.
In case user options do not match what's expected by the plugin (and the TypeScript types), it fails fast with an actionable error message.
@lex111 mentioned here that this is not really consistent with the behavior of the other plugins that do not really validate the user options, and maybe we should revisit the development process of plugins to follow what has been done in the client redirects plugin.
I discussed this with @yangshun, and he liked the idea to validate user inputs early with Yup.
He proposed a validateOptions() plugin lifecycle, where the user could just provide a Yup schema.

What do you think of this idea of generalizing user input validation everywhere?

I completely agree with this, maybe we should draw up some guidelines for the development of plugins (and not only for them).

source: gharchive/issue

repo: facebook/docusaurus


text:
Possibility to override the core class names

src/component/base/DraftEditor.react.js uses a special class names, for example:

DraftEditor/root
DraftEditor/editorContainer
public/DraftEditor/content
etc

But how we can see at facebook.com, it uses minimized 5-digit names of these same classes:
..looks like CSS Modules usage

How we can redefine Draft.js class names in our own projects the same way?
It seems at the moment the editor does not provide the api to change the core class names..

This ties into our internal CSS build system and it's not going to be practical for us to support this in open source – it's unlikely that it will make a practical difference for anyone so hopefully it isn't a big deal for you. If you're interested, we statically transform calls to cx() using a Babel transform that replaces the class names with a minified version. (We never reference classes with a slash without using cx().) If you were motivated you could implement the same thing by building Draft from source but it's unlikely to be worth the time it would take you to set it up.

authors: frenzzy spicyj

repo: facebook/draft-js

license: mit

license_source: bigquery


text:
Calling function with bound arguments

Example
type bound = (number) => void

const foo:bound = (a: number) => console.log(a);
const bar:bound = foo.bind(this, 3);

bar();

8: bar();
   ^ undefined (too few arguments, expected default/rest parameters). This type is incompatible with
3: type bound = (number) => void
                 ^ number

Is this a bug, or am I doing something wrong? What's the best practice to handle this kind of situation?

I would say that foo is not bound yet, while bar is bound with a parameter so its signature is () => void.
type notboundyet = (number) => void
type bound = () => void
const foo: notboundyet = (a: number) => console.log(a);
const bar: bound = foo.bind(this, 3);

bar();

So binding a function changes the signature, and this is normal. Makes sense.

it does seem like the error here should be on the const bar:bound = foo.bind(this, 3) line, not the call of bar().
cc @gabelevi @samwgoldman

authors: borlaym dperetti mroch

repo: facebook/flow


text:
Very basic type-checking seems broken.

Flow version: v0.107
Not sure if I'm crazy, but some very basic type checking seems to be just broken? Given
type Record = {
   foo: number,
   bar: string
}

const x: Record = {};

Expected behavior
Error indicating x is not of type Record
Actual behavior
No errors!

Link to Try-Flow or Github repo:
https://flow.org/try/#0C4TwDgpgBAShDGB7ATgEygXigbwFBQIDNFEAuKAOwFcBbAIwmQBp8C6BDZcgZ2GQEsKAc1wBfXLiQVeUAB7k4SNJhyiA3LiA

If you make the object exact, it does correctly errors.
The same if you add a property to the empty object.
I think this is related to: https://github.com/facebook/flow/issues/2977
And the weird differences you get with empty objects.

{} is special in flow, it's an unsealed object. The easiest way to avoid this is to do something like { ...null } which will result in a regular empty object.

https://github.com/facebook/flow/issues/7424

Wow, that really clashes with your expectations after hearing Flow is supposed to value "soundness".
Always appreciate the hard work of devs to provide the community things for free, but feels like this whole project would be better off managing your expectations on it a differently.
Going to close this since #7424 seems to track this.
:+1: on removing unsealed objects fwiw.

authors: lukeapage lyleunderwood philipnilsson


text:
[core] Make String#split() return Array<?string>

It is otherwise quite easy to write unsound code here that passes Flow.
For instance, consider the following: (Try Flow)
function getDecimalPortionLength(x: string | number) {
  const parts = x.toString().split('.');
  return parts[1].length;
}

getDecimalPortionLength('1000.09'); // fine, returns 2
getDecimalPortionLength('1000'); // crashes!

It is necessary to manually refine the items in the array returned by String#split as you cannot know for sure if they will be present when arbitrary input is allowed.

Build error is before tests even run:
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
+- The following actions failed
| - build core_kernel v0.11.1

How your example crashes? It returns 1000 for me

Apologize, that's a bad example. Imagine taking the decimal portion at
index 1.
On Tue, May 21, 2019, 7:01 PM andretshurotshka notifications@github.com
wrote:

How your example crashes? It returns 1000 for me
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/facebook/flow/pull/7747?email_source=notifications&email_token=AAJEKP4M7WQ6QA2YXYKNDILPWSELXA5CNFSM4HOPF3Y2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODV5QQYI#issuecomment-494602337,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAJEKP47Q6XWF5ZYLDKEBJLPWSELXANCNFSM4HOPF3YQ
.

All array access are unsound in flow. I think the point is simple usage with interators like forEach, map or for of.
array.forEach(item => {
  item // not nullable
})
``
Direct access is unsafe everywhere. Fixing it like this in every definition will be a big breaking change. Ideally flow should change direct access output to nullable `array[0]` but keep the type non nullable for cases with iterators.

For this case I have this utility.
```js
get<T>(array: $ReadOnlyArray<T>, index: number): ?T

There's ongoing discussion about a similar change in #6823

Compared to indexed access, the DX around this is much less obnoxious. I would argue that .pop() and .shift() actually make sense to move to nullable types as they are often used in loops where you are checking for undefined anyway, like in this example.
const list = [1,2,3];
function nullablePop<T>(arr: Array<T>): ?T {
  return arr.pop();
}
let item;
while (item = nullablePop(list)) { (item: number); }

My hunch is that there isn't much use of String#split() that would be a chore to convert.

authors: STRML TrySound goodmind jamesisaac


text:
Add API for allowing disabling/enabling of UIPublisher handlers by event

Use a map to maintain handlers as they are added,  and for reference when re-enabling the handlers.
The two exported functions are very similar,  I'm not opposed to combining them into a single call if there's any suggestions.
Tested that the APIs work as expected in www
https://pxl.cl/4vGxg

Moved the tracking to ALInteractableDOMElement,  needed to refactor a bit (e.g. remove trackInteractable call) and consolidated where installHandlers is called

Please see updates in latest push @reshadi

repo: facebook/hyperion


text:
gradle build failed

Hi,
Sorry to interrupt you.  I have some problems with infer.
I used Release Version v0.15.0 of infer and run it on Ubuntu 16.04 LTS. When I built an gradle program with ' infer  -- gradle build', some error occured, and I couldn't get any solution from google.
Capturing in gradle mode...
Running and capturing gradle compilation...
12:55:49.449 [ERROR] [system.err] Note: /home/iss/work/test-source/Contacts/PhoneCommon/src/com/android/phone/common/dialpad/DialpadView.java uses or overrides a deprecated API.
12:55:49.449 [ERROR] [system.err] Note: Recompile with -Xlint:deprecation for details.
12:55:52.469 [ERROR] [system.err] /home/iss/work/test-source/Contacts/src/com/android/contacts/ContactSaveService.java:1277: warning: non-varargs call of varargs method with inexact argument type for last parameter;
12:55:52.469 [ERROR] [system.err]                     R.string.contacts_deleted_one_named_toast, names);
12:55:52.469 [ERROR] [system.err]                                                                ^
12:55:52.469 [ERROR] [system.err]   cast to Object for a varargs call
12:55:52.469 [ERROR] [system.err]   cast to Object[] for a non-varargs call and to suppress this warning
12:55:52.470 [ERROR] [system.err] /home/iss/work/test-source/Contacts/src/com/android/contacts/ContactSaveService.java:1280: warning: non-varargs call of varargs method with inexact argument type for last parameter;
12:55:52.470 [ERROR] [system.err]                     R.string.contacts_deleted_two_named_toast, names);
12:55:52.470 [ERROR] [system.err]                                                                ^
12:55:52.470 [ERROR] [system.err]   cast to Object for a varargs call
12:55:52.470 [ERROR] [system.err]   cast to Object[] for a non-varargs call and to suppress this warning
12:55:52.470 [ERROR] [system.err] /home/iss/work/test-source/Contacts/src/com/android/contacts/ContactSaveService.java:1283: warning: non-varargs call of varargs method with inexact argument type for last parameter;
12:55:52.470 [ERROR] [system.err]                     R.string.contacts_deleted_many_named_toast, names);
12:55:52.470 [ERROR] [system.err]                                                                 ^
12:55:52.471 [ERROR] [system.err]   cast to Object for a varargs call
12:55:52.471 [ERROR] [system.err]   cast to Object[] for a non-varargs call and to suppress this warning
12:55:53.930 [ERROR] [system.err] Note: Some input files use or override a deprecated API.
12:55:53.931 [ERROR] [system.err] Note: Recompile with -Xlint:deprecation for details.
12:55:53.931 [ERROR] [system.err] Note: Some input files use unchecked or unsafe operations.
12:55:53.931 [ERROR] [system.err] Note: Recompile with -Xlint:unchecked for details.
12:55:53.931 [ERROR] [system.err] 3 warnings
12:56:19.703 [ERROR] [system.err] Note: /home/iss/work/test-source/Contacts/PhoneCommon/src/com/android/phone/common/dialpad/DialpadView.java uses or overrides a deprecated API.
12:56:19.703 [ERROR] [system.err] Note: Recompile with -Xlint:deprecation for details.
12:56:20.618 [ERROR] [system.err] /home/iss/work/test-source/Contacts/src/com/android/contacts/ContactSaveService.java:1277: warning: non-varargs call of varargs method with inexact argument type for last parameter;
12:56:20.618 [ERROR] [system.err]                     R.string.contacts_deleted_one_named_toast, names);
12:56:20.618 [ERROR] [system.err]                                                                ^
12:56:20.618 [ERROR] [system.err]   cast to Object for a varargs call
12:56:20.618 [ERROR] [system.err]   cast to Object[] for a non-varargs call and to suppress this warning
12:56:20.619 [ERROR] [system.err] /home/iss/work/test-source/Contacts/src/com/android/contacts/ContactSaveService.java:1280: warning: non-varargs call of varargs method with inexact argument type for last parameter;
12:56:20.619 [ERROR] [system.err]                     R.string.contacts_deleted_two_named_toast, names);
12:56:20.619 [ERROR] [system.err]                                                                ^
12:56:20.619 [ERROR] [system.err]   cast to Object for a varargs call
12:56:20.619 [ERROR] [system.err]   cast to Object[] for a non-varargs call and to suppress this warning
12:56:20.619 [ERROR] [system.err] /home/iss/work/test-source/Contacts/src/com/android/contacts/ContactSaveService.java:1283: warning: non-varargs call of varargs method with inexact argument type for last parameter;
12:56:20.619 [ERROR] [system.err]                     R.string.contacts_deleted_many_named_toast, names);
12:56:20.619 [ERROR] [system.err]                                                                 ^
12:56:20.619 [ERROR] [system.err]   cast to Object for a varargs call
12:56:20.620 [ERROR] [system.err]   cast to Object[] for a non-varargs call and to suppress this warning
12:56:21.950 [ERROR] [system.err] Note: Some input files use or override a deprecated API.
12:56:21.950 [ERROR] [system.err] Note: Recompile with -Xlint:deprecation for details.
12:56:21.950 [ERROR] [system.err] Note: Some input files use unchecked or unsafe operations.
12:56:21.950 [ERROR] [system.err] Note: Recompile with -Xlint:unchecked for details.
12:56:21.950 [ERROR] [system.err] 3 warnings
12:58:39.251 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
12:58:39.251 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
12:58:39.252 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
12:58:39.252 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
12:58:39.252 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':lint'.
12:58:39.252 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Could not resolve all files for configuration ':lintClassPath'.
12:58:39.252 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]    > Could not download groovy-all.jar (org.codehaus.groovy:groovy-all:2.4.12)
12:58:39.252 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]       > Could not get resource 'https://jcenter.bintray.com/org/codehaus/groovy/groovy-all/2.4.12/groovy-all-2.4.12.jar'.
12:58:39.252 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]          > Could not GET 'https://jcenter.bintray.com/org/codehaus/groovy/groovy-all/2.4.12/groovy-all-2.4.12.jar'.
12:58:39.252 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]             > Connect to d29vzk4ow07wi7.cloudfront.net:443 [d29vzk4ow07wi7.cloudfront.net/54.192.84.76, d29vzk4ow07wi7.cloudfront.net/54.192.84.210, d29vzk4ow07wi7.cloudfront.net/54.192.84.72, d29vzk4ow07wi7.cloudfront.net/54.192.84.175] failed: Read timed out
12:58:39.252 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
12:58:39.253 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
12:58:39.253 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.  Run with --scan to get full insights.
12:58:39.253 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
12:58:39.253 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org
12:58:39.253 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger]
12:58:39.253 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 3m 19s
ERROR: couldn't run compilation command [u'gradle', '--debug', u'build']
Internal Error:   /home/iss/Tools/Analysis/infer-linux64-v0.15.0/lib/infer/infer/bin/../lib/python/infer.py
-j 4 --project-root /home/iss/work/test-source/Contacts --out
/home/iss/work/test-source/Contacts/infer-out -- gradle build:
exited with code 1
Error backtrace:
Raised at file "base/Die.ml" (inlined), line 25, characters 6-36
Called from file "base/Logging.ml", line 314, characters 58-80
Called from file "integration/Driver.ml", line 159, characters 2-16
Called from file "integration/Driver.ml", line 280, characters 6-420
Called from file "infer.ml", line 20, characters 2-36
Called from file "infer.ml", line 130, characters 8-54
Run the command again with --keep-going to try and ignore this error.
Please give some help. It's an emergency. Tks a lot.

In the file named “config.log”， I found some fatal error. Are they important?
configure:2913: $? = 0
configure:2902: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:2913: $? = 1
configure:2902: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:3678: gcc -E  conftest.c
conftest.c:9:28: fatal error: ac_nonexistent.h: No such file or directory
compilation terminated.
configure:3678: $? = 1
configure: failed program was:
| /* confdefs.h /
| #define PACKAGE_NAME "Infer"
| #define PACKAGE_TARNAME "infer"
| #define PACKAGE_VERSION "0.15.0"
| #define PACKAGE_STRING "Infer 0.15.0"
| #define PACKAGE_BUGREPORT "https://github.com/facebook/infer/issues/"
| #define PACKAGE_URL ""
| / end confdefs.h.  */
| #include <ac_nonexistent.h>
configure:3703: result: gcc -E
configure:3723: gcc -E  conftest.c
configure:3723: $? = 0
configure:3737: gcc -E  conftest.c
conftest.c:9:28: fatal error: ac_nonexistent.h: No such file or directory
compilation terminated.

@little-newbie does gradle build on its own succeed? It looks like it's failing to download some resource from the internet:

12:58:39.252 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Connect to d29vzk4ow07wi7.cloudfront.net:443 [d29vzk4ow07wi7.cloudfront.net/54.192.84.76, d29vzk4ow07wi7.cloudfront.net/54.192.84.210, d29vzk4ow07wi7.cloudfront.net/54.192.84.72, d29vzk4ow07wi7.cloudfront.net/54.192.84.175] failed: Read timed out

The "config.log" file is generated by autoconf and is how infer inspects your system to know how to build itself. Errors are expected and that file is not used after infer has been built.

@jvillard Thanks for your reply.
I have fixed this problem by fllowing steps.
firstly, install mpfr manally to fix the fatal error: mpfr.h: No such file or directory;
then install llvm manally to fix the fatal error: ac_nonexistent.h: No such file or directory;
finally, uninstall gradle and erase the path from my configure file and run gradlew to download and install gradle automatically.
After that, I run ‘infer -- gradle build’， and found some bugs  in infer-out directory.

@little-newbie thanks for posting your steps to resolution!

authors: jvillard little-newbie

repo: facebook/infer


text:
[Bug]: structuredClone fails on toStrictEqual

Version
29.4.0
Steps to reproduce

Clone my repository at https://github.com/JamieMagee/jest-structuredclone-strictequal/blob/master/index.spec.js
npm install
npm test

Expected behavior
I expect to see objects cloned with structuredClone to pass toStrictEqual
Actual behavior
The values do not pass toStrictEqual (but do pass toEqual).
jest › toStrictEqual › structured clone

    expect(received).toStrictEqual(expected) // deep equality

    Expected: {"value": "test"}
    Received: serializes to the same string

       6 |     describe('toStrictEqual', () => {
       7 |         it('structured clone', () => {
    >  8 |             expect(structuredClone(value)).toStrictEqual(value);
         |                                            ^
       9 |         });
      10 |         it('JSON clone', () => {
      11 |             expect(JSON.parse(JSON.stringify(value))).toStrictEqual(value);

      at Object.toStrictEqual (index.spec.js:8:44)

However JSON.parse(JSON.stringify()) does pass toStrictEqual
Additional context
The test output can be seen in this GitHub Actions run.
Environment
System:
  OS: Linux 6.2 NixOS 23.05 (Stoat) 23.05 (Stoat)
  CPU: (32) x64 AMD Ryzen 9 7950X 16-Core Processor
Binaries:
  Node: 19.7.0 - /run/current-system/sw/bin/node
  Yarn: 1.22.19 - /run/current-system/sw/bin/yarn
  npm: 9.5.0 - /run/current-system/sw/bin/npm

I was playing with assert and expect:
import assert from "node:assert";
import { expect } from "@jest/globals";

// equality

assert.deepEqual(JSON.parse(JSON.stringify(value)), value); // pass
expect(JSON.parse(JSON.stringify(value))).toEqual(value); // pass

assert.deepEqual(structuredClone(value), value); // pass
expect(structuredClone(value)).toEqual(value); // pass

// strict equality

assert.deepStrictEqual(JSON.parse(JSON.stringify(value)), value); // pass
expect(JSON.parse(JSON.stringify(value))).toStrictEqual(value); // pass

assert.deepStrictEqual(structuredClone(value), value); // fail !!!
expect(structuredClone(value)).toStrictEqual(value); // fail !!!

Hm.. if Node and Expect agrees, that is correct behaviour. Or did I miss something?

Probably because:
Object.getPrototypeOf(value) === Object.getPrototypeOf(JSON.parse(JSON.stringify(value))) // true

Object.getPrototypeOf(value) === Object.getPrototypeOf(structuredClone(value)) // false

Okay, it looks like this might be a limitation of structuredClone and we should use toEqual instead. From MDN (emphasis mine):

Certain object properties are not preserved:

The lastIndex property of RegExp objects is not preserved.
Property descriptors, setters, getters, and similar metadata-like features are not duplicated. For example, if an object is marked readonly with a property descriptor, it will be read/write in the duplicate, since that's the default.
The prototype chain is not walked or duplicated.

My gut feeling is that I would not want to stop using .toStrictEqual(value) but would prefer another solution than to start using .toEqual(value).
.toStrictEqual(value) verifies a lot of other nice things. From https://jestjs.io/docs/expect#tostrictequalvalue:

keys with undefined properties are checked, e.g. {a: undefined, b: 2} will not equal {b: 2};
undefined items are taken into account, e.g. [2] will not equal [2, undefined];
array sparseness is checked, e.g. [, 1] will not equal [undefined, 1];
object types are checked, e.g. a class instance with fields a and b will not equal a literal object with fields a and b.

I wish to not loose all these checks when using structuredClone().
I am not sure of the solution. One option could be to in a major version (i.e. a breaking change) omitting .toStrictEqual(value) to check for the prototype. Another option would be a new function.
Any other options we have?

Indeed it would be useful to be able to use .toStrictEqual() in this case as well. What about: .toStrictEqual(value, {skipPrototypeCheck: true}) or similar option?

@mrazauskas that might be one route, but it kind of goes against other APIs at https://jestjs.io/docs/expect. Very few function has a second argument. And if they do, it is not an object, possibly for readability.
Then I'd rather have .toStrictEqual(value, skipPrototypeCheck?) . Which then can be used in unit test that calls code that uses structuredClone. Could/would be nice to add to the docs for the argument skipPrototypeCheck if that is route is taken.
I am not sure if @SimenB has more input on how a new API to cover this should look. Argument, new function or something else.

Not sure how you define readability. A bag of options is easier to extend in the future and is understandable without looking at the docs:
.toStrictEqual(value, {skipPrototypeCheck: true, skipUndefinedCheck: false})
.toStrictEqual(value, true, false)

Yeah, I agree it is subjective.
Would a new toBeClone() add too many similar APIs?

Great idea! I could see .toBeClone() implemented in Jest Extended next to .toBeFrozen() and .toBeSealed().
I guess prototype should be somehow replaced for both objects before sending them into equals() and that is it. Or?

Selfish wish would be for it to be part of the core Jest expect functions, since we avoid Jest Extended as to not complicate users with too many options. But that is entirely subjective, as much is 😆 One reason to keep it on the core Jest Expect lib would be that structuredClone() is a standard/global API that exists on the global object.
As for the question about equals() I do not know the details how the comparison is done internally. In general, replacing the prototype is considered bad and not great for performance, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/setPrototypeOf. Not sure if that detail adds any value to how equals() works?

By the way, I was trying to implement a custom matcher and came to this idea:
const value = { test: 123 };
const received = structuredClone(value);

expect(received).toStrictEqual(structuredClone(value));

I suppose this is still a great feature to have.

Hi there ! I just stumbled upon the same issue, and I agree that, given structuredClone is now part of the standard library and more and more codebases, there should be an appropriate test for it.
One particular sample that should pass IMO is the following:
describe('foo', () => {
    test('date check', () => {
        const date = new Date();
        expect(structuredClone(date)).toStrictEqual(date);
    });
});

This currently fails with

expect(received).toStrictEqual(expected) // deep equality

    Expected: 2023-05-23T13:12:11.576Z
    Received: serializes to the same string

This is key to me because using the JSON.parse(JSON.stringify(...)) technique does not accommodate nested dates objects (they are serialised to strings), where structuredClone does.
I don't really get what Jest sees to differentiate the original and the clone in the date exemple above, aren't the prototypes the same?

@Marchelune if you read the thread and https://github.com/jestjs/jest/issues/14011#issuecomment-1473947328 and also the comment after it, it answers the question.

@thernstig I did read that and I saw the prototypes aren't the same but it still doesn't explain why it is so.

@thernstig it specifically says The prototype chain is not walked or duplicated. which means after structuredClone the new object has no object sets for its prototype, meaning it cannot be the same. Does that not explain it?

Unstale

Feels important enough to keep alive as I suspect modern JavaScript will use structuredClone

As already mentioned, the solution is simple:
const value = { test: 123 };
const received = structuredClone(value);

expect(received).toStrictEqual(structuredClone(value)); // pass !!!

A new .toBeClone() matcher is not a good idea, because it will be passing with values wich aren’t clones. There is no mechanism to check that. I think above example reads well, declares the intent and does the right job. No need to overthink.

@mrazauskas close this thread then? Or is it a docs issue?

Narrowed this down to typeEquality:
https://github.com/jestjs/jest/blob/0fd5b1c37555f485c56a6ad2d6b010a72204f9f6/packages/expect-utils/src/utils.ts#L372-L387
Specifically, the a.constructor === b.constructor check fails, because of https://github.com/jestjs/jest/issues/2549. This has been reported before: https://github.com/jestjs/jest/issues/14074 This is an unwanted side effect of this old PR: https://github.com/jestjs/jest/pull/7005 Dropping isolation is not an option, so I think the only solution is to improve typeEquality. Maybe a lookup table can be introduced when isolating the modules, mapping "fake" constructors to the originals? So the comparison would be this:
(originals[a.constructor] ?? a.constructor) === (originals[b.constructor] ?? b.constructor)

@Grub4K Thanks. Good catch!
Seems like this is simply #2549. Using jest-light-runner solves the problem. Reference: https://github.com/jestjs/jest/issues/2549#issuecomment-1098071474
With jest-light-runner I got:
 PASS  tests/quick.test.js
  expect(structuredClone(value)).toStrictEqual(value)
    ✓ value=string (1 ms)
    ✓ value=1234 (0 ms)
    ✓ value=[] (0 ms)
    ✓ value=[ 1, 2, 3, 4 ] (0 ms)
    ✓ value={} (0 ms)
    ✓ value={ '0': 0 } (0 ms)
    ✓ value=2023-08-16T10:11:58.274Z (0 ms)
  assert.deepStrictEqual(value, structuredClone(value))
    ✓ value=string (0 ms)
    ✓ value=1234 (0 ms)
    ✓ value=[] (0 ms)
    ✓ value=[ 1, 2, 3, 4 ] (0 ms)
    ✓ value={} (0 ms)
    ✓ value={ '0': 0 } (0 ms)
    ✓ value=2023-08-16T10:11:58.274Z (0 ms)

Would be interesting to try this out wider.

@mrazauskas sorry for asking, but I am a bit confused as to the conclusion of this now. Is the suggestion for everyone to switch to jest-light-runner. Considering that Node assert also handles this.

Comment. Still a bug.

@thernstig it specifically says The prototype chain is not walked or duplicated. which means after structuredClone the new object has no object sets for its prototype, meaning it cannot be the same. Does that not explain it?

I don't think that's correct. My reading is that it won't recursively deep clone the prototype chain, which makes sense.
This can be seen by trying out these two lines in your browser or Node.js repl:
structuredClone([]).constructor === [].constructor
// => true

Object.getPrototypeOf([]) === Object.getPrototypeOf(structuredClone([]))
// => true

I think that this is Jest specific, because trying the same within the Jest runner results in another behaviour:
console.error(structuredClone([]).constructor === [].constructor)

  ● Console

    console.error
      false

    > 119 |       console.error(structuredClone([]).constructor === [].constructor)
          |               ^

My guess is that this has something to do with worker threads/sandboxing/custom global environment, where maybe the global Array isn't the same as the Array constructor that structuredClone uses. But I'm not familiar enough with the inner workings of Jest to say for sure...

I'm a little confused about the recent discourse, doesn't the analysis I posted explain the bug? https://github.com/jestjs/jest/issues/14011#issuecomment-1656921872 Now a collaborator just needs to take a look and decide what next.

Be kind to us bot

Be kind to us bot

pls no stale

This is still relevant.

Not stale

This is still an issue for me.

Not stale

Not stale

Not sure if it is the same problem, but it also fails in the following test:
  it('should verify the constructor type', () => {
    const x = new Date()
    const y = structuredClone(x)
    expect(x).toEqual(expect.any(Date)) // ✅ pass
    expect(y).toEqual(expect.any(Date)) // ❎ fails
  })

still a problem IMO

still not resolved

Still unresolved

authors: JamieMagee LinusU Marchelune alecmev ftoyoshima mrazauskas si14 thernstig

repo: facebook/jest


text:
[Danger] node 4 lodash fix

Summary
Uses relative import for lodash instead of global imports
Test plan
Works on my machine ;)

rebase pls.

I'm gonna wait for CI this time.

authors: cpojer orta


text:
Update documentation, package versions and changelog.

Nothing to see here, really!

@facebook-github-bot shipit


text:
Reorder Keys

I know this seems very silly (and it is, actually), but it's a workaround for an issue with our internal javascript parser.

Closed in favor of doing it in the build: https://github.com/facebook/lexical/pull/2970

repo: facebook/lexical


text:
Update textinput.md

Hello @dragosbocancea, thank you for updating the docs! 👍
Can you provide some context for this change?

While trying to trigger a TextInput field to be autocompleted using a password manager, I have noticed that the former autoComplete did not do anything on android, but by replacing it to autoCompleteType, as suggested in one stackoverflow
post (if I remember correctly), it worked as desired. Therefore I supposed that the correct prop would be autoCompleteType, not autoComplete.

Up?

Unfortunately, I cannot confirm your changes with the React Native code.
There is no entry name autoCompleteType when searching thought the whole repository:

https://cs.github.com/facebook/react-native?q=autoCompleteType

The prop named autoComplete can be found in the TextInput JS file as well as in Android native code:

https://github.com/facebook/react-native/blob/main/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js#L125
https://github.com/facebook/react-native/blob/main/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java#L758

authors: Simek dragosbocancea

repo: facebook/react-native-website


text:
[Idea: Style] display:none and visibility:hidden

I've been using onLayout a bit and have been thinking about these two CSS concepts in RN. Here's what each would do and how they fit into React:
display:none: the React component is rendered in the component hierarchy so it can retain state, but no shadow views are created for it. No layout calculations are performed nor are UIViews created. Asking for its measurements gives a zero rect, just like the DOM.
visibility:hidden: shadow views are created for the React component and layout is calculated, but no UIViews are created, which is how this differs from opacity:0.
I haven't measured any performance problems so these aren't hi-pri for me, but could be good to anticipate as more view optimizations are written. Display:none (or maybe visibility:hidden if layout is needed) in particular seems like a great fit for ListView cells since off-screen cells could retain component state and not incur any native overhead.

@ide what's the use case for needing visibility:hidden that display:none or opacity:0 wouldn't cover? I guess visibility:hidden wouldn't block touch events?
Purely curious. I've found myself wanting display:none several times. I also like that it increases parity with the web.

display:none would be very useful.
In some case I had to use transfom:translate() to move the element out of screen to hide it.

@lelandrichardson: opacity:0 would still create UIViews and acts like uiView.alpha = 0 or uiView.hidden = YES. We may want to override the hit testing so that fully transparent views still receive touches though this is not the case currently.
Meanwhile visibility:hidden would not create UIViews and would not receive touch events.

https://github.com/facebook/react-native/issues/638

Thank you for reporting this issue and appreciate your patience. We've  notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.

Still think this is good. For now have been making do with opacity:0 but in the long run I think we'll want this as a primitive on which optimizations can be written.

It's worth noting here that on web and Android, opacity: 0, fully transparent views still receive touches - iOS is the odd one out.

there's only one way to implement this, just set the container view's height to 0.

I would appreciate this, I've been doing something similar to others in this thread, setting width and height to 0 when I want an element to not be displayed.

Hi guys ! Any update on this since from 0.15.0, views with opacity:0 receive touch ?

@ahanriat Yes, they do, both on Android and iOS.

Use pointerEvents to ignore touches. Unfortunately on Android touches don't go through overlapping absolutely positioned views though.

@satya164 & @ide I now use pointerEvents, and I think it's better this way ;)
I assume return false instead of the component will do the same as a css display: none on the component itself

The React component is still mounted when you use CSS "display: none". If you return null, the component will be unmounted and its state will be destroyed.

+1, but for now it seems that adding
{
width: 0,
height: 0,
}
achieves the same thing. I did not test it thoroughly though.

Hi there! This issue is being closed because it has been inactive for a while.
But don't worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/idea-style-displaynone-and-visibilityhidden
ProductPains helps the community prioritize the most important issues thanks to its voting feature.
It is easy to use - just login with GitHub.
Also, if this issue is a bug, please consider sending a PR with a fix.
We're a small team and rely on the community for bug fixes of issues that don't affect fb apps.

{height: 0, opacity: 0} worked for me as an alternative to {display: none}

There is a bug on android that changing height to 0 doesn't effect real height (using Animated.Value), so that doesn't work for me. Invisible view still intercept touches.

I need to add css like display:block; Anyone how help me?

You can use my module react-native-display to show/hide components.

https://github.com/facebook/react-native/commit/4d69f4b2d1cf4f2e8265fe5758f28086f1b67500

@zainulabidin302, Thank you! Simple and efficient.

@zainulabidin302 @diogofos

You can write shorter:
{ this.state.showComponent && <Component/> }
Component is unmounted if you do that way.

authors: DanielHoffmann Gentlee JohnnieFucker ahanriat brentvatne codazoda diogofos facebook-github-bot-8 gre ide lelandrichardson magicismight matthewga0 mkonicek ryanmcdermott satya164 sundayhd uc-hus

repo: facebook/react-native


text:
[iOS] removedChildren count (0) was not what we expected (1)

🐛 Bug Report
RCTUIManager throws exceptions when managing children where a parent has both static and dynamic content. Seems like when the static part comes first, and the dynamic part changes size, the indices of the children do not match up. Several similar issues have been opened in react-native-svg, and e.g. in several charting libraries built on top of it etc. and various workarounds exist, but the problem keeps popping up and should just work.
https://github.com/FormidableLabs/victory-native/issues/432
https://github.com/indiespirit/react-native-chart-kit/issues/62
https://github.com/msand/react-native-svg-charts/commit/e8b0baa6080778cb01474f46a29e601fffee26e7
https://github.com/JesperLekland/react-native-svg-charts/pull/280
https://github.com/JesperLekland/react-native-svg-charts/issues/244
https://github.com/react-native-community/react-native-svg/issues/258
https://github.com/react-native-community/react-native-svg/issues/848
To Reproduce
git clone https://github.com/msand/ReproRCTUIManagerBug.git
cd ReproRCTUIManagerBug
yarn
react-native run-ios

Or do the following steps
react-native init
yarn add react-native-svg victory-native
react-native link
change App.js to reproduction code
react-native run-ios

Click either Increment or Decrement button
Expected Behavior
The chart renders without exceptions in iOS, the same way as it currently does in Android.
Code Example
https://snack.expo.io/@msand/groaning-chocolate
https://github.com/msand/ReproRCTUIManagerBug
The code works in expo, but not with latest react-native.
Update: Doesn't work in Expo either, it just doesn't throw any exception, and does a partial re-render. If you click decrement twice, then the indices will align, and it'll start re-rendering with new content. At that point, incrementing will work as well.
Environment
React Native Environment Info:
System:
OS: macOS High Sierra 10.13.6
CPU: (4) x64 Intel(R) Core(TM) i5-4278U CPU @ 2.60GHz
Memory: 109.55 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.2.0 - /usr/local/bin/node
Yarn: 1.12.3 - /usr/local/bin/yarn
npm: 6.7.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 16, 23, 24, 25, 26, 27, 28
Build Tools: 23.0.1, 25.0.0, 25.0.1, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.1, 27.0.2, 27.0.3, 28.0.2, 28.0.3
System Images: android-16 | Google APIs Intel x86 Atom, android-26 | Google APIs Intel x86 Atom_64, android-27 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom
IDEs:
Android Studio: 3.3 AI-182.5107.16.33.5199772
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.3 => 16.6.3
react-native: 0.58.4 => 0.58.4
npmGlobalPackages:
create-react-native-app: 2.0.2
react-native-cli: 2.0.1
react-native-create-library: 3.1.2
react-native-git-upgrade: 0.2.7
react-native-init: 0.6.7
Workaround
Change
    return React.cloneElement(groupComponent, groupProps, [
      clipComponent,
      ...React.Children.toArray(children),
    ]);

To
    return React.cloneElement(groupComponent, groupProps, [
      ...React.Children.toArray(children),
      clipComponent,
    ]);

No idea why this fixes it, both work the same way in Android. In some other cases, it requires wrapping the part with changing number of children in another parent, e.g. using a G element (used for grouping svg elements) to isolate it from the static content.
Exceptions
Exception when decrementing:
removedChildren count (0) was not what we expected (1)
Exception when incrementing
Exception '*** -[__NSArrayM insertObject:atIndex:]: index 4 beyond bounds [0 .. 2]' was thrown while invoking manageChildren on target UIManager with params (
    55,
        (
    ),
        (
    ),
        (
        327
    ),
        (
        4
    ),
        (
    )
)
callstack: (
	0   CoreFoundation                      0x00000001129121bb __exceptionPreprocess + 331
	1   libobjc.A.dylib                     0x0000000110ff7735 objc_exception_throw + 48
	2   CoreFoundation                      0x000000011285e4ec _CFThrowFormattedException + 194
	3   CoreFoundation                      0x000000011283a794 -[__NSArrayM insertObject:atIndex:] + 1300
	4   SvgExample                          0x000000010f50357f -[RCTShadowView insertReactSubview:atIndex:] + 399
	5   SvgExample                          0x000000010f52d996 -[RCTUIManager _manageChildren:moveFromIndices:moveToIndices:addChildReactTags:addAtIndices:removeAtIndices:registry:] + 2966
	6   SvgExample                          0x000000010f52c8f6 -[RCTUIManager manageChildren:moveFromIndices:moveToIndices:addChildReactTags:addAtIndices:removeAtIndices:] + 342
	7   CoreFoundation                      0x000000011291903c __invoking___ + 140
...

Seems another workaround is to make the ViewManager return null for the shadowView: https://github.com/react-native-community/react-native-svg/commit/9e516a2098d8772b63b1b084d0209ad1e2433454
But, I suspect this will affect (native) animations: https://github.com/react-native-community/react-native-svg/pull/755
@shergin @hramos Any advice?

So I've found and fixed it for react-native-svg and friends at least.
The issue was that another ViewManager was still returning nil, thus causing the indices to misalign. Making all the ViewManagers use the shadowView method inherited from the RCTViewManager allows keeping the animation support as is.
I wonder, should RCTViewManager / RCTUIManager take into account if the shadowView is nil for some children/siblings, and adjust the indices accordingly? Instead of throwing exceptions.
Or are there expectations/contracts on the ViewManager never to return nil? The comments say:

should return a fresh instance each time it is called

But, it also works fine if all the ViewManagers return nil. So, not very expected that it would crash when combining components, having both types of ViewManagers / shadowView methods, inside the same parent.

Made a reproduction which is as small as I could imagine:
import React, { Component } from 'react';
import { View, Text, StyleSheet, TouchableOpacity } from 'react-native';
import { Svg, Defs, Circle } from 'react-native-svg';

const colors = ['black', 'red', 'green', 'blue'];

export default class App extends Component {
  state = { length: 3 };
  inc = () => {
    this.setState(({ length }) => {
      return { length: length + 1 };
    });
  };
  dec = () => {
    this.setState(({ length }) => {
      return { length: length - 1 };
    });
  };
  render() {
    return (
      <View style={style.container}>
        <View style={style.buttons}>
          <TouchableOpacity onPress={this.inc} style={style.button}>
            <Text>Increment</Text>
          </TouchableOpacity>
          <TouchableOpacity onPress={this.dec} style={style.button}>
            <Text>Decrement</Text>
          </TouchableOpacity>
        </View>
        <Svg width="100%" height="100%" viewBox="0 0 100 100">
          <Defs />
          {Array.from(this.state).map((_, i) => (
            <Circle
              key={i}
              x="50"
              y="50"
              r={50 / (i + 1)}
              fill={colors[i % colors.length]}
            />
          ))}
        </Svg>
      </View>
    );
  }
}
const style = StyleSheet.create({
  container: { backgroundColor: 'white', paddingTop: 40 },
  buttons: { flexDirection: 'row' },
  button: {
    margin: 10,
    padding: 10,
    borderWidth: 1,
    borderColor: 'black',
  },
});

The Defs element returns nil for the shadowView in v7.0.0-v9.2.3 of react-native-svg, making the indices in manageChildren go haywire when changing the number of Circle elements, which do have a RCTShadowView as the shadowView. The same goes for every other kind of element in react-native-svg (excluding only the Defs element).

The easiest workaround is probably to wrap the Defs element in a G element for now, if one needs backwards compatibility with pre v9.2.4, and/or wrapping any changing number of elements in a G element. But, upgrading to the latest version, and only using G elements where it is useful for structure or performance would be the best.


text:
Exception in thread "main" java.net.SocketException: Unexpected end of file from server

I'm newcomer for React Native. I wanted to run a helloworld but encountered following bugs when I run react-native run-android:
info JS server already running.
info Building and installing the app on the device (cd android && gradlew.bat app:installDebug)...
Downloading https://services.gradle.org/distributions/gradle-5.4.1-all.zip

Exception in thread "main" java.net.SocketException: Unexpected end of file from server
        at java.base/sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:862)
        at java.base/sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:689)
        at java.base/sun.net.www.protocol.http.HttpURLConnection.doTunneling(HttpURLConnection.java:2074)
        at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:183)
        at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1581)
        at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1509)
        at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:245)
        at org.gradle.wrapper.Download.downloadInternal(Download.java:67)
        at org.gradle.wrapper.Download.download(Download.java:52)
        at org.gradle.wrapper.Install$1.call(Install.java:62)
        at org.gradle.wrapper.Install$1.call(Install.java:48)
        at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69)
        at org.gradle.wrapper.Install.createDist(Install.java:48)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:63)
error Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
error Command failed: gradlew.bat app:installDebug. Run CLI with --verbose flag for more details.

React Native version:

info
  React Native Environment Info:
    System:
      OS: Windows 10
      CPU: (4) x64 Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz
      Memory: 1.30 GB / 7.87 GB
    Binaries:
      Node: 10.15.0 - E:\Node.js\node.EXE
      Yarn: 1.16.0 - ~\AppData\Roaming\npm\yarn.CMD
      npm: 6.4.1 - E:\Node.js\npm.CMD
    IDEs:
      Android Studio: Version  3.4.0.0 AI-183.6156.11.34.5522156

Steps To Reproduce
It's really just a helloworld

react-native init myhellow
cd myhello
react-native run-android

Describe what you expected to happen:

I want to see something (like greetings) in my phone connected to computer

It seems that your network connection is lost while downloading gradle-5.4.1-all.zip, which is a very large file. Please try again.

authors: Gusabary dulmandakh


text:
Build Android APK faild with macOS 11.0.1, react-native 0.59.10

Please provide all the information requested. Issues that do not follow this format are likely to stall.
Description
After I upgraded my MacOS to 11.0.1, I ran the Android packaging command ./gradlew assembleRelease, and it failed
java.lang.UnsatisfiedLinkError: Unable to load library 'CoreFoundation': dlopen(libCoreFoundation.dylib, 9): image not found dlopen(libCoreFoundation.dylib, 9): image not found Native library (darwin/libCoreFoundation.dylib) not found in resource path (/Applications/Android Studio.app/Contents/lib/bootstrap.jar:/Applications/Android Studio.app/Contents/lib/extensions.jar:/Applications/Android Studio.app/Contents/lib/util.jar:/Applications/Android Studio.app/Contents/lib/jdom.jar:/Applications/Android Studio.app/Contents/lib/log4j.jar:/Applications/Android Studio.app/Contents/lib/trove4j.jar:/Applications/Android Studio.app/Contents/lib/jna.jar:/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/lib/tools.jar) 	at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:302) 	at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:455) 	at com.sun.jna.Library$Handler.<init>(Library.java:192) 	at com.sun.jna.Native.load(Native.java:596) 	at com.sun.jna.Native.load(Native.java:570) 	at com.intellij.util.text.DateFormatUtil.getMacFormats(DateFormatUtil.java:363) 	at com.intellij.util.text.DateFormatUtil.getDateTimeFormats(DateFormatUtil.java:303) 	at com.intellij.util.text.DateFormatUtil.<clinit>(DateFormatUtil.java:46) 	at com.intellij.openapi.wm.impl.status.StatusPanel$5.run(StatusPanel.java:196) 	at com.intellij.openapi.wm.impl.status.StatusPanel.updateText(StatusPanel.java:205) 	at com.intellij.openapi.wm.impl.status.InfoAndProgressPanel.setText(InfoAndProgressPanel.java:517) 	at com.intellij.openapi.wm.impl.status.IdeStatusBarImpl.lambda$setInfo$5(IdeStatusBarImpl.java:398) 	at com.intellij.util.ui.UIUtil.invokeLaterIfNeeded(UIUtil.java:2319) 	at com.intellij.openapi.wm.impl.status.IdeStatusBarImpl.setInfo(IdeStatusBarImpl.java:396) 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 	at java.lang.reflect.Method.invoke(Method.java:498) 	at com.intellij.util.messages.impl.MessageBusImpl.invokeListener(MessageBusImpl.java:541) 	at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:143) 	at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:465) 	at com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(MessageBusImpl.java:426) 	at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:415) 	at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:397) 	at com.intellij.util.messages.impl.MessageBusImpl.lambda$createTopicHandler$3(MessageBusImpl.java:237) 	at com.sun.proxy.$Proxy141.setInfo(Unknown Source) 	at com.intellij.openapi.wm.StatusBar$Info.set(StatusBar.java:52) 	at com.intellij.notification.LogModel.setStatusMessage(LogModel.java:72) 	at com.intellij.notification.LogModel.addNotification(LogModel.java:44) 	at com.intellij.notification.EventLog$ProjectTracker.printNotification(EventLog.java:507) 	at com.intellij.notification.EventLog$ProjectTracker.access$400(EventLog.java:446) 	at com.intellij.notification.EventLog$ProjectTracker$1.notify(EventLog.java:467) 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 	at java.lang.reflect.Method.invoke(Method.java:498) 	at com.intellij.util.messages.impl.MessageBusImpl.invokeListener(MessageBusImpl.java:541) 	at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:143) 	at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:465) 	at com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(MessageBusImpl.java:426) 	at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:415) 	at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:397) 	at com.intellij.util.messages.impl.MessageBusImpl.lambda$createTopicHandler$3(MessageBusImpl.java:237) 	at com.sun.proxy.$Proxy145.notify(Unknown Source) 	at com.intellij.notification.Notifications$Bus.doNotify(Notifications.java:79) 	at com.intellij.notification.Notifications$Bus.lambda$notify$1(Notifications.java:73) 	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) 	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764) 	at java.awt.EventQueue.access$500(EventQueue.java:98) 	at java.awt.EventQueue$3.run(EventQueue.java:715) 	at java.awt.EventQueue$3.run(EventQueue.java:709) 	at java.security.AccessController.doPrivileged(Native Method) 	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) 	at java.awt.EventQueue.dispatchEvent(EventQueue.java:734) 	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:974) 	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:847) 	at com.intellij.ide.IdeEventQueue.lambda$null$8(IdeEventQueue.java:449) 	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:741) 	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:448) 	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:831) 	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:502) 	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205) 	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) 	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) 	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) 	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) 	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) 	Suppressed: java.lang.UnsatisfiedLinkError: dlopen(libCoreFoundation.dylib, 9): image not found 		at com.sun.jna.Native.open(Native Method) 		at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:191) 		... 66 more 	Suppressed: java.lang.UnsatisfiedLinkError: dlopen(libCoreFoundation.dylib, 9): image not found 		at com.sun.jna.Native.open(Native Method) 		at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:204) 		... 66 more 	Suppressed: java.io.IOException: Native library (darwin/libCoreFoundation.dylib) not found in resource path (/Applications/Android Studio.app/Contents/lib/bootstrap.jar:/Applications/Android Studio.app/Contents/lib/extensions.jar:/Applications/Android Studio.app/Contents/lib/util.jar:/Applications/Android Studio.app/Contents/lib/jdom.jar:/Applications/Android Studio.app/Contents/lib/log4j.jar:/Applications/Android Studio.app/Contents/lib/trove4j.jar:/Applications/Android Studio.app/Contents/lib/jna.jar:/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/lib/tools.jar) 		at com.sun.jna.Native.extractFromResourcePath(Native.java:1095) 		at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:276)
React Native version:
System:
OS: macOS 11.0.1
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Memory: 231.25 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 10.16.0 - /usr/local/bin/node
Yarn: 1.17.3 - /usr/local/bin/yarn
npm: 6.14.4 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 14.2, DriverKit 20.0, macOS 11.0, tvOS 14.2, watchOS 7.1
Android SDK:
API Levels: 23, 28, 29
Build Tools: 28.0.3, 29.0.2
System Images: android-28 | Intel x86 Atom, android-28 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom
IDEs:
Android Studio: 4.1 AI-201.8743.12.41.6953283
Xcode: 12.2/12B45b - /usr/bin/xcodebuild
npmPackages:
react: 16.8.3 => 16.8.3
react-native: 0.59.10 => 0.59.10
npmGlobalPackages:
react-native-cli: 2.0.1
///////////
I know this problem caused by the following
New in macOS Big Sur 11 beta, the system ships with a built-in dynamic linker cache of all system-provided libraries. As part of this change, copies of dynamic libraries are no longer present on the filesystem. Code that attempts to check for dynamic library presence by looking for a file at a path or enumerating a directory will fail. Instead, check for library presence by attempting to dlopen() the path, which will correctly check for the library in the cache. (62986286)
but i dont know how to solve this problem, please help

It looks like Big Sur removed JAVA_HOME variable. You can fix it by adding JAVA_HOME to your .zshrc.
First, you need to find a path to JDK by running /usr/libexec/java_home -V

Matching Java Virtual Machines (2):
1.8.271.09 (x86_64) "Oracle Corporation" - "Java" /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
1.8.0_171 (x86_64) "Oracle Corporation" - "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home

Then you need to update you .zshrc with

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home

authors: PinelliaTime talyuk


text:
Android: Collection Name not supported by Flatlist, SectionList, VirtualizedList, or ScrollView

Description
Collections on Android have a name defined by their contentDescription property. This name will be announced as part of the "in list" and "out of list" announcements. Since we do not support the list/grid/pager roles, the contentDescription's set on these components don't announce these names upon focus into or out of any descendant elements.
Collection Name not from collection Not supported by:

[ ] Flatlist #30968
[ ] SectionList #30969
[ ] VirtualizedList  #30970
[ ] ScrollView  #30971

React Native version:
v0.63
Expected Behavior
If one of the list components has a contentDescription set on it, on first focus into that list, screen readers will announce "in list ".  Upon focus out of the list, it should announce "out of list ".
Android Details
This should work properly if any of the collection roles were able to be set, which makes this task dependent on #30839.  By adding these roles, and properly setting the contentDescription the collection name should automatically be announced.

Hi @amarlette , I would like to work on this. Please guide me with some initial steps on "collection roles" to proceed, that would be helpful.

Related https://github.com/facebook/react-native/pull/33180

[ ] verify if new prop/type is required for this API
[ ] add setter in Java API to set the prop
[ ] add JavaScript API
[ ] record test cases and publish pr

task tracked on https://github.com/facebook/react-native/issues/30861#issuecomment-1193687248


text:
Upgrade from 0.66.3 to .068.2 Ios App multiple target

Description
We have a target for the app and a target for an appClip
it was ok on 0.66.3 but after upgrading to 0.66.8 it opens the two bundlers at the same time when building the app target that makes conflict loading bundles on the app
How can we disable parallel building in such a case?
it was checked with manual and automatic order on the build scheme and results are the same
Version
0.68.2
Output of npx react-native info
System:
OS: macOS 12.0.1
CPU: (8) x64 Apple M1
Memory: 62.33 MB / 8.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.17.0 - ~/.nvm/versions/node/v14.17.0/bin/node
Yarn: 1.22.10 - ~/.npm-global/bin/yarn
npm: 6.14.13 - ~/.nvm/versions/node/v14.17.0/bin/npm
Watchman: 2022.03.21.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK: Not Found
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8609683
Xcode: 13.3.1/13E500a - /usr/bin/xcodebuild
Languages:
Java: 11.0.12 - /usr/bin/javac
npmPackages:
@react-native-community/cli: ^5.0.1 => 5.0.1
react: 17.0.2 => 17.0.2
react-native: 0.68.2 => 0.68.2
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Steps to reproduce
add another target that runs react-native
upgrade to the latest version
Snack, code example, screenshot, or link to a repository

keep it up


text:
no type or protocol named UIApplicationOpenURLOptionsKey

Description
#import <React/RCTLinkingManager.h>

(BOOL)application:(UIApplication *)app
openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
return [RCTLinkingManager application:app openURL:url options:options];
}

"react-native": "0.72.5",
XCode - 14
React Native Version
0.72.5
Output of npx react-native info
warn Multiple Podfiles were found: ios/Podfile,macos/Podfile. Choosing ios/Podfile automatically. If you would like to select a different one, you can configure it via "project.ios.sourceDir". You can learn more about it here: https://github.com/react-native-community/cli/blob/master/docs/configuration.md
System:
OS: macOS 13.3.1
CPU: (8) arm64 Apple M1
Memory: 93.98 MB / 8.00 GB
Shell:
version: 3.2.57
path: /bin/bash
Binaries:
Node:
version: 19.5.0
path: /opt/homebrew/bin/node
Yarn: Not Found
npm:
version: 6.14.18
path: /opt/homebrew/bin/npm
Watchman:
version: 2023.01.23.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.13.0
path: /Users/elango/.rvm/gems/ruby-2.7.6/bin/pod
Steps to reproduce
react-native run-macos
Snack, screenshot, or link to a repository
warn Multiple Podfiles were found: ios/Podfile,macos/Podfile. Choosing ios/Podfile automatically. If you would like to select a different one, you can configure it via "project.ios.sourceDir". You can learn more about it here: https://github.com/react-native-community/cli/blob/master/docs/configuration.md
System:
OS: macOS 13.3.1
CPU: (8) arm64 Apple M1
Memory: 93.98 MB / 8.00 GB
Shell:
version: 3.2.57
path: /bin/bash
Binaries:
Node:
version: 19.5.0
path: /opt/homebrew/bin/node
Yarn: Not Found
npm:
version: 6.14.18
path: /opt/homebrew/bin/npm
Watchman:
version: 2023.01.23.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.13.0
path: /Users/elango/.rvm/gems/ruby-2.7.6/bin/pod

LinkingIOS not working actually!

react-native run-macos

Hi,
Thanks for reporting this issue.
It seems like this issue is actually unrelated to React Native core but related to React Native MacOS
https://github.com/microsoft/react-native-macos/issues
I'll be closing this but feel free to reopen if the other repo points back to us as a issue in the core of React Native.

authors: ElangoPrince cortinico


text:
[0.19][Android] Sticky header is called out in release notes, but not actually working

In the release notes for 0.19, the much anticipated sticky header for Android was said to be implemented:

Added stickyHeaderIndices to ListView – 4bc425c

However, it doesn't seem to actually work.  The referenced commit does add the parameter, but I don't see any native changes.
Are the release notes incorrect?

cc @cancan101

My pr added the sticky header just for ios. I'm not sure why the release notes set android.

I updated the release notes by moving that item from Android to iOS. Thanks for the heads-up.

+1

authors: KelseyRegan cancan101 ide mkonicek waleedarshad-vf


text:
[standard][perf] Convert CJS requires in react-native-implementation to ES imports/exports

(Note: this depends on a Metro PR landing first in order for the iOS E2E tests to pass. Everything else works.)
Summary
This is the first step towards converting RN to use ECMAScript modules (ESM) instead of CommonJS modules. Most of RN can be converted in a straightfoward manner, but the react-native-implementation entry point uses getters containing lazy require calls. This commit is one of two parts to move to JS modules while preserving the lazy require behavior. The second part is in metro-react-native-babel-preset.
This commit changes all of the require calls in react-native-implementation.js to export from statements. Some of the old require calls had deprecation warnings in their enclosing getters -- these warnings are now in the deprecated modules themselves. (AlertIOS is one exception since is is a deprecated alias for Alert. We could add an intermediate AlertIOS.js file that prints the warning but I opted to keep the getter for this one module since we are removing it anyway.)
The Metro side of this conversion enables the lazy option for @babel/plugin-transform-modules-commonjs when any of the RN modules are required. This means that lazy require calls in react-native-implementation are preserved out of the box. (And if you specify lazyImportExportTransform: true, all imports are lazy and there's no change in behavior.)
Changelog
[General] [Changed] - Converted public exports from CJS to ES exports. import ReactNative from 'react-native' is superseded by import * as ReactNative from 'react-native'.
Callers that use require('react-native') or import { ... } from 'react-native' don't need any changes.
Test Plan
Opened RNTester and verified it loaded without an error. Tapped on several of the test screens. Also got yellow box warnings for the deprecated modules, since RNTester loads them.
Locally changed RNTester to be a very simple app that just displays a string. Verified the synthetic default export still works with require() and that no deprecation warnings were displayed because only non-deprecated components were used and the imports are lazy:
const React = require('react');
const ReactNative = require('react-native');
const {AppRegistry, StyleSheet, Text, View} = ReactNative;

Also double-checked that the Metro Babel preset preserves lazy require calls in react-native-implementation.js by looking at the code in the bundle:
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
  'use strict';

  var _interopRequireDefault = _$$_REQUIRE(_dependencyMap[0], "@babel/runtime/helpers/interopRequireDefault");

  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  Object.defineProperty(exports, "AccessibilityInfo", {
    enumerable: true,
    get: function get() {
      return _AccessibilityInfo().default;
    }
  });

  // ... (one defineProperty call with a deferred getter for each export)

  var _extends2 = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1], "@babel/runtime/helpers/extends"));

  function _AccessibilityInfo() {
    var data = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[2], "AccessibilityInfo"));

    _AccessibilityInfo = function _AccessibilityInfo() {
      return data;
    };

    return data;
  }

  // ... (one lazy, memoized function for each import)

  (0, _extends2.default)(exports, 'AlertIOS', {
    get: function get() {
      var warnOnce = _$$_REQUIRE(_dependencyMap[94], "warnOnce");

      warnOnce('alert-ios', 'AlertIOS is deprecated. Use the `Alert` module directly instead.');
      return _$$_REQUIRE(_dependencyMap[46], "Alert");
    }
  });
},317,[1,13,318,319,357,367,451,452,454,413,432,455,457,458,459,461,462,468,470,511,513,355,515,493,420,437,517,519,521,417,523,524,528,368,530,537,373,482,380,381,442,341,538,414,539,542,264,382,543,307,312,314,553,554,555,324,323,409,277,477,556,390,423,424,316,249,557,526,268,322,558,559,560,561,321,183,562,563,315,280,500,564,491,250,273,187,229,299,344,565,327,370,566,483,313],"Libraries/react-native/react-native-implementation.js");

@ide now that the Metro PR landed, I assume you can publish this PR, right? I assume before we can land this, we'll need to publish metro and update the CLI?

Oh, and also: could you show me what a compiled version of react-native-implementation.js looks like with this change?

we'll need to publish metro and update the CLI

FYI @cpojer I'm publishing Metro v0.53.1 today.

@cpojer @motiz88 Before we can land this PR, we'll need to update RN's transitive dependencies on the Babel preset. It's more complicated than I expected:
[1/4] 🤔  Why do we have the module "metro-react-native-babel-preset"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "metro-react-native-babel-preset@0.52.0"
info Reasons this module exists
   - "metro-react-native-babel-transformer" depends on it
   - Hoisted from "metro-react-native-babel-transformer#metro-react-native-babel-preset"
info Disk size without dependencies: "72KB"
info Disk size with unique dependencies: "996KB"
info Disk size with transitive dependencies: "15.32MB"
info Number of shared dependencies: 71
=> Found "@react-native-community/cli#metro-react-native-babel-preset@0.51.0"
info Reasons this module exists
   - "@react-native-community#cli#metro-react-native-babel-transformer" depends on it
   - Hoisted from "@react-native-community#cli#metro-react-native-babel-transformer#metro-react-native-babel-preset"
info Disk size without dependencies: "40KB"
info Disk size with unique dependencies: "944KB"
info Disk size with transitive dependencies: "15.29MB"
info Number of shared dependencies: 71
=> Found "metro#metro-react-native-babel-preset@0.51.1"
info This module exists because "@react-native-community#cli#metro" depends on it.
info Disk size without dependencies: "40KB"
info Disk size with unique dependencies: "944KB"
info Disk size with transitive dependencies: "15.29MB"
info Number of shared dependencies: 71

One way to test whether things are working are to verify the tests pass (currently they don't).

could you show me what a compiled version of react-native-implementation.js looks like with this change?

The larger code snippet in the PR description is the transformed react-native-implementation.js with the new Babel preset.

Currently working on upgrading Metro in the CLI, and then upgrading the CLI in the RN repo so that we can continue on this PR. Will get back to you when it's ready.

@ide Upgraded the CLI to 2.0 which should come with the latest Metro. I think you should be unblocked now.

@cpojer Thanks -- rebased and updated. Tests are now passing on iOS.

Update: I have this working internally at FB but for some reason, even though lazyImportExportTransform is always true, the lazy exports aren't being applied. It will take me a bit of time to figure out why that may be.

Hey @ide. I'm sorry it took so long to figure this one out. The problem is that our internal setup with Metro doesn't work with this change and I have been unable to figure it out at this time.
Given other priorities it doesn't look like I'll get back to this one within the next two months. I propose closing this and trying to solve the internal fb problem over the next couple of months by only converting a single import to start. I'll see if @rubennorte has some time to help us out on this :)

authors: cpojer ide motiz88


text:
add ripple config object to Pressable

Summary
Motivation is to support ripple radius just like in TouchableNativeFeedback, plus borderless attribute. See https://github.com/facebook/react-native/pull/28009#issuecomment-589489520
In the current form this means user needs to pass an android_ripple prop which is an object of this shape:
export type RippleConfig = {|
  color?: ?ColorValue,
  borderless?: ?boolean,
  radius?: ?number,
|};

Do we want to add methods that would create such config objects - https://facebook.github.io/react-native/docs/touchablenativefeedback#methods ?
Changelog

[Android] [Added] - support borderless and custom ripple radius on Pressable
Test Plan
Tested locally in RNTester. I noticed that when some content is rendered after the touchables, the ripple effect is "cut off" by the boundaries of the next view. This is not specific to Pressable, it happens to TouchableNativeFeedback too but I just didn't notice it before in https://github.com/facebook/react-native/pull/28009. As it is an issue of its own, I didn't investigate that.

I changed the Touchable example slightly too (I just moved the "custom ripple radius" up to show the "cutting off" issue), so just for completeness:

Heads up @kikisaints that we are working on landing this change to the Pressable API.

authors: TheSavior vonovak


text:
Bump Xcode to 12.1.0

Summary:
Upgrade the version of Xcode used in Circle CI to Xcode 12.1.0, and target iOS 14.1 in tests.
Reference:

Circle CI Xcode 12.1 container manifest (new version):
https://circle-macos-docs.s3.amazonaws.com/image-manifest/v3985/index.html
Circle CI Xcode 11.6.0 container manifest (previous version): https://circle-macos-docs.s3.amazonaws.com/image-manifest/v3299/index.html

Source: https://circleci.com/docs/2.0/testing-ios/#supported-xcode-versions

The default version of CocoaPods used in the Xcode 12.1 container image has changed. Use bundle exec with pod install to ensure we use the same version of CocoaPods as prescribed in the Gemfile.
Changelog:
[iOS][Changed] - Update iOS project template for Xcode 12.1.0
[Internal] Bump Xcode version used for iOS tests.
Differential Revision: D24545010

This is an export of an internal diff. The internal diff has been approved, but we're blocked until Xcode 12.1.0 has finished rolling out to our internal CI.


text:
Add melihmucuk to Github Issue Task Force

Here we go !

By analyzing the blame information on this pull request, we identified @mkonicek and @ryankask to be potential reviewers.

Thanks for helping! 👍
We have a small guide to get started:
https://github.com/facebook/react-native/blob/master/docs/IssueGuidelines.md
@facebook-github-bot shipit

Thanks for importing.


text:
poor (and non-idempotent) formatting of comments in arms of conditionals

refmt converts
let to_signed (unsigned, i, ptr) =>
  if (area unsigned i == 3) {
    None
  } else {
    /* not representable as signed */
    Some (false, i, ptr)
  };

to
let to_signed (unsigned, i, ptr) =>
  if (area unsigned i == 3) {
    None
  } else {
    Some
      /* not representable as signed */
      (false, i, ptr)
  };

The comment really should not get stuffed between the constructor and its arguments.

There is also non-idempotent formatting nearby:
let to_signed (unsigned, i, ptr) =>
  if (area unsigned i == 3) {
    None
  } else /* not representable as signed */ {
    Some (false, i, ptr)
  };

formats to
let to_signed (unsigned, i, ptr) =>
  if (area unsigned i == 3) {
    None
  } else {
    /* not representable as signed */
    Some (false, i, ptr)
  };

which formats to
let to_signed (unsigned, i, ptr) =>
  if (area unsigned i == 3) {
    None
  } else {
    Some
      /* not representable as signed */
      (false, i, ptr)
  };

Fixed.

authors: chenglou jberdine

repo: facebook/reason


text:
Don't remove semis in blocks inside ternary expressions as jsx children

Fix https://github.com/facebook/reason/issues/2349

Cc @bobzhang

@chenglou Looks great, can we have this fix upstreamed ? thanks

Thank you @IwanKaramazow !

authors: IwanKaramazow bobzhang chenglou jordwalke


text:
Clarify goals with webpack (in)dependence

In #90, regarding support for webpack's native support for css modules, @gaearon says:

We might want to migrate away from webpack in the future. We’d need to make our CSS files are as vanilla CSS as possible (aside from minor stuff like relative dependency paths).

and:

Having to back out of infrastructure changes (e.g. super fast new bundler) because people relied on webpack in ways like this would be super sad.

However, there are still a ton of other webpack-isms. Some, like require.ensure for code splitting, will probably be banned now that I've drawn your attention to them. But others, like import logo from './logo.svg' or import './App.css' are not only permitted but are part of the boilerplate.
I understand that the purpose of this config is to completely abstract Babel/ESLint/webpack configuration from users, and allow for tooling to change mostly independently from app code. I also understand that some webpack-isms, like image and non-modular CSS loading, are extremely useful for React development.
But CSS modules and dynamic loading/code splitting are also very useful; a decision has been/will be made made that their use does not outweigh the costs. Meanwhile, import logo from './logo.svg' isn't strictly necessary -- images and CSS could be in a static/ directory that gets served by the dev server and bundled in the build -- but this project has chosen the more ergonomic approach, even though it couples the project to webpack-specific implementation.
Obviously you have to find a sweet spot between no webpack-isms (if you do that, why even bother?) and all webpack-isms (because that impedes you from using any other tools, and even webpack might drop support for these). So how do you do it? What are your heuristics?

Things like require.ensure but those tend to be used more sparingly than CSS (which is basically half of the project files). They aren't as painful to migrate away from as custom syntax extensions to CSS, I think.
If we add more JS tools they aren't going to fail because of require.ensures. Webpack overloads some semantics here but it's still a JS function call.
CSS Modules is much more involved. If you look around PostCSS repos, you'll find tens of unsolved issues related to CSS Modules support, for example. I'm not saying we plan to use PostCSS more extensively, but we don't want this to lock ourselves out of this, or to have to figure out how to fix many issues caused by overloading of CSS semantics with custom syntax.
Ultimately our current usage of CSS files is a compromise. We would like to eventually move to a way to represent styles in JS instead. This is a longer term goal and it will take a while before we have something we can recommend to people. But we think this is a better solution to encapsulating styles than a custom syntax extension to CSS.
Since we can't reach this goal, we want to at least leave the door open for it. It seems to me that, the closer our files to vanilla CSS, the easier it will be to automatically codemod them to JS someday if we decide to proceed with moving into that direction. Custom extensions make this harder in my opinion but maybe I'm wrong.
Then why do we even use the Webpack way of importing CSS into components? Again, practical reasons:

We want to have at least some knowledge about which CSS files are associated with which components in case we want to codemod CSS usage later.
This automatically integrates those files into Webpack build system so it puts right content hashes on output files. This tool has an explicit goal of being suitable for production, and we can't ask users to run additional "revving" tasks. This nicely sidesteps the problem.
This gives us hot reloading of CSS in development which is super convenient.

To sum up:

We prefer conventions to custom syntax
We don't know which tools we will support in the future so we don't want to introduce more potential incompatibilities
We think the real solution to encapsulation is using JavaScript primitives (modules), not custom syntax in CSS
We want to use patterns practical in production apps so our users don't need to worry about hashes and stuff
We are okay with suboptimal patterns that are relatively easy to codemod away from

I understand if you disagree with some of these points. Like everybody, we are exploring this space, and we need to make some decisions. We might eventually change our minds but for now we decided we care about specifying JS <-> asset dependencies but want assets to stay as vanilla as possible. I hope this helps.

Hope this helps! I’ll close as non actionable.

I wish I'd found this issue earlier. It's a wonderfully succinct explanation of your design goals, @gaearon, and to me totally refutes the arguments for adding Sass/cssnext over in #78, and puts big question marks over the compatibility of the PostCSS ecosystem with this project, CSS Modules included.
You've given me lots to think about!

Ultimately our current usage of CSS files is a compromise. We would like to eventually move to a way to represent styles in JS instead. This is a longer term goal and it will take a while before we have something we can recommend to people. But we think this is a better solution to encapsulating styles than a custom syntax extension to CSS.

Since we can't reach this goal soon, we want to at least leave the door open for it. It seems to me that, the closer our files to vanilla CSS, the easier it will be to automatically codemod them to JS someday if we decide to proceed with moving into that direction. Custom extensions make this harder in my opinion but maybe I'm wrong.

This seems like an odd goal for a "create react app" project.
As with probably everyone else, I found @vjeux's "CSS-in-JS" talk extremely interesting, and I think there are a lot of benefits to exploring this space of extra CSS tooling.
That's very different from saying "the starting point for creating a React app is to also throw away everything you know about styling and instead use CSS-in-JS".
I think it would dramatically reduce the usability of this tool if it took such an opinionated approach to styling, especially given that said approach would be extremely unconventional.
Doing something like dropping CSS here and codemodding everyone's CSS to JS would be more than a recommendation – it would essentially be an imposition if this tool takes off as the standard entry point for new people into the ecosystem, and would make creating a React app less approachable.

Also, judging by the current crop of encapsulated styling solutions floating around, the biggest challenging to automatically converting CSS to one of the encapsulated styling systems is that there's no obvious way to represent vanilla CSS selectors like .btn-toolbar > .btn – I'm not aware of any ways to directly represent that in any of the encapsulated styling systems I've seen.

@taion at this point you seem to be repeating yourself. Your goals for this project clearly differ from those who maintain it and if they're not convinced by your 25 (!!) comments in #78 I doubt they will be now. I consider it to be as simple as this

React, Babel, Webpack, Eslint, etc, are all stable enough that a single project with no customisation can now support a good chunk of the use-cases & get people building real apps. For use cases beyond that, there is eject.
Nothing in CSS is clearly the "winner" yet, therefore don't adopt anything for the time being (except introduce per-component styling which is definitely going to form part of the solution). If you need something else, there is eject.

There are already a multitude of React starter projects out there with Sass/PostCSS/CSS Modules etc enabled. This project is a week old.
I for one think the design (and adherence to a policy of nothing configurable/optional) is inspiring. Imagine if someone "solved" component-based CSS as well as React solves component-driven UI development. Let's go work on that instead.

I think it would dramatically reduce the usability of this tool if it took such an opinionated approach to styling, especially given that said approach would be extremely unconventional.

At some point we think React itself might take an opinionated approach to styling. If it ever does, we will recommend it here because having so many options is confusing and not very composable.
Until it does, we don’t want to artificially “bless” the existing non-vanilla-CSS options by supporting them (rather than their alternatives) here.

Until it does, we don’t want to artificially “bless” the existing non-vanilla-CSS options by supporting them (rather than their alternatives) here.

This seems like saying "Because we haven't yet reinvented CSS in React we are going to ignore the last 5 years of best practices, improvements and common choices made by most web developers". Not to harp on a point but this is exactly the sort of thing folks from outside the React community face palm and shake their head about, a seemingly tone deafness to how web development works outside the bubble of bleeding edge React innovations.
If React isn't going to have its own special solution then it should at least support some of the things the majority of modern web developers use now and not tell them to do something actively bad like use "plain css". If anything we should at least look at how successful versions of these tools in other communities work and copy them, which may be not to bless stuff but not make it tough to drop in one of the two main choices most folks will use.

We are going to reevaluate this choice after a little while. There are other high priority issues to sort out before we can get to a 1.0 that we can link from React docs. 😉

authors: gaearon geelen jquense modernserf taion

repo: facebookincubator/create-react-app


text:
Look at why Space in py_modules path breaks ptr

Thanks for logging an issue with ptr. Here are some questions to help try
and pull out as much information possible to help us help you!
How is ptr not doing what you expect?
I would of expected pathlib to handle this

Also, work out why we're not running from venv code for py_modules (might handle this better)

What is your suggestion to make this better?
Unfortunately support spaces or see why pathlib does not.
Code/Bug example?
/tmp/workspace/PYTHON ptr_terragraph_ansbible/nmap_to_scuba/nts.py                    143     75    48%   36-41, 80-87, 107-130, 136-170, 178-196, 239-255, 259
/tmp/workspace/PYTHON ptr_terragraph_ansbible/nmap_to_scuba/nts_tests.py               29      0   100%
/tmp/workspace/PYTHON ptr_terragraph_ansbible/nmap_to_scuba/nts_tests_fixtures.py       4      0   100%
-----------------------------------------------------------------------------------------------------------------
TOTAL                                                                               10381   7339    29%
[2019-02-19 16:26:05,058] ERROR: Unable to find path relative path for /tmp/workspace/PYTHON (ptr.py:147)
[2019-02-19 16:26:05,059] ERROR: Unable to find path relative path for /tmp/workspace/PYTHON (ptr.py:147)
[2019-02-19 16:26:05,059] ERROR: Unable to find path relative path for /tmp/workspace/PYTHON (ptr.py:147)

Traceback (most recent call last):
  File "/tmp/ptr_terragraph_ansible/bin/ptr", line 11, in <module>
    sys.exit(main())
  File "/tmp/ptr_terragraph_ansible/lib/python3.6/site-packages/ptr.py", line 880, in main
    args.stats_file,
  File "/usr/lib/python3.6/asyncio/base_events.py", line 467, in run_until_complete
    return future.result()
  File "/tmp/ptr_terragraph_ansible/lib/python3.6/site-packages/ptr.py", line 813, in async_main
    stats_file,
  File "/tmp/ptr_terragraph_ansible/lib/python3.6/site-packages/ptr.py", line 761, in run_tests
    await asyncio.gather(*consumers)
  File "/tmp/ptr_terragraph_ansible/lib/python3.6/site-packages/ptr.py", line 547, in _test_runner
    print_cov,
  File "/tmp/ptr_terragraph_ansible/lib/python3.6/site-packages/ptr.py", line 500, in _test_steps_runner
    stats,
  File "/tmp/ptr_terragraph_ansible/lib/python3.6/site-packages/ptr.py", line 171, in _analyze_coverage
    if coverage_lines[afile].cover < cov_req:
KeyError: 'nts.py'

How can a developer reproduce this?
Add a unittest with a path to some code with a space in it.

So this fails because I was lazy and parsed the human output of coverage as it made some thing easier for me. I use split on white space, and get all the coverage output as one str due to using maxsplits. Only way I can see how to sanely fix this is to parse the XML and reconstruct the output from the XML.

it might be easier to just parse stdout with a simple regex that expects some number of numeric fields, and capture everything before the first numeric field (minus trailing whitespace) as the filename.

authors: cooperlees jreese

repo: facebookincubator/ptr


text:
macos-build-macos-m1 CI build is failing

Problem description
Build is failing with the following errors
/Users/distiller/project/velox/dwio/dwrf/reader/SelectiveStringDirectColumnReader.cpp:143:35: error: use of undeclared identifier '_mm256_extracti128_si256'
auto y = _mm256_castsi128_si256(_mm256_extracti128_si256(x, 1));
^
/Users/distiller/project/velox/dwio/dwrf/reader/SelectiveStringDirectColumnReader.cpp:151:3: error: static_assert failed due to requirement 'vlength.size == 8'
static_assert(vlength.size == 8);
^             ~~~~~~~~~~~~~~~~~
/Users/distiller/project/velox/dwio/dwrf/reader/SelectiveStringDirectColumnReader.cpp:159:16: error: use of undeclared identifier '_mm_slli_si128'
vlength16 += _mm_slli_si128(vlength16, 2);
^
/Users/distiller/project/velox/dwio/dwrf/reader/SelectiveStringDirectColumnReader.cpp:160:16: error: use of undeclared identifier '_mm_slli_si128'
vlength16 += _mm_slli_si128(vlength16, 4);
^
/Users/distiller/project/velox/dwio/dwrf/reader/SelectiveStringDirectColumnReader.cpp:161:16: error: use of undeclared identifier '_mm_slli_si128'
vlength16 += _mm_slli_si128(vlength16, 8);
Looks related to https://github.com/facebookincubator/velox/pull/7044
System information
It's our Circle CI macoso-m1 build e.g.
https://app.circleci.com/pipelines/github/facebookincubator/velox/35928/workflows/470201a7-6d63-4655-b00a-f8d976ac90c8/jobs/237761
CMake log
No response

https://github.com/facebookincubator/velox/pull/7093

repo: facebookincubator/velox