text:
MapRoulette: Allow working on a specific hidden challenge

Description
I tend to set MapRoulette Challenges to "invisible" whenever I want to test them but also when I only want to work on them with a specific group of people.
However, it looks like there is no way to access a non-public challenge in Rapid.
(Right now, 45242 is public again, to allow testing it.)

I was hoping for something like …

When no challenge ID is given, show all public challenges
Wen a specific challenge ID is given, show that one regardless of it's public state

I've asked the MapRoulette devs what they think of allowing this little override, I'm in favor.

authors: Bonkles tordans

repo: facebook/Rapid

license: ISC


text:
Move tool rubberbanding

Description
When using the move tool to relocate a feature, the feature is offset from the mouse pointer, and it rubberbands as it follows the mouse pointer, making it difficult to move objects precisely. When you select a feature, right click, and select the move tool, the feature will try to maintain the same distance from the mouse cursor as the distance between where you right clicked and where you clicked to select the move tool. When you move the mouse, the object tries to follow the cursor, but the offset is elastic. The object movement will hitch and lag, then accelerate toward the cursor and over shoot. Sometimes it gets completely stuck for a second or two, then jumps to the cursor. This unpredictable movement makes positioning features precisely annoying. This occurs with all 3 types of geometry.
Screenshots
https://github.com/user-attachments/assets/78293a21-575d-47b0-b893-3d428ea8a24f
https://github.com/user-attachments/assets/fae88e32-902f-4fdd-b552-21676ef607ef
Version
2.4.0-pre.0
What browser are you seeing the problem on? What version are you running?
Firefox v130.0
The OS you're using
mac
Steps to reproduce

Select a feature
right click to open context menu
select the move tool
move cursor
moving the cursor at different speeds produces variations in behavior.

