Sebastian Markbåge
1c5a639c37
Require the isomorphic React instead of internals from renderers ( #7473 )
...
This is needed for flat builds. It also lets us get rid of a bunch
of special cases in the build scripts.
It also allow us to just copy the source files into React Native
instead of having to build first to resolve the special cases.
2016-08-11 18:56:55 -07:00
Dan Abramov
178cb7d339
Prevent performance regression in DEV due to warning arguments ( #7461 )
...
* Prevent internal performance regression
This only affects Facebook website, not open source version of React.
On the Facebook website, we don't have a transform for warnings and invariants.
Therefore, expensive arguments will be calculated even if the warning doesn't fire.
This fixes a few cases where that calculation might be more expensive than usually.
In my testing, this brings down average row click time in Power Editor from ~300ms to ~220ms in __DEV__ (vs ~40ms in prod).
* Put warning() that shows up in profile behind condition
2016-08-10 19:52:46 +01:00
Nathan Hunzaker
8aed0cd67e
Add some semicolons for linting. ( #7390 )
2016-08-01 21:17:58 +01:00
Keyan Zhang
f2fc182250
renamed modules (devtool -> hook)
2016-07-29 16:12:23 -07:00
Keyan Zhang
4d8a5bcd5c
codemodded tests from createClass to ES2015 classes
...
- reverted more files under classic
2016-07-23 15:16:12 -07:00
Dan Abramov
15ae5857f6
Eagerly evaluate inline requires in Jest ( #7245 )
...
* Eagerly evaluate inline requires in Jest
I inlined some requires in #7188 to fix the build size regression.
However this caused an issue with Jest due to it resetting module registry between tests.
This is a temporary fix to #7240 .
It should be reverted as part of #7178 .
* Make the hack work in all environments
2016-07-16 20:51:25 +01:00
Keyan Zhang
5103e1d6a1
warn for using maps as children with owner info ( #7260 )
2016-07-13 08:29:42 -07:00
Dan Abramov
8fe6b5fb46
Inline dev-only requires ( #7188 )
...
* Inline dev-only requires
This reduces the production bundled build size.
* Use new references after resetting module registry in tests
This fixes the tests which were broken due to inlining some requires.
2016-07-05 18:20:12 +01:00
Christopher Chedeau
07cfba17a9
[flow] fix flattenChildren type ( #7110 )
...
Summary:
Make the debug attribute optional
Test Plan:
npm run flow
Reviewers: @keyanzhang @chicoxyzzy
2016-07-05 09:18:49 -07:00
Sebastian Markbåge
4bc1048e0d
Unshare not actually shared files ( #7167 )
...
This moves some files out of shared that are not actually shared
with isomorphic. They're specific to the renderers.
2016-07-01 19:16:52 -07:00
Esteban
752e1595fc
Remove comment about PooledClass destructors being optional ( #6560 )
...
They are no longer optional since #4720
2016-06-26 21:52:12 +01:00
Sergey Rubanov
3b5c756c7a
[flow] add some typings to utils ( #7104 )
...
* add some typings to utils
* add typing of flattenChildren
* more accurate typings for flattenChildren
2016-06-23 18:16:37 +02:00
Christopher Chedeau
9342c2f02f
[flow] type deprecated ( #7076 )
...
Summary:
Test Plan:
npm run flow
Reviewers: @zpao @spicyj @gabelevi
2016-06-23 17:46:24 +02:00
Christopher Chedeau
489caeb2d7
[flow] type adler32 ( #7080 )
...
This one is trivial
Test Plan:
npm run flow
Reviewers: @zpao @spicyj
2016-06-20 15:35:59 +02:00
Christopher Chedeau
12a6ad1ef5
[flow] type KeyEscapeUtils ( #7079 )
...
Summary:
The only call site ensures that the value is not null: https://github.com/facebook/react/blob/dc6fc8cc0726458a14f0544a30514af208d0098b/src/shared/utils/traverseAllChildren.js#L44
key is stringified inside of createElement, so we are guaranteed to receive a string right now: https://github.com/facebook/react/blob/dc6fc8cc0726458a14f0544a30514af208d0098b/src/isomorphic/classic/element/ReactElement.js#L142
Test Plan:
npm run flow
Reviewers: @zpao @spicyj
2016-06-19 21:58:21 +02:00
Christopher Chedeau
1c71970431
[flow] annotate accumulate and accumulateInto
...
Summary:
Trying to start adding flow types to files in React. I needed to add a script to package.json in order to run flow, flow-bin is already a dependency.
I had to rewrite the implementation a bit. Flow doesn't recognize
```
var currentIsArray = Array.isArray(current);
if (currentIsArray) {
// not refined
}
```
but the following does work
```
if (Array.isArray(current)) {
// refined
}
```
Test Plan:
npm run-script flow
npm run-script test accumulate
Reviewers: @zpao @spicyj
2016-06-16 17:33:32 +02:00
Keyan Zhang
1abce1630c
Add reactProdInvariant and corresponding babel rewrite pass ( #6948 )
2016-06-07 17:11:04 -07:00
Dmitrii Abramov
517ed859b4
Upgrade to Jasmine 2
2016-05-25 21:48:32 +01:00
Paul O’Shannessy
d8a0b9a662
Upgrade to jest-cli@0.9 and use Jasmine2
2016-05-25 21:48:32 +01:00
Keyan Zhang
47e49ae8b7
Add component stack info to key validation warnings ( #6799 )
...
* Add component stack info to key validation warnings
* Add `ReactComponentTreeDevtool.getStackAddendumByID`
2016-05-20 14:19:31 -07:00
Ben Alpert
ba9b985406
Rename host-y things to be "host" not "native" ( #6754 )
...
For clarity.
I left "native event" as-is because there's a lot of it, it's not particularly ambiguous, and SimulateNative/nativeTouchData are public API in ReactTestUtils.
2016-05-11 23:22:59 -07:00
Ben Alpert
98cb2f8507
Revert "Don't wrap drag events in IE/Edge in dev builds" ( #6741 )
2016-05-10 10:58:35 -07:00
cpojer
8e34514096
Update to Jest 12. Codemod to new Jest APIs.
2016-04-28 14:54:57 +09:00
Dan Abramov
2723323006
Remove OrderedMap and ReactPropTransferer
...
These are not exposed publicly and have been deprecated.
2016-04-27 17:44:02 +01:00
hkal
dc6fc8cc07
Helper for escaping and unescpaing component keys ( #6500 )
...
- Abstract escaping
- Provide human readible same key warnings
2016-04-15 20:55:37 -07:00
Jim
2e8f28c29f
Merge pull request #6364 from p-jackson/issue-5700
...
Don't wrap drag events in IE/Edge in dev builds
2016-04-07 14:11:12 -07:00
Paul O’Shannessy
1573baaee8
Use Object.assign directly and inject object-assign at compile
2016-04-04 09:53:25 -07:00
Philip Jackson
4687a03f54
Don't wrap drag events in IE/Edge in dev builds
...
Dev builds wrap synthetic events inside other events for a better debug
experience. However IE/Edge won't allow access to the
DataTransfer.dropEffect property if it's wrapped in this way.
The first time a drag event is fired, test if we're in an environment
that behaves this way and disable React's improved development
experience if we are.
2016-03-28 00:29:46 +13:00
Michael McDermott
18af9bc91e
Fixed some linting warnings and some mis-spacing in SyntheticEvent warnings.
2016-03-02 18:40:23 -05:00
Rick Beerendonk
bef45b0b1a
Year-agnostic copyright message, like React Native uses, to prevent the need for yearly changes.
2015-12-29 20:20:32 +01:00
Jim
3afced6a75
Error boundaries.
2015-12-16 12:15:26 -08:00
Ben Alpert
46f5251c66
Remove @typechecks
...
These don't really do anything.
```
codemod.py -d src --extensions js -m '\s* \* @typechecks.*?\n' '\n'
```
with "yes to all".
2015-12-10 11:26:45 -08:00
Ben Alpert
6b3ee0e74d
Merge pull request #5576 from spicyj/log-top-level
...
Log top-level renders with console.time
2015-12-01 11:34:40 -08:00
Ben Alpert
a0f88d29df
Log top-level renders with console.time
...
Behind a flag.
2015-12-01 11:29:13 -08:00
Paul O’Shannessy
f44a0778e3
Don't use key when defined on String, Number prototypes
2015-11-23 15:33:34 -08:00
Ben Alpert
ea31f924b8
Merge pull request #5368 from spicyj/adler32
...
adler32: Properly break loop into 4096-char blocks
2015-11-11 22:21:22 -08:00
Ben Alpert
b80f676d27
Add hooks back for devtools
2015-11-04 11:39:44 -08:00
Ben Alpert
35543c6312
Remove unused modules
...
- Remove last references to ReactInstanceHandles (still used in responder unit test)
- Remove ClientReactRootIndex/ServerReactRootIndex
2015-11-04 11:39:44 -08:00
Ben Alpert
ff6714064f
adler32: Properly break loop into 4096-char blocks
...
I believe this was lost in translation in #4400 . Can't say I fully understand why this is significant at all though...
2015-11-02 11:29:48 -08:00
Christoph Pojer
1384d43f53
Merge pull request #5321 from cpojer/update-tests
...
Update tests
2015-10-29 18:42:12 -07:00
Paul O’Shannessy
12c214a992
Merge pull request #5328 from zpao/non-native-event-name-dispatch
...
Use a custom event type for our event dispatching in ReactErrorUtils
2015-10-29 17:54:18 -07:00
Paul O’Shannessy
29523d0113
Use a custom event type for our event dispatching in ReactErrorUtils
...
It turns out that IE doesn't like when native events types are used. There may
have been more involved at play but this fixes the issue.
2015-10-29 15:39:14 -07:00
Paul O’Shannessy
d95a2239a8
Use a getter for canDefineProperty check.
...
This ensures that we treat es5-sham as a broken implementation of defineProperty and we won't try to use it.
2015-10-29 15:17:50 -07:00
cpojer
2ecfc4f8fb
Codemod old APIs away.
2015-10-29 12:40:52 -07:00
Timothy Yung
cdaea311a3
Remove "Invariant Violation: " from Invariant Error Messages
2015-10-16 16:09:28 -07:00
Ben Alpert
8e67b7f624
Merge pull request #4988 from spicyj/fdn
...
Walk down internal tree to find DOM node
2015-10-14 14:31:28 -07:00
Ben Alpert
5c5d2ec182
Walk down internal tree to find DOM node
...
This reduces our reliance on hierarchical IDs.
2015-10-14 14:22:53 -07:00
Ben Alpert
1206d8d2eb
Add feature test for document.createEvent
...
See #5157 .
2015-10-13 16:34:05 -07:00
Ben Alpert
6488a4c187
Use 'document.createEvent' not 'new Event'
...
Fixes #5153 .
This seems to work in all browsers I tested, including old Android and all IE > 8 which didn't work before.
2015-10-13 11:14:23 -07:00
Matias Singers
f8f2be05ce
Consistently use calls[n].args[n] instead of argsForCall[n][n] for Jasmine spies
2015-10-12 22:39:19 +08:00