Commit Graph

21 Commits

Author SHA1 Message Date
Andrey Marchenko d9915db43b Deleting a specific style name float for ie8 (#9311)
* Deleting a specific style name float for ie8

* Remove unnecessary condition
2017-03-31 23:31:52 +01:00
Sebastian Markbage 1843f87168 Run prettier 2017-03-13 17:05:18 -07:00
Sebastian Markbåge e452e33741 providesModule -> explicit requires for cross-package dependencies (#9078)
* Add forwarding modules

* Codemod to use full package path outside of own package

Files that require modules from a different package than their own now
does so by the npm path name instead of the providesModule.

* Codemod fbjs module dependencies

* Fix gulp module mapping config

This is a bit lame but because of our module rewrite we need to white
list all the paths that we don't *don't* want to rewrite.
2017-02-28 18:42:52 -08:00
Richie Thomas 469e68542b Added double newline delimiters to the following functions/files: (#8777)
* 'beginLifeCycleTimer' function of ReactDebugTool.js
            * 'bindAutoBindMethod' function of ReactClass.js
            * 'warnNoop' function of ReactServerUpdateQueue.js
            * 'getInternalInstanceReadyForUpdate' function of ReactUpdateQueue.js
            * 'warnNoop' function of ReactNoopUpdateQueue.js
            * 'getDeclarationErrorAddendum' function of ReactDOMComponent.js
            * 'getSourceInfoErrorAddendum' function of ReactElementValidator.js
            * 'getDeclarationErrorAddendum' function of instantiateReactComponent.js and ReactElementValidator.js
            * 'traverseAllChildrenImpl' function of traverseAllChildren.js
            * 'attachRef' function of ReactRef.js
            * 'mountIndeterminateComponent' function of ReactFiberBeginWork.js
            * 'createFiberFromElementType' function of ReactFiber.js
            * 'getDeclarationErrorAddendum' function of ReactDOMSelect.js
            * 'unmountComponentAtNode' function of ReactMount.js
            * 'getDeclarationErrorAddendum' function of ReactControlledValuePropTypes.js
            * 'checkRenderMessage' function of CSSPropertyOperations.js
            * 'getDeclarationErrorAddendum' function of ReactDomFiberSelect.js
            * 'getCurrentComponentErrorInfo' function in 'ReactElementValidator'
            * 'getDeclarationErrorAddendum' function in ReactDOMFiberComponent.js
2017-01-31 07:41:24 -06:00
Dan Abramov e36b38c1ca [Fiber] Fix some of the warnings (#8570)
* Implement component stack for some warnings in Fiber

* Keep Fiber debug source up to date

When an element changes, we should copy the source and owner again.
Otherwise they can get stale since we're not reading them from the element.

* Remove outdated TODOs from tests

* Explicitly specify Fiber types to include in the stack

Fixes an accidental omission when both source and owner are null but displayName exists.

* Fix mised Stack+Fiber test to not expect extra warnings

When we're in Fiber mode we don't actually expect that warning being printed.

* Warn on passing different props to super()

* Implement duplicate key warnings

We keep known keys in a set in development. There is an annoying special case where we know we'll check it again because we break out of the loop early.

One test in the tree hook regresses to the failing state because it checks that the tree hook works without a Set available, but we started using Set in this code. It is not essential and we can clean this up later when we decide how to deal with polyfills.

* Move ReactTypeOfWork to src/shared

It needs to be available both to Fiber and Isomorphic because the tree hook lives in Isomorphic but pretty-prints Fiber stack.

* Add dev-only ReactDebugCurrentFiber for warnings

The goal is to use ReactCurrentOwner less and rely on ReactDebugCurrentFiber for warning owner name and stack.

* Make Stack invariant messages more consistent

Fiber used a helper so two tests had the same phrasing.
Stack also used a helper for most invariants but hardcoded a different phrase in one place.
I changed that invariant message to use a helper which made it consistent with what it prints in Fiber.

* Make CSSPropertyOperations use getCurrentFiberOwnerName()

This gets mount-time CSS warnings to be printed.

However update-time warnings are currently ignored because current fiber is not yet available during the commit phase.

We also regress on HostOperation hook tests but this doesn't matter because it's only used by ReactPerf and it doesn't work with Fiber yet anyway. We'll have to think more about it later.

* Set ReactDebugCurrentFiber during the commit phase

This makes it available during updates, fixing the last failing test in CSSPropertyOperations.

* Add DOM warnings by calling hooks directly

It is not clear if the old hook system is worth it in its generic incarnation. For now I am just hooking it up to the DOMFiber renderer directly.

* Add client-side counterparts for some warning tests

This helps us track which warnings are really failing in Fiber, and which ones depend on SSR.
2016-12-15 08:36:58 -08:00
Dan Abramov c17bf38035 Get a few more Fiber tests passing (#8149)
* Get a few more Fiber tests passing

* Fix Flow and wrap in __DEV__
2016-10-30 00:43:34 +01:00
Christopher Chedeau eaefd9052a Type ReactHostOperationHistoryHook (#7672)
In order to properly type an `Operation`, we need to change the call site from having two arguments: one for `type` and one for `payload` into an object that contains both. This isn't a perf regression because we were already constructing this object in the first place and doesn't change the emitted event so shouldn't affect the dev tools.

None of the call sites are actually flow-ified so it isn't technically used but once we will, it'll make sure that we don't send random strings and payload through those very generic methods.
2016-09-07 20:08:09 -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
Dan Abramov 5f8f1f6c16 Delete the old ReactPerf 2016-05-03 14:21:28 +01:00
Dan Abramov aaadb31827 Add ReactNativeOperationHistoryDevtool to track native operations 2016-04-26 23:50:58 +01:00
Edvin Erikson 72f33ce892 added component name to css property warnings 2016-03-11 01:33:53 +01:00
Steven Vachon f68325f5d7 support standard "cssFloat" css property
For tools that compile CSS may have already converted the name.

More info:
https://npmjs.com/camelcase-css
https://npmjs.com/postcss-js
2016-02-27 01:13:15 -05:00
Jon Tewksbury 7a6000c093 Add warning for NaN in style object 2016-01-16 11:10:50 -08: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
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 276ef737fe Make ReactDOMComponent-test pass with useCreateElement 2015-11-03 17:03:40 -08:00
Alan Plum a299a366ce Fix #1357. Warn when appending "px" to strings. 2015-10-14 18:36:24 +02:00
Ben Alpert 7938650ca9 Make new perf unit test pass 2015-09-27 14:26:26 -07:00
Andreas Svensson f4f22a0baa Apply CSS shorthand expansion to IE8 only
Closes #1953.
2015-08-19 17:17:51 -07:00
Benjamin Woodruff c089eece50 Switch to using comma-dangle: always-multiline
This is a machine-generated codemod, but it's pretty safe since it was
generated by hooking into eslint's own report.

A few files had to be touched up by hand because there were existing
formatting issues with nested arrays/objects:

src/shared/utils/__tests__/OrderedMap-test.js
src/shared/utils/__tests__/Transaction-test.js
src/shared/utils/__tests__/traverseAllChildren-test.js
src/isomorphic/children/__tests__/ReactChildren-test.js
2015-06-02 16:57:26 -07:00
Sebastian Markbage 0b063f8a09 Reorganize Src Files for Isomorphic React Package
The new folder structure is organized around major packages that are expected to ship separately in some form.

`/isomorphic`

I moved classic/modern and children utils into a directory called "isomorphic" with the main export being ReactIsomorphic. This will eventually become the "react" package.

This includes all the dependencies that you might need to create a component without dependencies on the renderer/reconciler.

The rest moves into decoupled renderers.

`/renderers/dom/client` - This is the main renderer for DOM.

`/renderers/dom/server` - This is the server-side renderer for HTML strings.

`/addons` and `/test` - Same as before for now.

You're not supposed to take on a dependency inside another package.

Shared code is organized into a "shared" directory which is intended to support all the packages in that subdirectory. Meaning that once we swap to CommonJS modules, the only time you should use `..` is to target `../shared/` or `../../shared`.

E.g. `/shared/` is common utils that are used by everything.

`/renderers/shared/` is code that is shared by all renderers, such as the main reconciliation algorithm.

Shared code will likely be copied into each package rather than referenced. This allow us to have separate state and allow inlining and deadcode elimination.
2015-05-15 18:35:22 -07:00