The browser URL at the time you encountered the bug
https://rapideditor.org/canary#map=19.54/39.07587/-108.48348&background=MCGIS-County-Valleywide-Imagery-2024&datasets=fbRoads,msBuildings&disable_features=boundaries&id=n-1
The auto-detected useragent string for your browser (leave blank if you're manually filling this form out)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:130.0) Gecko/20100101 Firefox/130.0

I agree that frame rate looks pretty bad.  I see you've got a really huge screen too, so I imagine the GPU is working pretty hard to draw everything.   I do wonder whether Chrome might perform better?

I did some profiling of the code and tried editing and moving features around #map=19.54/39.07587/-108.48348 but I didn't see anything obviously bad, and it performed pretty ok for me on Chrome 128, though it could be better.
https://github.com/user-attachments/assets/bc740a0c-a41a-43ab-8c9f-e995e6f82427
It looks like you're experiencing similar slowdowns from #1145 .
You might have some luck trying the suggestions on that issue about changing the WebGL backend (whether Firefox is using Metal, I don't know).

Thanks for looking into the issue! I will try to find some time to do a little more experimenting and check out some of the suggestions. Just from day to day experience, I do feel like the current version of Rapid performs better in Chrome. I have also experienced other memory/render intensive applications struggling more in Firefox.

source: gharchive/issue

license_type: permissive

license_source: github-api


text:
Cron schedule not working?

The Cron schedule with specific date and time (runs only once) does not seem to be working for me (maybe configuration issue?)  Here is my configuration:
{
  "bistro_settings": {
    "resources": {
      "instance": {"concurrency": {"limit": 10, "default": 1}},
      "level1": {
        "my_resource": {"limit": 3, "default": 0}
      }
    },
    "nodes": {
      "levels": ["level1", "level2"],
      "node_sources": [{
          "source": "manual",
          "prefs": {
            "node1": []
          }
        }, {
          "source": "add_time",
          "prefs": {
            "parent_level": "level1",
            "schedule": [{
                "cron": {
                  "year": 2017,
                  "month": 5,
                  "day_of_month": 3,
                  "hour": 7,
                  "minute": 15,
                  "dst_fixes": ["unskip", "repeat_use_only_early"]
                },
                "lifetime": 50
              }
            ]
          }
        }
      ]
    },
    "enabled" : true
  },

  "bistro_job->job1" : {
    "owner" : "test",
    "enabled" : true,
    "command" : ["/path/to/task_script.sh"],
    "priority": 2,
    "resources": {
      "my_resource": 1
    }
  }
}

However, if I change the schedule item to epoch, then it works right away:
{
"cron": {"epoch": {"period": 60}},
"lifetime": 20
}
Could you give a working Cron example, please?  Thank you.

I tried your example, and it works fine, with one caveat. Did you know that lifetime has a unit of seconds? If you change it to 500000, you should start seeing a node named 1493820900. As written, it would only be possible for your task to start your within that time window of 50 seconds.
After 50 seconds, that node would cease to exist, and no job would be able to run tasks against it.
I'm currently on vacation, but once back I'll put up a change to rename the fields to lifetime_sec and enabled_lifetime_sec. Or feel free to send a pull request if you have a moment. I'd just ask that you also add a kLifetimeSec and kEnabledLifetimeSec to the end of bistro/config/Config.h to be used instead of hardcoded string constants (and of course run unit tests).
I also see that two of the libraries Bistro depends on have build breakages. Sorry about that. I'll look into it once I'm back.
Please reopen the issue if my diagnosis is incorrect.

repo: facebook/bistro

license: mit

license_source: bigquery


text:
npx command not found

I am trying to create the react app but whenever I am trying to do so, a message always pops out that npx command is not found. What should I do in this situation?

I am trying to create the react app but whenever I am trying to do so, a message always pops out that npx command is not found. What should I do in this situation?

Try this https://stackoverflow.com/questions/49894620/npx-command-not-found

repo: facebook/create-react-app

license: MIT


text:
Unable to install/run create-react-app

Is this a bug report?
(yes)

Did you try recovering your dependencies?
No as a rollback was executed by the install

(Write your answer here.)
Which terms did you search for in User Guide?

(Write your answer here if relevant.)
Environment
iSeries/node.js

(paste the output of the command here)
Steps to Reproduce

-bash-4.4$ npm init react-app todolist
npx: installed 63 in 7.294s
Creating a new React app in /home/RODIUSD/node_pj/todolist.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for internal-ip@3.0.1: wanted {"os":"android,darwin,freebsd,linux,openbsd,sunos,win32","arch":"any"} (current: {"os":"aix","arch":"ppc64"})
npm ERR! notsup Valid OS:    android,darwin,freebsd,linux,openbsd,sunos,win32
npm ERR! notsup Valid Arch:  any
npm ERR! notsup Actual OS:   aix
npm ERR! notsup Actual Arch: ppc64
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/RODIUSD/.npm/_logs/2019-02-21T06_51_13_953Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts has failed.
Deleting generated file... node_modules
Deleting generated file... package.json
Deleting todolist/ from /home/RODIUSD/node_pj
Done.
-bash-4.4$
Expected Behavior

an installation completed message
Actual Behavior

Rollback due to an dependecy
Reproducible Demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

Could package be adapted to use the latest internal-ip@4.0.0
This version seems to support AIX as os


text:
Add custom-templates to docs sidebar

Fixes #8074.

Hmm.  Has the docs site not been redeployed?  I don't see it in the published site yet.

Just deployed @markerikson :smiley:

source: gharchive/pull-request

authors: ianschmitz markerikson


text:
Can't seem to apply prop constraints via ReactClass<>

I'm trying to specify the type of components I'm importing from a module, have reduced down to this simple case:
This correctly fails the type check due to missing prop
/* @flow */
/* eslint-env browser */
import React from "react";
import ReactDOM from "react-dom";

class App extends React.Component {
  props: { required: mixed };
}

ReactDOM.render(
  <App />,
  document.getElementById("app")
);

// temp.js:7
//   7:   props: { required: mixed };
//               ^^^^^^^^^^^^^^^^^^^ property `required`. Property not found in
//  11:   <App />,
//        ^^^^^^^ props of React element `App`

This next example simulates applying a type to a foreign component, it does not error:
/* @flow */
/* eslint-env browser */
import React from "react";
import ReactDOM from "react-dom";

class App extends React.Component {
  props: { required: mixed };
}
const App2: any = App;
const App3: ReactClass<{required: mixed}> = App2;

ReactDOM.render(
  <App3 />,
  document.getElementById("app")
);

Same problem. Seems flow do not checking ReactClass at all

ReactClass is pretty broken, yes. Will fix.

Is there any chance this could be fixed soon?  Very real bugs are being ignored by ReactClass not actually checking anything.

@ForbesLindesay what is your use case?

The use case is for higher order components:
type PropsProvidedByConnect = {
  // ...some list of props...
};
type PropsRequiredByConnect = {
  // ...some list of props...
};
function connect<ComponentProps>(
  Component: ReactClass<ComponentProps & PropsProvidedByConnect>,
): ReactClass<ComponentProps & PropsRequiredByConnect> {
  // return a wrapper component that passes through any un-recognised properties,
  // and also adds some extra properties and uses some properties directly.
}

I use this kind of pattern pretty frequently for data fetching.

This seems to be fixed as of Flow 0.53, which changed the ways prop types are tracked on Component classes. If I make minor changes to the original code above, it gives a type error as expected:
/* @flow */
/* eslint-env browser */
import * as React from "react";
import * as ReactDOM from "react-dom";

class App extends React.Component<{required: mixed}, *> {
}
const App2: any = App;
const App3: React.ComponentType<{required: mixed}> = App2; // Correctly gives type error here

ReactDOM.render(
  <App3 />,
  document.getElementById("app")
);

authors: ForbesLindesay asolove avikchaudhuri glenjamin nanot1m vkurchatkin

repo: facebook/flow


text:
Self-require in spread assignment causes object type to be any

M.js
// @flow
const obj = { ...require('./M') };
(obj: string); // cast to whatever
(obj.x);         // any prop, etc.

This is intentional. A self require is any and then spreading any will make the result any 👍

authors: bhosmer calebmer


text:
Types not inferred in a in-line function in a conditional

Example here.
I expected the function thisFails to run without a problem because if quux.type equals "FOO" then bar must be type { baz: string }. There is no way (that I know of) to run func and have bar be type string. If
This error also occurs with switch statements. I'm assuming this issue persists with any conditional.
The function thisDoesnt used a simple workaround. It's odd that flow complains about thisFails but not thisDoesnt , I would think that the outcome of those functions would be practically the same.
It seems like autocomplete works fine though. See here.
I originally came across this problem using Redux reducers. I was trying to use the map function in a switch statement. You can see the full example here.
I know this is a weird edge case that's probably very difficult to fix, but I thought I would report the issue.

The examples work now.

authors: darichey ocboogie


text:
Add support for type parameters to anonymous class expressions

This is done by unifying the parsing logic for class expressions and
class declarations, since anonymous class declarations already suppoted
type arguments.
Fixes https://github.com/facebook/flow/issues/3567

Hi, this is my first PR :slightly_smiling_face:
I was hit by this bug while working on a personal project and I tought that it was a great opportunity to learn something new.
I have some problems running the tests locally: if I run make && make js and then make test in the src/parser folder, for some reason it doesn't consider my changes to the code. I double-checked by deleting whole sections of the parser files both nothing changed :confused:.
I tested my changes using echo "(class <T> {});" | bin/flow ast | prettier, so I'm not sure yet that this PR didn't break anything. I'll wait for the CI result.

/сс @gabelevi or @mroch

Oh, this is cool @dsainati1

authors: goodmind mrkev nicolo-ribaudo


text:
Doubt about Min/Max functions

Right now:
Immutable.Set.of(10, null).min() returns null
Immutable.Set.of(10, null).max() returns 10
Immutable.Set.of(10, NaN).min() returns NaN
Immutable.Set.of(10, NaN).max() returns NaN
I know we're using js for comparison, but the result seems somehow unexpected. Just wanted to bring this to attention, because it seems that the strategy to ignore nulls and NaNs for min e max seems legit for all cases, right? I mean that, if, most user code would tend to .filter null/NaN before calling min/max, isn't better to put the extra check inside min/max?
I know it's ok to continue letting NaN poison all operations, and let the user ensure correct values or filter null, etc. Just a comment, because data structure libraries can avoid bugs with decisions like these.
[]'s

> Math.min(10, null)
< 0

Even if the idea is to mimic Math.max and Math.min, it seems like there's a bug in your first example. It would appear that the candidate values should be converted to a number before comparison.

The idea would not be to mimic default Math.max e Math.min. I consider currrent Immutable behaviour to be better. The question is if it's better to return filter only numbers for max/min (outcome of 10 in the examples I wrote before)

Immutable.js hopes to mirror Math.min/max behavior as far as ordering goes, though min/max for collections may be comparing things other than numbers, which is why the return values are not the same as Math.min/max - those methods always coerce to numeric values to compare where Collection min/max does no numeric coercion.
It is intentional that NaN is poisonous as it's meant for error propagation. NaN is usually a surprising value and you don't want to mask over errors by default - but instead handle them explicitly when they're possible.

authors: leebyron pedroteixeira samwgoldman

repo: facebook/immutable-js


text:
Can not sort

    let test = [{k: [{ink: "b"}, {ink: "a"}]}];
    let sortedTest = Immutable.fromJS(test);
    sortedTest.map(c => {
      let sorted = c.get('k').sort((a, b) => {
        if (a.get('ink') < b.get('ink')) {
          return -1;
        } else {
          return 1;
        }
      });
      console.log(sorted.toJS());
      return sorted;
    });
    console.log(sortedTest.toJS());

I expected sortedTest to be:
[{k: [{ink: "a"}, {ink: "b"}]}]

Sorry, I have not set sortedTest on return


text:
Error when user infer with clang

We can see:

cmd: clang -c main.m
clang works.

cmd: infer run -- clang -c main.m
it occur a error.

main.m code:
#import <Foundation/Foundation.h>

int main(int argc, const char * argv[]) {
    @autoreleasepool {
        // insert code here...
        NSLog(@"Hello, World!");
    }
    return 0;
}

infer v0.13.0
Mac 10.13.2 (17C88)
clang -v
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

@facebook-github-bot

Which version of mac os infer support?

@dulmarod
I think that maybe infer-v0.13.0/lib/infer/facebook-clang-plugins/clang  cant not find the "Fundation.h" which is in the Xcode.
any idea?

I find that on x86_64-apple-darwin16.8.0, infer-clang-v5.0.0 will find the "Fundation.h"  at "/System/Library/Frameworks/Foundation.framework/Versions/C/Headers", but on x86_64-apple-darwin17.3.0, there is not "/System/Library/Frameworks/Foundation.framework/Versions/C/Headers", only have "/System/Library/Frameworks/Foundation.framework/Versions/C/Resources" and something else.
so, i want to know Which version of mac os infer support?

Not sure if that's the issue, but you can try installing the command line tools: xcode-select --install.

repo: facebook/infer


text:
[Bug]: Jest 28.x.x doesn't work with node 19

Version
28.1.3
Steps to reproduce
Have node 19.x installed and run npx jest
Expected behavior
Tests run successfully
Actual behavior
For each test suite I get
 ● Test suite failed to run

    TypeError: Cannot assign to read only property 'performance' of object '[object global]'

      at Object.<anonymous> (node_modules/react-native/jest/setup.js:419:20)
      at asyncGeneratorStep (node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
      at _next (node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)

Additional context
The problem is in the following lines in jest/setup.js
global.performance = {
  now: jest.fn(Date.now),
};

If they are removed, Jest works as expected. Alternatively, downgrading to Node 18 resolves the issue as well.
Environment
System:
    OS: macOS 12.6
    CPU: (10) arm64 Apple M1 Pro
  Binaries:
    Node: 19.0.1 - /opt/homebrew/bin/node
    npm: 8.19.2 - /opt/homebrew/bin/npm
  npmPackages:
    jest: 28.1.3 => 28.1.3

This was fixed in https://github.com/facebook/jest/releases/tag/v29.2.1 - there are no plans to backport this to v28

authors: SimenB madandrija

repo: facebook/jest


text:
Expose "testPath" for "setup*File"

Feature request
What is the current behavior?
Currently, testPath is passed to JasmineReporter (https://github.com/facebook/jest/blob/v18.1.0/packages/jest-jasmine2/src/index.js#L37). However, it's quite tricky/unsafe to access it in setupFile/setupTestFrameworkScriptFile (to use in custom reporters for example):
function getTestPath() {
  if (Symbol && typeof Symbol.for === 'function') {
    var globalStateKey = Symbol.for('$$jest-matchers-object');
    if (globalStateKey) {
      var globalState = global[globalStateKey];
      if (globalState) {
        var state = globalState.state;
        if (state) {
          return state.testPath;
        }
      }
    }
  }
}

It'd be great if testPath would be exposed in more standard way. Thanks.

I'd love to have access to as much relevant info about the currently executing test(s) as possible.

We prefer not to expose this there. If you need custom setup, use beforeAll in your specific test file.

authors: cpojer cpsubrian segrey


text:
Error: Attempted to send a message to the worker before the response from the last message was received!

Getting this error which has probably some origins from jest-cli:
 FAIL  components/__jest__/TabbedPanel.cjsx
Error: Attempted to send a message to the worker before the response from the last message was received! Worker processes can only handle one message at a time.
/home/xxx/node_modules/gulp-jest/node_modules/jest-cli/node_modules/node-worker-pool/Worker.js:106
    throw new Error('Received unexpected data from child process: ' + data);
          ^
Error: Received unexpected data from child process: {
  "error": "TypeError: Cannot read property 'length' of undefined\n  at onwriteDrain (_stream_writable.js:359:12)\n  at afterWrite (_stream_writable.js:349:5)\n  at /home/xxx/node_modules/gulp-jest/node_modules/jest-cli/src/lib/FakeTimers.js:325:7\n  at /home/xxx/node_modules/gulp-jest/node_modules/jest-cli/src/lib/FakeTimers.js:325:7\n  at Immediate._tickCallback [as _onImmediate] (node.js:341:15)\n  at processImmediate [as _immediateCallback] (timers.js:368:17)\n"
}

  at Worker._onStdout (/home/xxx/node_modules/gulp-jest/node_modules/jest-cli/node_modules/node-worker-pool/Worker.js:106:11)
  at emitOne (events.js:77:13)
  at Socket.emit (events.js:166:7)
  at readableAddChunk (_stream_readable.js:145:16)
  at Socket.Readable.push (_stream_readable.js:109:10)
  at Pipe.onread (net.js:508:20)

This happened to me when I had a console.log that I forgot to take out

@pherris really? having a console.log causes this?

This bug is one month old and still a huge problem. So would really appreciate to get a little more attention here. Thx!

More specifically, if I have anything writing to stdout (like console.log) it bombs. For example, adding console.log('bla'); to my preprocessor.js gives me this:
$ grunt test
Running "jest" task
FAIL  src/scripts/components/tests/RouterContainer-tests.js
Error: Attempted to send a message to the worker before the response from the last message was received! Worker processes can only handle one message at a time.
FAIL  src/scripts/components/common/tests/Alert-tests.js
Error: Attempted to send a message to the worker before the response from the last message was received! Worker processes can only handle one message at a time.
I posted this question on SO which helped me sort out the stdout/stderr : http://stackoverflow.com/questions/30198457/how-do-i-debug-jests-preprocessor.

Nah, the errors also happen when I don't have console.log() in my test code

Should be fixed via #540 (will go out with version 0.6). Please reopen if that's not the case.

authors: amasad binarykitchen pherris


text:
fix: Allow searching for tests in node_modules

Summary
In order to be able to inherit a common Jest test from an npm module, the user needs to be able to search for tests in the node_modules directory. The boolean "retainAllFiles" had been hard-coded to false, preventing this inheritance from being possible. The changes here expose the variable via the "haste" configuration property and allow the user to optionally scan the node_modules for test patterns.
Test plan
$ npx jest --testRegex "/*(.pact.test.js)" --runInBand
 PASS  test/src/Health.pact.test.js (9.646 s)
 PASS  node_modules/@aw/node-testing/dist/test/health.pact.test.js (5.922 s)

Test Suites: 2 passed, 2 total
Tests:       2 passed, 2 total
Snapshots:   0 total
Time:        15.733 s
Ran all test suites.

Thanks! Test is failing on CI, in case you missed it 🙂


text:
Extract 'createTransformer' and use type predicates

Summary
See discussion in #12403. These changes make the interfaces more self-documenting and the intent clearer.
Test plan
Type checks
$ npm run test-types

> @jest/monorepo@0.0.0 test-types /home/carlerik/code/jest
> yarn jest --config jest.config.tsd.js

 PASS   types  packages/jest-types/__typetests__/config.test.ts
 PASS   types  packages/jest-types/__typetests__/jest.test.ts
 PASS   types  packages/expect/__typetests__/expect.test.ts
 PASS   types  packages/jest-types/__typetests__/globals.test.ts
 PASS   types  packages/jest-types/__typetests__/expect.test.ts

Test Suites: 5 passed, 5 total
Tests:       412 passed, 412 total
Snapshots:   0 total
Time:        4.334 s
Ran all test suites.

Unit tests
This failed on some integration tests (differed on runs), but not due to my changes?
$ npm run test

> @jest/monorepo@0.0.0 test /home/carlerik/code/jest
> yarn lint && yarn jest

Summary of all failing tests
 FAIL  e2e/__tests__/complexItemsInErrors.ts (6.038 s)
  ● handles functions that close over outside variables

    Timed out

      at timeoutKill (node_modules/execa/lib/kill.js:65:23)

  ● handles functions that close over outside variables

    Process exited

      51 |   );
      52 |
    > 53 |   await waitUntil(({stderr}) => stderr.includes('Ran all test suites.'));
         |         ^
      54 |
      55 |   const {stderr} = await end();
      56 |

      at Object.waitUntil (e2e/__tests__/complexItemsInErrors.ts:53:9)

Test Suites: 1 failed, 1 skipped, 426 passed, 427 of 428 total
Tests:       1 failed, 38 skipped, 4515 passed, 4554 total
Snapshots:   1748 passed, 1748 total
Time:        320.018 s

Hmm ... after seeing babel-jest breaking due to a type issue, I tried fixing it, but I am having difficulty getting it to recognize that the type is indeed exported. When running npm run watch:ts I get the same error as the CI:
packages/babel-jest/src/index.ts:22:3 - error TS2305: Module '"@jest/transform"' has no exported member 'TransformerCreator'.

The transform package does (now) have that type exported and I can see it in node_modules/\@jest/transform/build/types.d.ts, so not sure what is going on here. Hoping that pushing a commit fixes :shrug:  Seems to be some kind of build ordering issue.

Note that you need to export TransformerCreator from index.ts for it to be visible outside of the module it's declared in

Sorry, missed the last push!

Yeah, no problem 👍

Hmm ... this is stale, but I am not sure why 🤷 Should I address something or are we good ⬆?

Should be good - I've been away on vacation, so haven't had time to properly review

Totally understandable; I was just not sure if this was blocking due to me or not, since it seemed everything substantial had been addressed.


text:
Workaround a node >=12.5.0 bug that causes the process not to exit after tests have completed and cancerous memory growth

This is a workaround for an issue that occurs in node 12.5.0 and newer, described in detail here:  https://github.com/nodejs/node/issues/29001
The behavior of the code in question is the same, however the change is enough to prevent locking the process into a "cancerous" state of memory growth.
This is one of the weirdest bugs I've ever debugged.
Under certain circumstances, Node process (starting from version 12.5.0, previous versions not affected), would not exit (even if we call process.exit() at the end of the file), and instead start to consume memory until it fills the whole available memory, using 100% CPU while at it.
Here's a reproduction based on the HasteMap:
https://gist.github.com/niieani/a527e9b2e6caf28e3021a50b938e4a91
Standard memory or CPU profiling doesn't show anything (literally, there are no function calls shown in the profiler). Dumping the heap snapshot results in a 36MB file, even when the memory consumption of the process is 10 GB.
Summary
The backstory is that in our case jest would not end AFTER all the tests have completed, and instead would start consuming huge amounts of memory (on CI, multiple processes from separate PRs would deplete the 128GB of RAM on the machine) so I started going down the rabbit hole to try and pinpoint what is the cause of the issue, which lead me to this minimal reproduction scenario, but also to discover all the quirks that helped to avoid triggering the scenario.

Test plan
Testing on node 12 is not enabled in CI due to https://github.com/facebook/jest/issues/8397, so it's not possible to make a test for this case at this time.
Locally, it's possible to test it using the data I've provided in the gist above, after replacing the devDependency 'weak' with:
    "weak": "github:lxe/node-weak#node-12"

Feedback
Looking for feedback before adding the CHANGELOG for this. Perhaps we should fix running jest in node 12 first, so this issue could be tested for?

Confirmed this works for me on node v12.8.0 on linux where previously I had consistent terrible results since v12.5.0 and on macOS where I had inconsistent but frequently terrible results.
Here's a patch-package usable patch vs jest-haste-map 24.8.0 since that's what you get by default with react-native right now (my use case, and likely the majority). '.txt' suffix added for github-compatibility, just strip that and drop it in your patches folder after integrating patch-package.
THANK YOU :-)
jest-haste-map+24.8.0.patch.txt

This is one of those rare patches that has saves me like 15 minutes a day because of the startup speed improvement - over the last 4 days since I integrated it locally it's at least an hour. One a smaller-ram designer co-workers machine it saved me from explaining how to downgrade node etc as it makes our current process work without crashing him.

@thymikee should I add a CHANGELOG or you wanna do it to the PR?

Please add a changelog entry, thanks :)

It'll be interesting to see what sort of memory leaks will be fixed and performance gained by dropping node 6 and avoiding the transpilation of async-await. #8806 confirmed the issue is fixed by just changing the target in the babel config without a code change. 25 can't come soon enough 😀

Looking forward to dropping transpilation of await / async, but let's get this into the release.
I have a fix for the bug blocking release almost finished, so if we can get this in shortly we can publish it too.

node v12.9 fixes the underlying cause that needed the workaround, for what it's worth - but this patch was well loved while it was needed. Thanks guys

Great news 👍

Thanks for moving this forward @scotthovestadt, I never made it to update the changelog.
Happy to hear that 12.9 fixes the underlying issue!

authors: SimenB mikehardy niieani scotthovestadt thymikee


text:
Bug: Enabling and disabling Markdown removes styles applied to text

When writing styled text containing whitespaces, enabling and disabling Markdown removes any style applied to the text. The text is also replaced by Markdown.
Lexical version:
Steps To Reproduce

Write any text with whitespaces.
Apply styles to the text
Convert to Markdown
Disable Markdown

https://user-images.githubusercontent.com/44519061/189119324-b11b4556-508f-40ed-a547-2ec048f21072.mov

I can't reproduce this with the current version. I can definitely still see some bugs in how the table support is implemented and how leading or trailing styled whitespace is handled, but this case seems to work ok (ignoring the other table related issues)

authors: alinamusuroi etrepum

repo: facebook/lexical


text:
Packager fails: Unknown plugin "transform-runtime"

I originally posted on react-native as facebook/react-native/issues/14530, but realized it's more appropriate here. Guidance on how to decide where to post bugs would be appreciated!
Create a fresh app with: react-native init rn46 --version "0.46.0-rc.2", then CMD+R in Xcode which attempts to fire up the packager, but immediately bombs with:
ReferenceError: Unknown plugin "transform-runtime" specified in "/rn46/node_modules/regenerator-transform/package.json" at 0, attempted to resolve relative to "/rn46/node_modules/regenerator-transform" (While processing preset: "/rn46/node_modules/babel-preset-react-native/index.js")
    at /rn46/node_modules/babel-core/lib/transformation/file/options/option-manager.js:180:17
    at Array.map (native)
    at Function.normalisePlugins (/rn46/node_modules/babel-core/lib/transformation/file/options/option-manager.js:158:20)
    at OptionManager.mergeOptions (/rn46/node_modules/babel-core/lib/transformation/file/options/option-manager.js:234:36)
    at OptionManager.init (/rn46/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
    at compile (/rn46/node_modules/babel-register/lib/node.js:103:45)
    at loader (/rn46/node_modules/babel-register/lib/node.js:144:14)
    at Object.require.extensions.(anonymous function) [as .js] (/rn46/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)

Since it's a reference error, I add the dependency npm i babel-plugin-transform-runtime --save-dev and rerun, which now bombs with:
Error: Couldn't find preset "env" relative to directory "/rn46/node_modules/regenerator-transform" (While processing preset: "/rn46/node_modules/babel-preset-react-native/index.js")
    at /rn46/node_modules/babel-core/lib/transformation/file/options/option-manager.js:293:19
    at Array.map (native)
    at OptionManager.resolvePresets (/rn46/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20)
    at OptionManager.mergePresets (/rn46/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:10)
    at OptionManager.mergeOptions (/rn46/node_modules/babel-core/lib/transformation/file/options/option-manager.js:249:14)
    at OptionManager.init (/rn46/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
    at compile (/rn46/node_modules/babel-register/lib/node.js:103:45)
    at loader (/rn46/node_modules/babel-register/lib/node.js:144:14)
    at Object.require.extensions.(anonymous function) [as .js] (/rn46/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (module.js:488:32)

Okay, let's now try npm i --save-dev babel-preset-env, which bombs with:
Error: Options {"loose":true} passed to /rn46/node_modules/babel-preset-env/lib/index.js which does not accept options. (While processing preset: "/rn46/node_modules/babel-preset-env/lib/index.js") (While processing preset: "/rn46/node_modules/babel-preset-env/lib/index.js") (While processing preset: "/rn46/node_modules/babel-preset-react-native/index.js")
    at /rn46/node_modules/babel-core/lib/transformation/file/options/option-manager.js:314:17
    at Array.map (native)
    at OptionManager.resolvePresets (/rn46/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20)
    at OptionManager.mergePresets (/rn46/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:10)
    at OptionManager.mergeOptions (/rn46/node_modules/babel-core/lib/transformation/file/options/option-manager.js:249:14)
    at OptionManager.init (/rn46/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
    at compile (/rn46/node_modules/babel-register/lib/node.js:103:45)
    at loader (/rn46/node_modules/babel-register/lib/node.js:144:14)
    at Object.require.extensions.(anonymous function) [as .js] (/rn46/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (module.js:488:32)

Something has definitely gone wrong down this rabbit hole. I noticed that @davidaurelio just upgraded babel-preset-react-native with commit bc22a4d, not sure if it's related but the update is already showing up in the initialized package.json:
	"devDependencies": {
		"babel-jest": "20.0.3",
		"babel-preset-react-native": "2.0.0",
		"jest": "20.0.4",
		"react-test-renderer": "16.0.0-alpha.12"
	}

Same happens here when start the project from Xcode,
but react-native start works as expected. (for both modes, release and debug)
the script seems to be accessing a wrong location, and then babel trigger this error.

Same here - it looks like it also has some issues with Babel Transform.

FYI, I submitted a PR to update RN with the latest facebook/react-native#14714. Despite the upgrade, neither this bug nor the AccessibilityInfo bug is fixed :(

Happy to reopen if this is still an issue, but it doesn't repro here.

authors: K-Leon cpojer rodriguesbreno sjmueller

repo: facebook/metro-bundler


text:
Fixed image source example as it wasn't working in non-web RN

This fixes facebook/react-native#28592

Deploy preview for react-native processing.
Building with commit 5950b9b9b9e3c7347a09faa25d52f6cc9b5d0edf
https://app.netlify.com/sites/react-native/deploys/5e9448bfc422e60007713db5

authors: charpeni espipj

repo: facebook/react-native-website


text:
React native Kotlin examples

@cortinico @ShikaSD @mdvacca

Hi @Simek sorry about that. First open-source contribution. I've changed it now

To preserve the changes for the future versions and include the in any other new generated ones, you need to edit the file inside docs folder. For mor information see:

Small nit, before you re-apply all the changes, let's agree on the valid code first so you won't have to re-apply every small change over and over :)

Hi @cortinico sorry, I had resubmitted before I saw your most recent comment. I'll wait to discuss any further changes with you before pushing again

No problem, I'll make that change now. Yes, I'm rebuilding and running the app as I make the changes. All working fine.

@Simek sorry, missed that one

Great, thanks @Simek 👍

Great work @alanjhughes 🙏 Thank you for taking a stance at this

Thanks @cortinico 👍 I will try to do some more

authors: alanjhughes cortinico


text:
Remove Contributing section, redirect to GitHub repository

We are moving all contributing content to the GitHub repository, leaving the website docs to focus on Guides and API References.
Redirects are in place for deleted content.
Test Plan:
yarn
yarn start

Verify the following URLs:

http://localhost:3000/react-native/docs/testing
http://localhost:3000/react-native/docs/contributing
http://localhost:3000/react-native/docs/building-from-source
http://localhost:3000/react-native/docs/publishing-forks
http://localhost:3000/react-native/docs/maintainers

Verify the docs load:

http://localhost:3000/react-native/docs/

This totally flew over my head. Thank you so much for doing this, yay!
Mind putting the Building From Source doc into the main repo? That's the only one that wasn't duplicated I think.

Added building from source and publishing, verbatim to https://github.com/facebook/react-native/wiki/Building-from-source - it might need some editing to get up to date.

Thank you @hramos

authors: cpojer hramos


text:
product-name regex fails to match product name in runIOS.js

Description
The product-name regex in local-cli/runIOS/runIOS.js line 160 fails to match the product name. This is probably because there is a $ to match the end of the string, but there is no guarantee that the product name string (which is in format of export FULL_PRODUCT_NAME=Test.app) is at the end of the buildOutput string.
Referencing pull-request: #13001, as it seems relevant to this issue.
Reproduction Steps and Sample Code
Please refer to the below screenshot. Below shows that the regex matches when the product name string is at the end of the line.

The next screenshot does not have any match because the product name string is not at the end of the line.

Solution
Fix the regex so that it doesn't assume that the product-name string is at the end of the buildOutput string.
Additional Information

React Native version: 0.44.0
Platform: iOS
Development Operating System: MacOS
Dev tools: iOS simulator

Regex is missing multi-line flag so that's probably why it's not matching.

multi-line is indeed the issue. I put a PR up at https://github.com/facebook/react-native/pull/13826.

Hi there! This issue is being closed because it has been inactive for a while.
But don't worry, it will live on with Canny! Check out its new home: https://react-native.canny.io/feature-requests/p/product-name-regex-fails-to-match-product-name-in-runiosjs

authors: chris-yoon90 dkpalmer hramos

repo: facebook/react-native


text:
react-native: 0.47.2 ini application is not working

We are using:
react-native-cli: 2.0.1
react-native: 0.47.2
node: v8.4.0
npm: 4.6.1
windows 10
running the default  app on android emulator device fails.

Bundling `index.android.js`  [development, non-minified, hmr disabled]  0.0% (0/1), failed.
error: bundling failed: "Cannot find entry file index.android.js in any of the roots: [\"E:\\\\SampleProjects\\\\AwesomeProjectNewVersion\"]"

It was working before [on react-native ( 0.47.1 ) ]

try npm run start -- --reset-cache

same error again

Check Gradle
distributionUrl=https://services.gradle.org/distributions/gradle-4.1-bin.zip

Hey, thanks for reporting this issue!
It looks like your description is missing some necessary information, or the list of reproduction steps is not complete. Can you please add all the details specified in the template? This is necessary for people to be able to understand and reproduce the issue being reported.
I am going to close this, but feel free to open a new issue with the additional information provided. Thanks!

authors: afattahi54 hramos iegik pocesar


text:
PROPOSAL: Bridge of  web API to native layer (OpenGL ES / Bitmap etc.)

Getting RN ready for Augmented Reality
The <canvas /> element of HTML5 has been the entry point for sophisticated 3D & 2D applications written in JS. At the moment, those JS based frameworks are only able to render to react-native by either using a webview or by using third party packages which bridge parts of the <canvas /> web api back to the corresponding native api. I.e. map webGL calls to the native OpenGL ES interface.
Benefit
If the <canvas /> web api would be bridged in full to the mobile platform, a century of rendering frameworks could be used flawlessly to create stunning visual effects. Instrument 3D rendering and Augmented Reality implementations within the react-native toolset by using common, well documented tools. I.e.

Three.js
Babylon.js

in cooperation with

ARKit
ARCOre

avoiding the messaging bottleneck between a webview and the JS thread.
Implementation for End-Users
Augmented Reality: https://blog.expo.io/introducing-expo-ar-mobile-augmented-reality-with-javascript-powered-by-arkit-b0d5a02ff23
Feasibility
That this is possible is shown by third party packages that partially implement the web <canvas /> api achieve common goals. Including facebooks reactART package for 2D rendering.

Bridging of webGL to the native OpenGL ES API:

https://github.com/gre/gl-react/tree/master/packages/gl-react-native
https://github.com/react-community/react-native-webgl
https://github.com/expo/expo/blob/cdbcfa9a323fe71afb12cd8ccdf900103925c8a1/cpp/UEXGL.cpp

2D Implementation (reactART / facebook): https://github.com/facebook/react-native/tree/d20a6e9d2d92bfc6bc81cc828c4008af1c7a7760/Libraries/ART
By Google (three.ar.js for ARCore & ARKit) https://github.com/google-ar/three.ar.js

Why should it be a part of react-native core
A lot of time has been spend on the paradigm "learn once, use everywhere". At the moment this approach has been held up by tying together the very heterogeneous apis of the mobile platforms. And that is great. The next logical step is to make the underlying graphics power of modern devices accessible. The web <canvas /> has done that elegantly on the web — using that api to unleash the native power of mobile graphics would enable incredible user experiences; all with an existing ecosystem of libraries that are already building on top of WebGL.
Compared to the DOM and Device APIs, the Graphics Layer has no volatile API development. We have years of experience in dealing with the web canvas and great frameworks that instrument them well. Satellite implementations by third party packages of the <canvas /> seem like an unnecessary uncertainty for using frameworks and libraries that rely on proper <canvas /> implemention. If the api is done once and well, it will little change in shape in the future. As volatility is often a reason to prefer to have contributions be maintained outside of the core, this seems to not be the issue.
It's a straight implementation. That it is very well possible to bridge the full <canvas /> api to a foreign platform (or back to its OpenGL origin) is very well shown by the maintainers of babylon.js (microsoft), who have created a webgl 2D bridge to be independent of the DOM for node.js chakra:
https://www.eternalcoding.com/?p=1922
I hope we can achieve the same for react-native.
Related Issues / Tickets
https://github.com/facebook/react-native/issues/12119
https://github.com/facebook/react-native/issues/246
Is this a bug report?

[x] No (but it concurrences a full implementation related to ART; therefore here, not on canny)

Have you read the Contributing Guidelines?

[x] Yes

Context
The Problem and this Issue was featured in my talk at the reactday.berlin Conference on Dec. 2, 2017:

Don't think it should be part of the core, especially because it's likely that Facebook some be supporting it and it'll increase the API surface and maintenance overhead if RN, which is already huge. Furthermore, the releases will be tied to React Native releases instead of being independent.
If course if it's officially supported by Facebook, it'll be awesome. But even then I'd really like to see it in a separate repo, like Metro Bundler. If also like to see more UI components moved out of the core, but that's a separate topic.

In the spirit of reducing the surface area for React Native, I agree with @satya164 that this should not be a part of the core.
Is there a reason that this a this cannot be added as a plugin to ReactNative ?


text:
WebView ignores document lang / encoding

Is this a bug report?
Yes

Have you read the Contributing Guidelines?
Yes
Environment

Environment:
OS: Windows 10
Node: 9.3.0
Yarn: 1.3.2
npm: 5.5.1
Watchman: Not Found
Xcode: N/A
Android Studio: Version  3.0.0.0 AI-171.4443003
Packages: (wanted => installed)
react: 16.0.0 => 16.0.0
react-native: 0.51.0 => 0.51.0
Steps to Reproduce

(Write your steps here:)

Init a new project.
Copy/Paste the code I provide.
See - the characters are wrong.

Expected Behavior

Show the word in Hebrew:

שלום

Actual Behavior

Shows some bad characters.

Reproducible Demo

Link:
https://snack.expo.io/HkmOZ0VHG

If it's not a bug then how can I achieve this relatively simple task of setting the encoding to Hebrew? I've search all over the internet, as well as the docs and this very repo issue tracker :)
Thank you!

This message was created automatically by mail delivery software.
A message that you sent could not be delivered to one or more of its
recipients. This is a temporary error. The following address(es) deferred:
mkdirenv@gmail.com
Domain salmanwaheed.info has exceeded the max emails per hour (177/150 (118%)) allowed.  Message will be reattempted later
------- This is a copy of the message, including all the headers. ------
Received: from o6.sgmail.github.com ([192.254.113.101]:47823)
by box1177.bluehost.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128)
(Exim 4.89_1)
(envelope-from bounces+848413-a7b0-hello=salmanwaheed.info@sgmail.github.com)
id 1epQVk-003Jcd-U7
for hello@salmanwaheed.info; Fri, 23 Feb 2018 20:28:33 -0700
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=github.com;
h=from:reply-to:to:cc:in-reply-to:references:subject:mime-version:content-type:content-transfer-encoding:list-id:list-archive:list-post:list-unsubscribe;
s=s20150108; bh=haPewJ8npgYvRmImxMPFkvQC++E=; b=pcn9+VXQ1h61WtY8
1Sgha3mrsh+7nLU3rCjUhL0JMF1aJCAL9+3cAsgUmud1g9DrRafb5vvsm69dczmj
dnB0hkjkoeS9E4Rs82ibgM4/MMYxSGKYid/M9bhQfvrvt2qJItwWPwGKp9WYbCs1
poBYPXrmEt1DW6/m7EvQ5hdsnc8=
Received: by filter0223p1iad2.sendgrid.net with SMTP id filter0223p1iad2-21069-5A90DBD6-1
2018-02-24 03:28:22.166790286 +0000 UTC
Received: from github-smtp2b-ext-cp1-prd.iad.github.net (github-smtp2b-ext-cp1-prd.iad.github.net [192.30.253.17])
by ismtpd0002p1iad1.sendgrid.net (SG) with ESMTP id r8-c51xqTLqVX-lcSNLWow
for hello@salmanwaheed.info; Sat, 24 Feb 2018 03:28:22.051 +0000 (UTC)
Date: Sat, 24 Feb 2018 03:28:22 +0000 (UTC)
From: React Native Bot notifications@github.com
Reply-To: facebook/react-native reply@reply.github.com
To: facebook/react-native react-native@noreply.github.com
Cc: Subscribed subscribed@noreply.github.com
Message-ID: facebook/react-native/issues/17717/368194981@github.com
In-Reply-To: facebook/react-native/issues/17717@github.com
References: facebook/react-native/issues/17717@github.com
Subject: Re: [facebook/react-native] WebView ignores document lang / encoding
(#17717)
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="--==_mimepart_5a90daa451a30_28a13fde246eef28155013";
charset=UTF-8
Content-Transfer-Encoding: 7bit
Precedence: list
X-GitHub-Sender: react-native-bot
X-GitHub-Recipient: salmanwaheed
X-GitHub-Reason: subscribed
List-ID: facebook/react-native <react-native.facebook.github.com>
List-Archive: https://github.com/facebook/react-native
List-Post: mailto:reply@reply.github.com
List-Unsubscribe: mailto:unsub+00ef1b386e313aebd8797534f7d26056ef29da066ea6d39492cf0000000116a89ca492a169ce11566873@reply.github.com,
https://github.com/notifications/unsubscribe/AO8bOAqeWETUU1xnTZCHf5LhYwHgYTuWks5tX4CkgaJpZM4Rpzw8
X-Auto-Response-Suppress: All
X-GitHub-Recipient-Address: hello@salmanwaheed.info
X-SG-EID: 92ws1MVnlto3blxqXlf5goB0ee0kdDGWR6vcWx8d649xd0kWqihDpfYarJdioTTaWzo0gXgrG0HhFk
HAqOBye9zWI/6clKMwtkbp6a4/uflocRWBLpPCIFHB39RTNpo2JFzhB+VXwhZnr+5qPTTeK586A95u
IHeTUeClUDeJEcryYFaReec5egFKdHdx9NZizWdz9SbhnqXzVe/xltfzkVJc8LmwfwtDiTrosEWBv6
c=
X-Spam-Status: No, score=-1.3
X-Spam-Score: -12
X-Spam-Bar: -
X-Ham-Report: Spam detection software, running on the system "box1177.bluehost.com",
has NOT identified this incoming email as spam.  The original
message has been attached to this so you can view it or label
similar future email.  If you have any questions, see
root@localhost for details.
Content preview:  Thanks for posting this! It looks like you may not be using
the latest version of React Native, v0.53.0, released on January 2018. Can
you make sure this issue can still be reproduced in the latest version? [...]
Content analysis details:   (-1.3 points, 5.0 required)
pts rule name              description

0.0 URIBL_BLOCKED          ADMINISTRATOR NOTICE: The query to URIBL was blocked.
See
http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block
for more information.
[URIs: github.com]
-0.5 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
[192.254.113.101 listed in wl.mailspike.net]
-0.5 SPF_PASS               SPF: sender matches SPF record
-0.0 T_RP_MATCHES_RCVD      Envelope sender domain matches handover relay
domain
0.0 HTML_IMAGE_ONLY_32     BODY: HTML: images with 2800-3200 bytes of words
0.0 HTML_MESSAGE           BODY: HTML included in message
-0.1 DKIM_VALID_AU          Message has a valid DKIM or DK signature from author's
domain
-0.1 DKIM_VALID             Message has at least one valid DKIM or DK signature
0.1 DKIM_SIGNED            Message has a DKIM or DK signature, not necessarily valid
-0.2 AWL                    AWL: Adjusted score from AWL reputation of From: address
X-Spam-Flag: NO
----==_mimepart_5a90daa451a30_28a13fde246eef28155013
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Thanks for posting this! It looks like you may not be using the latest vers=
ion of React Native, v0.53.0, released on January 2018. Can you make sure t=
his issue can still be reproduced in the latest version?=20
I am going to close this, but please feel free to open a new issue if you a=
re able to confirm that this is still a problem in v0.53.0 or newer.
[How to Contribute](https://facebook.github.io/react-native/docs/contr=
ibuting.html#bugs) =E2=80=A2 [What to Expect from Maintainers](https://face=
book.github.io/react-native/docs/maintainers.html#handling-issues)
--=20
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/facebook/react-native/issues/17717#issuecomment-368194981=
----==_mimepart_5a90daa451a30_28a13fde246eef28155013
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Thanks for posting this! It looks like you may not be using the latest v=
ersion of React Native, v0.53.0, released on January 2018. Can you make sur=
e this issue can still be reproduced in the latest version?
I am going to close this, but please feel free to open a new issue if yo=
u are able to confirm that this is still a problem in v0.53.0 or newer.
How to Contribute =E2=80=A2 What to Expect from Maintainers
&mda=
sh;You are receiving this because you are subscribed to this thread.<=
br />Reply to this email directly, view it on GitHub, or =
mute the thread.

=
----==_mimepart_5a90daa451a30_28a13fde246eef28155013--

authors: elyran salmanwaheed


text:
React native web view zooms webpage on iOS.. works fine on android...

[x] I have reviewed the documentation
[x] I have searched existing issues
[x] I am using the latest React Native version

I am using WebView of react native to display a web page. It show correctly on android mobile. But it gets zoomed unnecessarily on iOS. I have this meta data added to the site url which webview is loading.
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Still No Idea what's causing the issue.
It's opening quite well and correctly when I open the link in Safari browser of the same mobile
Environment:
OS: macOS High Sierra 10.13.4
Node: 9.4.0
Yarn: 1.3.2
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.3 Build version 9E145
Android Studio: 3.0 AI-171.4443003
Packages: (wanted => installed)
react: 16.2.0 => 16.2.0
react-native: 0.53.2 => 0.53.2
Steps to Reproduce

Load this url: http://v4.vaave.net/albums.dz into react-native WebView component
Check the result on android and ios. On iOS you can observe the view is zoomed
The code is
import {WebView as NativeWebView} from "react-native";

<NativeWebView             startInLoadingState             scalesPageToFit             source={{ uri: this.props.url }}             ref={webview => {               this.myWebView = webview;             }}  />
Expected Behavior

It should not be zoomed on both iOS and android
It's opening quite well and correctly when I open the link in Safari browser of the same mobile like in the below screenshot which is actually a screenshot of android mobile

This One

Actual Behavior
It is getting zoomed

Yes the issue is on latest 0.55 too

Any update on this?

Same. React Native: 0.55.4

try to modify 'scalesPageToFit' of webview.

@Feng999, thanks for the reply. I still experience the issue with salesPageToFit set to either true or false.

I just got this working. The bug—for me—is not related to React Native. In my case, the page loaded insecure assets that were blocked by iOS App Transport Security. To check if this is affecting your app, try:
<key>NSAppTransportSecurity</key>
<dict>
  <!--Include to allow all connections (DANGER)-->
  <key>NSAllowsArbitraryLoads</key>
  <true/>
</dict>

+1

maybe you can try the folow code:
window.onload = function(){
    //resize code
   ...
}

Try giving your webview a height and a width. For example your screen dimension's width/height.

same,to show image in android
when
my code is
<WebView
ref={ref => this.WEBVIEW_REF = ref}
style={{ justifyContent: 'center',alignItems: 'center',width:'100%',height:height,}}
source={{uri: 'https://test.com/images/s1/s1.jpg'}}
/>
zoomed unnecessarily in first load

+1. The image uri is 'https://img.alicdn.com/imgextra/i1/4045187964/TB2z.KQpAomBKNjSZFqXXXtqVXa_!!4045187964.jpg'. it gets zoomed unnecessarily on iOS.

React-native Webview component is being extracted to https://github.com/react-native-community/react-native-webview. Please if that bug still exists with the extracted component, open an issue on the other repository, as it will probably be easier to get attention there.
Thank you !

try to modify 'scalesPageToFit' of webview.

Thanks! Worked for me 💯

try to modify 'scalesPageToFit' of webview.

https://github.com/ShivamKJJW/react-native/commit/d42290959364963f3cb3717b9a2464a78ce13f6f


text:
Scrollview on Android does not call onMomentumScrollEnd when scrolled programmatically

This is a follow-up of #25672.
React Native version:

System:
OS: macOS 10.14.6
CPU: (8) x64 Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz
Memory: 37.81 MB / 16.00 GB
Shell: 5.0.9 - /usr/local/bin/bash
Binaries:
Node: 8.15.0 - ~/.nvm/versions/node/v8.15.0/bin/node
Yarn: 1.19.0 - /usr/local/bin/yarn
npm: 6.11.3 - ~/.nvm/versions/node/v8.15.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.0, DriverKit 19.0, macOS 10.15, tvOS 13.0, watchOS 6.0
Android SDK:
API Levels: 23, 25, 26, 28
Build Tools: 23.0.1, 25.0.1, 26.0.1, 26.0.2, 28.0.1, 28.0.3
System Images: android-23 | Intel x86 Atom_64, android-23 | Google APIs Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5791312
Xcode: 11.0/11A420a - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.1 => 0.61.1
npmGlobalPackages:
react-native-cli: 2.0.1
Steps To Reproduce

Call scrollTo({ x: something, y: something, animated: true})
Watch how on Android the onMomentumScrollEnd isn't being called, while in iOS works fine.

I faced same issue with the newest React Native. Any solutions?

Can verify it's still happening in v0.61.5 on Android.

Same issue on Android, is there any solution for it?

still happening on react-native v0.63.1

confirm in React-native v0.63.0

same on react-native v0.63.2

still happening in react-native 0.63.3

I have added a PR to address this.  If anyone here could test it or review it and comment on the PR, I'd love to get some momentum to help it get merged.  Thanks!

I have added a PR to address this. If anyone here could test it or review it and comment on the PR, I'd love to get some momentum to help it get merged. Thanks!

How can I use Your PR in my current project to test it?

How can I use Your PR in my current project to test it?

I have a fork you could try, its based off 0.63.3.  The branch name is release/paul-v2.
https://github.com/ajpaulingalls/react-native/tree/release/paul-v2
You can reference it in package.json like this:
    "react-native": "github:ajpaulingalls/react-native#release/paul-v2",

I would only use it for testing the fix while we wait for a possible merge.  Sadly there has been no momentum on that, so please help by upvoting the PR...

@ajpaulingalls sadly not work with me :\ still not triggered!
here's my code snippet if u want to see it or something
https://gist.github.com/anastely/0252cbe613bb0a5a6652fc498f0ce7d4

@ajpaulingalls sadly not work with me :\ still not triggered!
here's my code snippet if u want to see it or something
https://gist.github.com/anastely/0252cbe613bb0a5a6652fc498f0ce7d4

Can you verify you have the actual changes?  Check for this file in your node_modules and validate it has the calls to handleSmoothScrollMomentumEvents();
https://github.com/ajpaulingalls/react-native/blob/release/paul-v2/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.java
sometimes yarn/npm can be messy.  I have verified the change both in my code as well as the RNTester app (both in 0.63.3 fork as well as master) so I'm confident it works...

@ajpaulingalls sadly not work with me :\ still not triggered!
here's my code snippet if u want to see it or something
https://gist.github.com/anastely/0252cbe613bb0a5a6652fc498f0ce7d4

Can you verify you have the actual changes? Check for this file in your node_modules and validate it has the calls to handleSmoothScrollMomentumEvents();
https://github.com/ajpaulingalls/react-native/blob/release/paul-v2/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.java
sometimes yarn/npm can be messy. I have verified the change both in my code as well as the RNTester app (both in 0.63.3 fork as well as master) so I'm confident it works...

Yes, Actually before I wrote my comment here, I have checked out your changes from the fork and it's existing in my node_modules!
I don't know why not work here!
Can u use my code (this gist) in a project with your fork to ensure if I miss anything?

Same for me, I tried to patch react-native with your PR diffs + directly use github:ajpaulingalls/react-native#release/paul-v2 you repo, nothing worked for me, the onMomentumScrollEnd is still not triggered

Same for me, I tried to patch react-native with your PR diffs + directly use github:ajpaulingalls/react-native#release/paul-v2 you repo, nothing worked for me, the onMomentumScrollEnd is still not triggered

@ajpaulingalls sadly not work with me :\ still not triggered!
here's my code snippet if u want to see it or something
https://gist.github.com/anastely/0252cbe613bb0a5a6652fc498f0ce7d4

Can you verify you have the actual changes? Check for this file in your node_modules and validate it has the calls to handleSmoothScrollMomentumEvents();
https://github.com/ajpaulingalls/react-native/blob/release/paul-v2/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.java
sometimes yarn/npm can be messy. I have verified the change both in my code as well as the RNTester app (both in 0.63.3 fork as well as master) so I'm confident it works...

Hey @ajpaulingalls thanks for working on this. Could you open this PR to the main repo so I can take a look at it?

Hey @ajpaulingalls thanks for working on this. Could you open this PR to the main repo so I can take a look at it?

Hi @safaiyeh which repo do you mean by main repo?  The PR is open against facebook:master.  You can view it here:
https://github.com/facebook/react-native/pull/30367
do you have a different repo in mind?

Confirm it still happens on react-native: 0.63.2.

Confirming it happens in react-native; 0.64.2

Confirming it happens in react-native 0.65.1

Appears to still be an issue in 0.66.3

Still an issue on react-native 0.66.4

authors: AlphaJuliettOmega Inbal-Tish IvKr95 ajpaulingalls amblicity anastely camazorro christophemenager djhr ella33 jakubmas jd20 olie-chan safaiyeh scrapecoder varshan09 zomars


text:
Error: Package name not found

Description
After integrating RN into an existing Android project, I get the following error:
Error: Package name not found in /home/.../AndroidManifest.xml    at Object.projectConfig (/home/.../rn_integrated_app/node_modules/@react-native-community/cli-platform-android/build/config/index.js:74:11)    at Object.get project [as project]
As I understand the problem is that there is no package attribute in the relevant AndroidManifest.xml file. Since my project has many flavors, the package attribute is added dynamically, while compiling, through app/build.gradle:
def pkgDataEntry = getRightValue(packagesData, variantMap) variant.getMergedFlavor().applicationId = pkgDataEntry.pkg
So that the final merged manifest file does have the package attribute.
The error occurs here(@react-native-community/cli-platform-android/build/config/index.js):
const packageName = userConfig.packageName || getPackageName(manifest); if (!packageName) { throw new Error("Package name not found in ${manifestPath}");   }
Is there a way to make RN read the merged manifest file? If not, how can I modify userConfig to contain the package name? I couldn`t find anything about it in the docs.
Version
0.67.3
Output of npx react-native info
System:
OS: Linux 5.13 Ubuntu 20.04.3 LTS (Focal Fossa)
CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
Memory: 1.38 GB / 15.36 GB
Shell: 5.0.17 - /bin/bash
Binaries:
Node: 16.13.1 - /usr/local/bin/node
Yarn: 1.22.17 - /usr/bin/yarn
npm: 8.1.2 - /usr/local/bin/npm
Watchman: Not Found
SDKs:
Android SDK:
API Levels: 21, 23, 27, 28, 29, 30, 31
Build Tools: 28.0.3, 29.0.0, 29.0.2, 30.0.2, 31.0.0, 32.0.0
Android NDK: 22.1.7171670
IDEs:
Android Studio: Not Found
Languages:
Java: 11.0.14 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.67.3 => 0.67.3
npmGlobalPackages:
react-native: Not Found
Steps to reproduce
Create Android app with different flavors
assign "package" attribute through app/build.gradle
Follow the integration tutorial https://reactnative.dev/docs/integration-with-existing-apps
Error occurs
Snack, code example, screenshot, or link to a repository
No response

If anybody encounters the same issue, when having multiple flavors AndroidManifest.xml files,here`s my conclusion:
RN has some kind of a bug that it requires the first folder alphabetically, in android/app/src, which has AndroidManifest.xml file,to have the package attribute. Otherwise, it will throw an error.
A simple solution would be to create a dummy folder, e.g aaa (first alphabetically) and to create AndroidManifest.xml inside of it, with the following attribute - package:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="aaa"
    xmlns:tools="http://schemas.android.com/tools">
    <uses-permission
        android:name="android.permission.GET_ACCOUNTS"
        tools:node="remove"/>
</manifest>

Closing as this issue is related to the CLI: https://github.com/react-native-community/cli
Also you can find relevant information on the cofniguration support here:
https://github.com/react-native-community/cli/blob/main/docs/configuration.md

authors: SherMish cortinico


text:
IOS: RCT METHOD with RCTResponseSenderBlock problem

hii
i cant use more then 2 RCTResponseSenderBlock callbacks in functions is there any solution for this issue ? thanks

Only two sender blocks are supported by design -- one for success and one for failure. Use an RCTEventEmitter if you need to send more messages back to JS.

authors: emps ide


text:
updating android docs to use the right methods in code snippets

Updating code snippets in the android integration docs which use methods that no longer exist in the ReactInstanceManager class

Nice catch. The current ones are actually protected. Thanks.

authors: JoelMarcey abhijitnukalapati


text:
[Docs] Additional markdown adjustments

Follow up to 9ec95673909beac7798f589e0e9821b4225f8fa9

Website built successfully, landing now.


text:
Add error log for ReactPackage missing empty list implementation

Motivation
When we create custom ReactPackage for Native Modules or Native UI Components, we often forget to add Collections.emptyList() and produce NullPointerException repeatedly. This error log remind us to add empty code.
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)
This test can do in the RNTester.
Test ReactInstanceManager
To show error log in ReactInstanceManager, add ReactPackage into RNTesterApplication like below.
@Override
public List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
    new MainReactPackage(),
    new ReactPackage() {
        @Override
        public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
        return Collections.emptyList();
        }

        @Override
        public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
        return null;
        }
    }
  );
}

And run RNTester as Android App, the error log will show in LogCat. (with app crashes)
Test NativeModuleRegistryBuilder
Same as test for NativeModuleRegistryBuilder, write like below.
@Override
public List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
    new MainReactPackage(),
    new ReactPackage() {
        @Override
        public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
        return null;
        }

        @Override
        public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
        return Collections.emptyList();
        }
    }
  );
}

And run RNTester as Android App, the error log will show in LogCat. (without app crashes)
Release Notes
[ ANDROID ] [ ENHANCEMENT ] [ ReactPackage ] - Add error log for ReactPackage missing empty list implementation

Bad Credentials? > ci/circleci: analyze_pr

Why tvos ci fails... I edited only android....

thanks bot! I rebased.

why ci fail...? i rebased again.


text:
Provide timestamp as argument to rAF callbacks when running Jest tests

Summary
This change aligns requestAnimationFrame implementation used in Jest environment with web standard, and with the implementation that runs in the application environment.
As per specification https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame#parameters – requestAnimationFrame callback gets a single parameter, which represents the current frame timestamp. The current polyfill maps requestAnimationFrame directly to setTimeout which makes the callback execute without any parameters.
Changelog
[JEST] [FIXED] - requestAnimationFrame callbacks now receive a timestamp parameter
Test Plan

execute jest test suite to make sure nothing breaks
add the below code to one of the tests:

jest.useFakeTimers();
requestAnimationFrame((timestamp) => console.log("rAF", timestamp));
jest.runOnlyPendingTimers();
jest.useRealTimers();

this code will print undefined before and numer 0 representing the mocked frame time after this change.

Thanks for this - completely agree with adding this argument, but IIRC the value should be provided by jest.now(), which should work on both legacy and modern timers independently of selective faking (doNotFake).

Thanks for checking this @robhogan. Your suggestion makes sense. I was only testing it with modern timers where performance.now is mocked. Will update the PR after the weekend

authors: kmagiera robhogan


text:
[Codegen 77] Extract the functions to compute partial properties in the Flow and TypeScript parsers.

Summary
This PR aims to extract  the switch(configType) block from the buildSchema function into a separate function in a shared file between typescript and flow. It is a task of #34872:

[Codegen 77 - assigned to @MaeIg] Extract the functions to compute partial properties from the index.js file (Flow and TypeScript)in the Flow and TypeScript parsers.

Changelog

[Internal] [Changed] - Extract the functions to compute partial properties in the Flow and TypeScript parsers.
Test Plan
yarn flow:

yarn lint:

yarn test

@MaeIg Could you please add tests for that as well?

@MaeIg Could you please add tests for that as well?

Hello @rshest,
I added a test for each parser. I'm not sure these tests are useful because there is only one branch and everything is already covered by higher level tests.

authors: MaeIg rshest


text:
Migrate react/modules/fresco to Kotlin

Summary:
Changelog:
[Internal] -
This migrates the whole module of react/modules/fresco from Java to Kotlin.
Differential Revision: D60334554

/rebase

authors: raushanksec rshest


text:
MapView to support MKPointAnnotation using new attribute annotate in Map...

MapView to support Pin annotation
var pinLocation1 = {
		latitude: property.latitude,
		longitude: property.longitude,
		title: "I'm here.."
	};
	var pinLocation2 = {
		latitude: property.latitude + 0.1,
		longitude: property.longitude,
		title: "I'm here too!"
	};
this.state = {propertyPoints: [pinLocation1, pinLocation2]};
<MapView style={styles.map} region={this.state.region} annotations={this.state.propertyPoints}>
</MapView>

Please review the changes for supporting annotation inside MapView

Yes correct

Wouldn't it make more sense to provide an array of pins?
Also, we'd really want to be able to remove them. We could do that by maintaining a dictionary of annotations keyed by coordinate internally and when the array is updated we'd remove the ones that are no longer in the array.

libuicore is no longer required. If you wouldn't mind removing it, I'll get this merged.

Running UIExplorer, going into MapView, and tapping on the annotation freezes the app. I've tried this with a blank project with MapView, along with an ordinary annotation; same problem.
Occurs in both simulator, and on device. Inspecting memory usage via Xcode reveals that after annotation is tapped, memory usage keeps on rising, and CPU suddenly jumps to ~180%, and stays around there.

That's weird … I'm seeing this on iOS 8.1 simulator, but not pn iOS 8.3

OK, I've found the problem. I'm landing a fix ASAP, but in the meantime if it's blocking you, you can fix it by replacing the layoutSubviews method in RCTMap.m with
- (void)reactSetFrame:(CGRect)frame
{
  self.frame = frame;
}

- (void)layoutSubviews
{
  [super layoutSubviews];

  if (_legalLabel) {
    dispatch_async(dispatch_get_main_queue(), ^{
      CGRect frame = _legalLabel.frame;
      if (_legalLabelInsets.left) {
        frame.origin.x = _legalLabelInsets.left;
      } else if (_legalLabelInsets.right) {
        frame.origin.x = self.frame.size.width - _legalLabelInsets.right - frame.size.width;
      }
      if (_legalLabelInsets.top) {
        frame.origin.y = _legalLabelInsets.top;
      } else if (_legalLabelInsets.bottom) {
        frame.origin.y = self.frame.size.height - _legalLabelInsets.bottom - frame.size.height;
      }
      _legalLabel.frame = frame;
    });
  }
}

Why shouldn't the annotation be a node?
At least provide a way to customize the annotation, replace the default drop pin on iOS, leverage the appearance between iOS and Android.

authors: dvdhsu ginamdar matthewga0 nicklockwood


text:
[Syntax] changes based upon empirical research

Should this not already be part of the syntax discussions, would it be possible for arbitrary choices to default on the result on the few empirical studies that have been made in this area?
e.g.
Andreas Stefik and Susanna Siebert. 2013. An Empirical Investigation into Programming Language Syntax. ACM Transactions on Computing Education 13, 4, Article 19 (November 2013), 40 pages.

Nothing immediately actionable here, but this is one of the biggest things Reason enables: allowing us to freely experiment on new syntaxes, empirically, without breaking code. Somewhat related: I myself am a fan of Koka, Red and Kitten's syntax. Now we'll actually have a chance to take their best sugars and try them in some future alpha Reason releases for the adventurous ones, while others stay with the stable Reason syntax (or their own flavor of it, who knows...) and keep coding. Exciting future ahead.
However, because there's nothing immediately actionable, I'll close this for now. Thanks for the paper and we'll keep this in mind! =]

I just read the abstract and it sounds fascinating. One thing to consider is that Reason's goal is to reach out to the majority of industrial programmers, not necessarily first time programmers. Experienced industrial programmers have already become tainted, such that syntaxes that are empirically worse for beginners, may be easier for those experienced people to pick up quickly. I would love to see a similar experiment done on experienced programmers.

authors: battisti chenglou jordwalke

repo: facebook/reason


text:
Fix a few BUCK build issues

This fixes the following build issues when building from Buck:
third-party/ios/xctool/xctool/xctool/SimulatorWrapper/SimulatorUtils.m:33:31: warning: 'launch_data_alloc' is deprecated: first deprecated in OS X 10.10 [-Wdeprecated-declarations]
  launch_data_t stopMessage = launch_data_alloc(LAUNCH_DATA_DICTIONARY);

and
third-party/ios/xctool/xctool/xctool/XCToolUtil.m:355:60: error: use of undeclared identifier 'LONG_LONG_MIN'
  __attribute__((__blocks__(byref))) long long errorCode = LONG_LONG_MIN;

Do you want to bump buck version as well?

If not feel free to merge.

No need to bump the buck version. Thanks!
2015年9月11日(金) 17:35 Aleksey Kononov notifications@github.com:

If not feel free to merge.
—
Reply to this email directly or view it on GitHub
https://github.com/facebook/xctool/pull/567#issuecomment-139692581.

authors: ExtremeMan bhamiltoncx

repo: facebook/xctool


text:
"Input variables must have unique names" when using spend as variable

Contributing to FB NextGen MMM R script
Issue
When using spend as a variable I get the following error Error in f.inputWrangling() : Input variables must have unique names.
I am not entirely sure which type of "input variable" that is refered to here, since there's several user-inputs; set_mediaVarName, set_mediaSpendName,dt_input and set_hyperBoundLocal.
Steps to Reproduce
Using the following variables
>set_mediaSpendName
 [1] "bing_spend_B"               "bing_spend_branded"         "bing_spend_dsa"
 [4] "bing_spend_generic"         "bing_spend_other"           "bing_spend_shopping"
 [7] "facebook_spend_neither"     "facebook_spend_prospect"    "facebook_spend_retargeting"
[10] "google_spend_B"             "google_spend_branded"       "google_spend_display"
[13] "google_spend_dsa"           "google_spend_generic"       "google_spend_other"
[16] "google_spend_shopping"      "snapchat_spend_neither"

> set_mediaVarName
 [1] "bing_spend_B"                "bing_spend_branded"          "bing_spend_dsa"
 [4] "bing_spend_generic"          "bing_spend_other"            "bing_spend_shopping"
 [7] "facebook_clicks_neither"     "facebook_clicks_prospect"    "facebook_clicks_retargeting"
[10] "google_clicks_B"             "google_clicks_branded"       "google_clicks_display"
[13] "google_clicks_dsa"           "google_clicks_generic"       "google_clicks_other"
[16] "google_clicks_shopping"      "snapchat_clicks_neither"

set_hyperBoundLocal <- list(
 #,facebook_I_shapes = c(0.0001, 2) # example bounds for shape
 #,facebook_I_scales = c(0, 0.1) # example bounds for scale
        google_clicks_branded_alphas = c(0.5, 3),
        google_clicks_branded_gammas = c(0.3, 1),
        google_clicks_branded_thetas = c(0, 0.3),
        bing_spend_branded_alphas = c(0.5, 3),
        bing_spend_branded_gammas = c(0.3, 1),
        bing_spend_branded_thetas = c(0, 0.3),
        google_clicks_B_alphas = c(0.5, 3),
        google_clicks_B_gammas = c(0.3, 1),
        google_clicks_B_thetas = c(0, 0.3),
        google_clicks_display_alphas = c(0.5, 3),
        google_clicks_display_gammas = c(0.3, 1),
        google_clicks_display_thetas = c(0, 0.3),
        google_clicks_dsa_alphas = c(0.5, 3),
        google_clicks_dsa_gammas = c(0.3, 1),
        google_clicks_dsa_thetas = c(0, 0.3),
        google_clicks_generic_alphas = c(0.5, 3),
        google_clicks_generic_gammas = c(0.3, 1),
        google_clicks_generic_thetas = c(0, 0.3),
        google_clicks_other_alphas = c(0.5, 3),
        google_clicks_other_gammas = c(0.3, 1),
        google_clicks_other_thetas = c(0, 0.3),
        google_clicks_shopping_alphas = c(0.5, 3),
        google_clicks_shopping_gammas = c(0.3, 1),
        google_clicks_shopping_thetas = c(0, 0.3),
        bing_spend_B_alphas = c(0.5, 3),
        bing_spend_B_gammas = c(0.3, 1),
        bing_spend_B_thetas = c(0, 0.3),
        bing_spend_generic_alphas = c(0.5, 3),
        bing_spend_generic_gammas = c(0.3, 1),
        bing_spend_generic_thetas = c(0, 0.3),
        bing_spend_other_alphas = c(0.5, 3),
        bing_spend_other_gammas = c(0.3, 1),
        bing_spend_other_thetas = c(0, 0.3),
        bing_spend_dsa_alphas = c(0.5, 3),
        bing_spend_dsa_gammas = c(0.3, 1),
        bing_spend_dsa_thetas = c(0, 0.3),
        bing_spend_shopping_alphas = c(0.5, 3),
        bing_spend_shopping_gammas = c(0.3, 1),
        bing_spend_shopping_thetas = c(0, 0.3),
        facebook_clicks_retargeting_alphas = c(0.5, 3),
        facebook_clicks_retargeting_gammas = c(0.3, 1),
        facebook_clicks_retargeting_thetas = c(0, 0.3),
        facebook_clicks_prospect_alphas = c(0.5, 3),
        facebook_clicks_prospect_gammas = c(0.3, 1),
        facebook_clicks_prospect_thetas = c(0, 0.3),
        facebook_clicks_neither_alphas = c(0.5, 3),
        facebook_clicks_neither_gammas = c(0.3, 1),
        facebook_clicks_neither_thetas = c(0, 0.3),
        snapchat_clicks_neither_alphas = c(0.5, 3),
        snapchat_clicks_neither_gammas = c(0.3, 1),
        snapchat_clicks_neither_thetas = c(0, 0.3)
)

> names(dt_input)
 [1] "date"                        "google_clicks_branded"       "bing_spend_branded"
 [4] "google_spend_branded"        "google_clicks_B"             "google_clicks_display"
 [7] "google_clicks_dsa"           "google_clicks_generic"       "google_clicks_other"
[10] "google_clicks_shopping"      "google_spend_B"              "google_spend_display"
[13] "google_spend_dsa"            "google_spend_generic"        "google_spend_other"
[16] "google_spend_shopping"       "bing_spend_B"                "bing_spend_generic"
[19] "bing_spend_other"            "bing_spend_dsa"              "bing_spend_shopping"
[22] "facebook_clicks_retargeting" "facebook_clicks_prospect"    "facebook_clicks_neither"
[25] "snapchat_clicks_neither"     "facebook_spend_retargeting"  "facebook_spend_prospect"
[28] "facebook_spend_neither"      "snapchat_spend_neither"      "n_emails_sent"
[31] "revenue"

Throws the error.
In the docs the spend variable is named the same in set_mediaVarName and set_mediaSpendName e.g
set_mediaVarName <- c("tv_S"    ,"ooh_S",   "print_S"   ,"facebook_I"   ,"search_clicks_P")

set_mediaSpendName <- c("tv_S"  ,"ooh_S",   "print_S"   ,"facebook_S"   ,"search_S")

which might be a bug in the check/typo in the docs?
Expected Behavior
Being able to tell where the issues is and/or update of the docs if spend-name is not allowed to be named the same as var-name
Actual Results
See above
Environment
R version: 4.1.1

whats in the set_baseVarName? anything duplicated with media?

Of course - I had forgot to remove a variable from set_mediaVarName after adding it to set_baseVarName!
I would suggest, for a feature release, maybe printing which variables are duplicated in the check and/or write which inputs to check for duplicates i.e
input variable(s) ("var1","var2") is duplicated. Check if they are in both set_mediaVarName and set_baseVarName, and remove it from one of them

@Jakobhenningjensen just committed a check + error message to guide user on these possible input errors.
Thanks for your feedback.

repo: facebookexperimental/Robyn


text:
Scoped packages on forked versions

Hello, everyone!
I know we had a PR merged to accept NPM scoped packages in --scripts-version, this is another issue. I recently have been maintaining a forked version of create-react-app where I mostly customized webpack configs to add things like cssnext, stylelint, etc. The problem happened when I updated ./packages/react-scripts/package.json to be a scoped package having the name to be something like @myOrg/my-package-name.
We all know that scoped packages will create a folder between node_modules and react-scripts, which is perfectly fine! I had of course to do some tweaks in few relative paths and everything worked.
The real problem is not with my published NPM package version, but instead with my local scripts. I'm trying to keep react-scripts e2e tests and things working, so that I can automate my fork and make sure the experience with my forked package is always good (things always working).
Looking at ./tasks/cra.sh around line 66 we have something like:
# Finally, pack react-scripts
scripts_path=$root_path/packages/react-scripts/`npm pack`

So our buddy NPM will look at my scoped package.json:
{
  "name": "@danorg/react-scripts",
  "version": "0.0.1",
...
}

and will generate a tar file named danorg-react-scripts-0.0.1.tgz. Well, things go fine until right after ./packages/create-react-app/index.js performs the install and tries to locate the installed react-scripts folder.
The getPackageName function does:
// Extract package name from tarball url or path.
function getPackageName(installPackage) {
  if (installPackage.indexOf('.tgz') > -1) {
    // The package name could be with or without semver version, e.g. react-scripts-0.2.0-alpha.1.tgz
    // However, this function returns package name only without semver version.
    return installPackage.match(/^.+\/(.+?)(?:-\d+.+)?\.tgz$/)[1];
  } else if (installPackage.indexOf('@') > 0) {
    // Do not match @scope/ when stripping off @version or @tag
    return installPackage.charAt(0) + installPackage.substr(1).split('@')[0];
  }
  return installPackage;
}

It infers the package name from the tar file, so it thinks the folder is danorg-react-scripts but it is actually danorg/react-scripts.
I'm having problems trying to figure out the best way to fix this, my thoughts were that cra.sh and ..../create-react-app/index.js should be a little bit smarter to figure out the actual package name.
A stupid way I found to do it is sending the actual package.json name as an argument to the script.
Let's say that our cra.sh as now the following line:
...
# Finally, pack react-scripts
scripts_path=$root_path/packages/react-scripts/`npm pack`
packageName=`node -e 'console.log(require("./package.json").name)'`

...
node packages/create-react-app/index.js --scripts-version=$scripts_path "$@" --package-name=$packageName

But I don't really know if that is the right way to fix this, maybe I shouldn't be using scoped packages.

@EnoahNetzach Do you have any thoughts on this?

I don't particularly like to add another cli argument.
We could enhance create-react-app/index.js to look for directories too when the packageName contains (but doesn't begin with) "react-script"..
By the way, @danielfigueiredo, is this what you mean?

I get the error after yarn install:
daniel@dan-pc ~/Projects> ./create-react-app/tasks/cra.sh ~/Projects/my-test
+ cd ..
+ root_path=/Users/daniel/Projects/create-react-app
+ /Users/daniel/Projects/create-react-app/node_modules/.bin/lerna bootstrap
Lerna v2.0.0-beta.30
Independent Versioning Mode
Bootstrapping 5 packages
Installing external dependencies
Symlinking packages and binaries
Prepublishing packages
Successfully bootstrapped 5 packages.
+ cd packages/react-scripts
+ cp package.json package.json.orig
+ node /Users/daniel/Projects/create-react-app/tasks/replace-own-deps.js
Replaced local dependencies.
++ npm pack
+ scripts_path=/Users/daniel/Projects/create-react-app/packages/react-scripts/myorg-react-scripts-0.0.5.tgz
+ rm package.json
+ mv package.json.orig package.json
+ yarn cache clean
yarn cache v0.18.1
success Cleared cache.
✨  Done in 4.55s.
+ cd /Users/daniel/Projects/create-react-app
+ node packages/create-react-app/index.js --scripts-version=/Users/daniel/Projects/create-react-app/packages/react-scripts/myorg-react-scripts-0.0.5.tgz /Users/daniel/Projects/my-test
Creating a new React app in /Users/daniel/Projects/my-test.

Installing packages. This might take a couple minutes.
Installing react-scripts...
# ...
# later
# ...
Error: Cannot find module '/Users/daniel/Projects/my-test/node_modules/myorg-react-scripts/package.json'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at checkNodeVersion (/Users/daniel/Projects/create-react-app/packages/create-react-app/index.js:229:21)

So it can't find the module because the folder structure is:
node_modules/
  |-- myorg
    |-- react-scripts

I'm really sorry if I'm doing something wrong and I'm consuming your time

We could enhance create-react-app/index.js to look for directories too when the packageName contains (but doesn't begin with) "react-script"..

I haven't thought about that, it is a good idea. The only problem I see is that if you have a scoped package that is a fork of react-script but doesn't have react-script in the name, like @myorg/react-super-awesome-scripts-:P it wouldn't work.
That's why I thought that the .sh could add a parameter to the script automatically, so the API for the user would still be same, but I definitely lack proper knowledge in how to structure thing in the CRA.

I think relying on package name could be confusing and unexpected.

@danielfigueiredo have you checked #1537 out?

@EnoahNetzach I just rebased from facebook and it works!
Thanks a lot

authors: EnoahNetzach danielfigueiredo gaearon

repo: facebookincubator/create-react-app


text:
SyntaxError: Unexpected token export

Is this a bug report?
Yes.
Can you also reproduce the problem with npm 4.x?
Yes.
Which terms did you search for in User Guide?
I found a lot of similar issues. It did not help.
Environment

node -v: v8.5.0.
npm -v: 5.5.1 or 4.6.1.
npm ls react-scripts (if you haven’t ejected): mwr-unexpected-token-export@0.1.0 C:\Users\EvgenyShlykov\Documents\GitHub\mwr-unexpected-token-export  `-- react-scripts@1.0.17.
Operating system: Windows 10 Home Single Language.

Steps to Reproduce

Create a repo on GitHub.
Clone it.
Create-react-app.
Add .travis.yml.
App line .idea to .gitignore.
Open this project in WebStorm.
Run npm install d3-geo --save.
Add line import {geoMercator, geoPath} from '../node_modules/d3-geo/index'; to App.js.
Run npm test.

P.S. I think, steps 5 and 6 are optional. :)
P.P.S. Step 4 is just for convenience.
Expected Behavior
Passed tests.
Actual Behavior
FAIL  src/App.test.js
  ● Test suite failed to run
    /home/travis/build/eshlykov/mwr-unexpected-token-export/node_modules/d3-geo/index.js:1
    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){export {default as geoArea} from "./src/area";
                                                                                ^^^^^^

    SyntaxError: Unexpected token export

      at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/ScriptTransformer.js:289:17)
      at Object.<anonymous> (src/App.js:4:14)
      at Object.<anonymous> (src/App.test.js:3:12)

Reproducible Demo
You can see my repository. Also, I created a build on Travis.

I had a similar problem to this. The issue is your structure of having node_modules above the create-react-app directory. Webpack loaders are not aware of the directory, so they do not run on files in the directory. Therefore you're trying to run uncompiled ES6 code in the browser, which is why you see the error of "unexpected token export"
The solution is to either eject and customize the webpack configs, or patch them yourself. What I did was create a script to patch the configs with my desired data.
I copied the necessary files (webpack.config.dev.js, webpack.config.prod.js, paths.js) and edited what I need to edit. Then I run the patch script before running yarn start, yarn build, etc.
My file structure:
project
    client <--- create-react-app directory
        src
        build
        ....
    server
        ... <--- node app
    libcommon
        ... <-- files shared between server and client

I need to tell webpack in client/ to load files from ../libcommon
This is my patch script:
#!/usr/bin/env bash

DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P)

echo "Patch paths.js"
cp "$DIR/paths.js" "$DIR/../../src/client/node_modules/react-scripts/config/paths.js"

echo "Patch webpack.config.dev.js"
cp "$DIR/webpack.config.dev.js" "$DIR/../../src/client/node_modules/react-scripts/config/webpack.config.dev.js"

echo "Patch webpack.config.prod.js"
cp "$DIR/webpack.config.prod.js" "$DIR/../../src/client/node_modules/react-scripts/config/webpack.config.prod.js"

Here is my patched paths.js. The only lines I added are the two that reference libcommon:
// @remove-on-eject-begin

//
// ..... TRUNCATED
//

// config after eject: we're in ./config/
module.exports = {
  appBuild: resolveApp('build'),
  appPublic: resolveApp('public'),
  appHtml: resolveApp('public/index.html'),
  appIndexJs: resolveApp('src/index.js'),
  appPackageJson: resolveApp('package.json'),
  appSrc: resolveApp('src'),
  allSrc: resolveApp('../'),

  /* ADD THIS: */
  libcommon: resolveApp('../libcommon'),

  yarnLockFile: resolveApp('yarn.lock'),
  testsSetup: resolveApp('src/setupTests.js'),
  appNodeModules: resolveApp('node_modules'),
  nodePaths: nodePaths,
  publicUrl: getPublicUrl(resolveApp('package.json')),
  servedPath: getServedPath(resolveApp('package.json'))
};

// @remove-on-eject-begin
function resolveOwn(relativePath) {
  return path.resolve(__dirname, '..', relativePath);
}

// config before eject: we're in ./node_modules/react-scripts/config/
module.exports = {
  appPath: resolveApp('.'),
  appBuild: resolveApp('build'),
  appPublic: resolveApp('public'),
  appHtml: resolveApp('public/index.html'),
  appIndexJs: resolveApp('src/index.js'),
  appPackageJson: resolveApp('package.json'),
  appSrc: resolveApp('src'),

  /* ADD THIS: */
  libcommon: resolveApp('../libcommon'),

  yarnLockFile: resolveApp('yarn.lock'),
  testsSetup: resolveApp('src/setupTests.js'),
  appNodeModules: resolveApp('node_modules'),
  nodePaths: nodePaths,
  publicUrl: getPublicUrl(resolveApp('package.json')),
  servedPath: getServedPath(resolveApp('package.json')),
  // These properties only exist before ejecting:
  ownPath: resolveOwn('.'),
  ownNodeModules: resolveOwn('node_modules'), // This is empty on npm 3
};

// ..... TRUNCATED
//

// @remove-on-eject-end

In the webpack config, you need to add references to (in my case) paths.libcommonto the eslint preloader:
// .....
preLoaders: [
      {
        test: /\.(js|jsx)$/,
        loader: 'eslint',
        include: [paths.appSrc, paths.libcommon],
      },
// ...

Hope that helps.

Please don't require directly into a node_module (import {geoMercator, geoPath} from '../node_modules/d3-geo/index';); use it as intended.

I have the same problem when importing from reactstrap:
import { Jumbotron } from 'reactstrap';

I don't import from absolute sources like ../node_modules. Removing the import from reactstrap passes the tests. Do you have an idea about this? Thanks!

authors: Timer eshlykov hkdobrev milesrichardson


text:
Debug CRA Tests stopped working on VSCode v1.19

Is this a bug report?
Yes

Can you also reproduce the problem with npm 4.x?

Yes
Which terms did you search for in User Guide?

Debug CRA Tests in VS Code
https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#debugging-tests-in-visual-studio-code
Environment

node -v:  v8.9.1
npm -v: 4.1.2
yarn --version (if you use Yarn): No yarn
npm ls react-scripts (if you haven’t ejected): -- (empty)

Then, specify:

Operating system: Windows 10
Browser and version (if relevant): not relevant

Steps to Reproduce

Open VS Code 1.19
Setup a launch configuration as described here: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#debugging-tests-in-visual-studio-code
Fire the debugger with F5 or play on the debugging panel
The debugger doesn't start the test scripts and eventually fires a timeout
Rollback to VSCode version 1.18
Follow steps 1-2
The debugger starts the test scripts and properly attaches to the debugger

Expected Behavior
Debug CRA Test launch configuration works on VSCode 1.19 (similar to VSCode 1.18).

No changes between VSCode versions, or an updated version of the documentation to setup the launch configuration.
Actual Behavior

The launch configuration doesn't start the test scripts
The debugger doesn't attach to the test process
Timeout error is thrown on VS Code

References
The changelog for VSCode 1.19 mentions new additions on the debugging experience: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#debugging-tests-in-visual-studio-code
Issue created on VSCode:  https://github.com/Microsoft/vscode/issues/40293

The VSCode team provided the correct configuration for launch.json. Apparently, the configuration documented on Create React App was working accidentaly due to a VS Code bug that was addressed on the latest version 1.19.
Here's the verified working code since VSCode 1.19, in case someone runs onto this. Let me know if you would like me to update the documentation (or if someone on the CRA team can do that).
{
    "name": "Debug CRA Tests",
    "type": "node",
    "request": "launch",
    "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/react-scripts",
    "args": [
        "test",
        "--runInBand",
        "--no-cache",
        "--env=jsdom"
    ],
    "cwd": "${workspaceRoot}",
    "protocol": "inspector",
    "console": "integratedTerminal",
    "internalConsoleOptions": "neverOpen"
}

Please send a pull request fixing our documentation! 😄

Does this still work? Noticed the update in the ReadMe today, was excited to try it out: only to have the debugger not stop at the breakpoints 😢

Does your environment match what's shown on the Issue description above?
If not: can you please post the environment settings that differ? E.g. VS Code version, node, etc.

Turned out I needed Node@v8+
Older project, so I had to bump my .nvmrc file

authors: Timer amadeogallardo pedro-mass


text:
Fix for Add .gitattributes file #3080

Hmm, I'm not sure if we'd want to do this repository wide. Probably only for the react-error-overlay test files that require LF characters.

Hello! I'm a bot that helps facilitate testing pull requests.
Your pull request (commit debf9acc3e998bb31e306bb89a6b8e77b2d56994) has been released on npm for testing purposes.
npm i react-scripts-canary@1.0.14-debf9ac.0
# or
yarn add react-scripts-canary@1.0.14-debf9ac.0
# or
create-react-app --scripts-version=react-scripts-canary@1.0.14-debf9ac.0 folder/

Thanks for your contribution!

Hi, unfortunately adding .gitattributes at package level doesn't fix the issue.

Hmm, that is discouraging ... have you tried it with the snap extension?

Hello! I'm a bot that helps facilitate testing pull requests.
Your pull request (commit c42f275d84ce4e79a5dad1dc9377f9473f35246c) has been released on npm for testing purposes.
npm i react-scripts-dangerous@1.0.14-c42f275.0
# or
yarn add react-scripts-dangerous@1.0.14-c42f275.0
# or
create-react-app --scripts-version=react-scripts-dangerous@1.0.14-c42f275.0 folder/

Thanks for your contribution!

I'm closing this pull request because it's broken to a point of no return.
Sorry about this.

😢 thank you for trying so hard!

No worries it's not part of my character to give up.

authors: Timer duvet86 react-scripts-canary react-scripts-dangerous


text:
Added Rails link to User Guide

From issue #838

Sorry for long review.
I think it would be better to rename the section to "Integrating with an API Backend" and add two subheaders: "Node" and "Rails". What do you think?

Woops. I'm fairly new to OSS so really sorry about this.. Maybe I should just delete this PR and make a new one with my changes?

Better to create a new PR. Not sure what happened 😄

authors: alexdriaguine gaearon