Commit Graph

94 Commits

Author SHA1 Message Date
Brian Vaughn
2fa38ac1cc Delete ReactNativeStack 🎉 🎉 🎉 (#10511)
* Removed createReactNativeComponentClassStack and renamed createReactNativeComponentClassFiber => createReactNativeComponentClass

* Removed findNumericNodeHandleStack and renamed findNumericNodeHandleFiber => findNumericNodeHandle

* Renamed ReactNativeFiberEntry => ReactNativeEntry

* Removed all references to ReactNativeFeatureFlags and RN stack

* Removed severl RN modules that are no longer used

* Renamed ReactNativeEntry => ReactNativeFiberEntry for now. We'll probably remove 'fiber' references later

* Update build results json

* Deleted snapshot

* Re-add accidentally deleted test

* Remove now-unnecessary hack in test

* Fix lint

* RN findNodeHandle no longer adds props directly to read-only owner (#10520)

* Added ReactNativeMount-test snapshot for 'renders and reorders children' test
2017-08-23 15:53:55 -07:00
Brian Vaughn
e464cf2def Removed ReactNativeFeatureFlag shim from RN bundle (#10472) 2017-08-18 08:26:11 -07:00
Brandon Dail
5ff5700625 Add explicit invariant when ReactDOM is loaded w/o React (#10449) 2017-08-13 13:16:13 -05:00
Sasha Aickin
4d08914985 Fix for #10388. Renames renderToStream to renderToNodeStream. (#10425) 2017-08-10 12:23:00 -07:00
Brian Vaughn
8b1b0720cc Wrap warning() calls in a DEV check for RN_* builds too (#10428)
* Wrap warning() calls in a DEV check for RN_* builds too.
* Wrapped several warning() imports and calls in if-DEV checks.
* Removed a useless variable (allTypesByEventName) and loop from ReactNativeBridgeEventPlugin.
2017-08-10 08:41:51 -07:00
Dominic Gannaway
e97143cca5 Use Closure Compiler for UMD/Node bundles instead of Uglify (#10236)
* Use GCC instead of Uglify for UMD/NODE bundles

* Prettier run

* Fixes fixtures that were alterated by Pretter and trailing function commas

* prettier on prettier

* updated prettier config

* altered prettier config slightly

* Reverted prettier changes

* updated results.json
2017-08-10 11:12:29 +01:00
Brian Vaughn
c3718c48f0 16 beta 5 version bump and results JSON 2017-08-08 10:25:25 -07:00
Brian Vaughn
9ebd0c9e9a Updated packages and results JSON for 16 beta 4 2017-08-08 09:08:17 -07:00
Dan Abramov
327d126392 Move PooledClass to Stack folder (#10386) 2017-08-04 19:10:07 +01:00
Brandon Dail
755724a24c Implement event-specific pooling for SyntheticEvent (#10237)
* Remove PooledClass from FallbackCompositionState

The only module that uses FallbackCompositonState is BeforeInputEventPlugin. The way its structured means there can only be a single instance of FallbackCompositionState at any given time (stored in a local variable at the top-level) so we don't really need pooling here at all. Instead, a single object is now stored in FallbackCompositionState, and access (initializing, reseting, getting data) is gaurded by the exported helper object.

* Use new FallbackCompositionState API in BeforeInputEventPlugin

* Implement event-specific pooling in SyntheticEvent

* Remove PooledClass from TopLevelCallbackBookKeeping

* Update results.json

* Add pooled event test fixtures (#1)

* Fix fixture lint
2017-08-04 18:24:48 +01:00
Brian Vaughn
230d41218e Built 16.0.0 beta 3. Updated versions, results.json, and error codes 2017-08-03 16:05:28 -07:00
Dan Abramov
fc86ef0f3d Use single entry point for SSR via browser field (#10362)
* Use single entry point for SSR via browser field

* Add server.browser entry point and smoke tests

* Tweak bundle naming

* Fix import

* Re-record

* Fix the robot nits

* Add resetModules for some extra isolation
2017-08-03 00:41:09 +01:00
Brian Vaughn
630afb3186 Wrap contents of if-DEV condition in an IIFE (#10361)
This avoids strict mode conflicts for certain browsers wrt functions being defined within an if-block.
Also re-added the if-DEV condition for the ReactNative renderer since it was removed for this reason.
2017-08-02 14:24:43 -07:00
Brian Vaughn
f3e502c613 FB bundles wrap warning() calls in __DEV__ (#10314)
FB bundles wrap warning() calls in __DEV__

Split dev-mode transforms into separate parts:
1) umd+cjs+fb: Wrap warning calls with process.env checks
2) umd+cjs: Replace error messages with minified codes

Also updated transforms to use __DEV__ since it transforms to smaller code after stripEnvVariables is run.

Also renamed 'scripts/error-codes/dev-expression-with-codes.js' -> 'scripts/error-codes/replace-invariant-error-codes.js'
2017-08-02 14:14:26 -07:00
Michał Pierzchała
73217a74a0 Fix error-codes not updating correctly (#10348)
* Fix error-codes not updating correctly

* Revert changes to codes.json
2017-08-02 10:38:27 +01:00
Dominic Gannaway
ca46c5278f Move line to within DEV block (#10316)
* move line to within DEV block

* addressed code review feedback
2017-07-27 17:31:34 -07:00
Dan Abramov
138224f6b3 16.0.0-beta.2 2017-07-27 18:06:26 +01:00
Keyan Zhang
3abbcc48a5 Fix ReactPartialRenderer in production (#10300) 2017-07-27 10:19:05 +01:00
Brian Vaughn
834d2c6954 Updated package versions and Rollup results 2017-07-26 12:55:31 -07:00
Brian Vaughn
8d5f2c4324 Regenerate error codes and update bundle size stats (#10287) 2017-07-26 11:21:43 -07:00
Dan Abramov
66065115dc Update sizes 2017-07-26 12:27:29 +01:00
Dan Abramov
240b84ed8e Remove PooledClass from isomorphic build (#10227)
* Inline traverseAllChildren into ReactChildren

* Remove ForEachBookKeeping

* Inline traversal pooling logic into ReactChildren

* Reuse emptyFunction for dummy callback

* Move code around

* Record sizes
2017-07-20 15:56:49 +01:00
Dominic Gannaway
357925a84e Move DEV only module requires into __DEV__ blocks (#10185)
* modulesToStub cleaned up and DEV only modules put into __DEV__ blocks

* prettier run

* Prettier + new build run for bundle sizes
2017-07-19 17:28:55 +02:00
Dan Abramov
9254ce27a8 Split markup generation from DOM property management (#10197)
* Replace SSR unit test with integration test

* Remove unit test that is already covered by integration suite

* Replace unit tests for boolean attrs with integration tests

* Replace unit test for aria attrs with integration test

* Replace unit tests for numeric 0 with integration tests

* Remove unit test covered by integration tests

* Replace unit test for injection with integration test

It still touches internals but it tests both renderers.

* Fork DOMPropertyOperations into DOMMarkupOperations

* Trim down DOMPropertyOperations and DOMMarkupOperations

* Record SSR sizes

* Record them tests

* Fix false positive warning for overloaded booleans when passing numbers

* Remove stray import

* Replace CSS markup tests with public API tests

Some of these are handy as integration tests so I moved them there.
But some test markup specifically so I changed them to use DOMServer.

* Make CSSPropertyOperations client-only

I forked createMarkupForStyles() into ReactDOMComponent and ReactPartialRenderer. Duplication is fine because one of them will soon be gone (guess which one!)

The warnInvalidStyle helper is used by both server and client, unlike other client-only stuff in CSSPropertyOperations, so I moved it to a separately module used in both.

* Record server bundle size

* Add an early exit to validation

* Clarify what is being duplicated
2017-07-19 14:06:53 +01:00
Dan Abramov
c2ed1b87dc Record sizes 2017-07-18 20:06:17 +01:00
Sebastian Markbåge
3b5e3b5a23 Refactor Debug Frames to Enable Renderers to Provide Custom Logic (#10105)
* Extract the top element frame from ReactDebugCurrentFrame

This is part of a larger refactor to decouple stack addendums. All
renderers have their own way of getting the stack of the currently
executing components.

There is one special case in Element Validator that adds an additional line
for the element being validated. This commit moves that special case in
into the validator.

There is another case where it looked like this was used in shallow
renderer but this is actually something different. It is part of the
component stack. It just happens to be that shallow renderer has a simpler
implementation of the component stack that just happens to be a single
element.

This will let us decouple the implementation to get a stack from
ReactDebugCurrentFrame and put that in each renderer.

* Stop using ReactComponentTreeHook for Fiber

Currently we fall back to ReactCurrentOwner in ReactComponentTreeHook for
stack addendums. We shouldn't need to because we should use
ReactDebugCurrrentFiber.

Ensure we always set both ReactDebugCurrentFiber and ReactDebugCurrentFrame
so that we can rely on these for all stacks.

* Make ReactDebugCurrentFrame implementation independent

Introduced ReactDebugCurrentStack for the Stack renderer which does the
same thing as ReactDebugCurrentFiber.

ReactDebugCurrentFrame no longer keeps track of the current fiber/debug id.
That's handled by the individual renderers.

Instead, it is now used to keep track of the current *implementation* of
the current stack frame. That way it is decoupled from the specifics of
the renderers. There can be multiple renderers in a context. What matters
is which one is currently executing a debuggable context (such as a render
function).

* Add debug frames to ReactPartialRenderer (ssr)

Basic functionality.

* Add shared modules to shallow renderer

This is now needed because we share describeComponentFrame.
2017-07-14 15:36:24 -07:00
Dan Abramov
0070925a4f Don't use Stack-only helper in new SSR (#10174) 2017-07-13 19:55:48 +01:00
Dan Abramov
7dd7c1702b Remove dependency to event system on the server (#10173)
I do this by splitting ReactDOMInjection into generic and client-only injection.
2017-07-13 19:32:27 +01:00
Brian Vaughn
5495e495de Remove conditional __DEV__ wrapper from RN bundles (#10171)
This causes an error with the older version of JSC packaged for Android.
2017-07-13 09:26:45 -07:00
Peter Ruibal
cff012fc16 Add react-dom-unstable-native-dependencies (#10138)
* Add react-dom-unstable-native-dependencies

react-native-web and react-primitives currently access a few internals
for shimming DOM events into native ones.  Changes in react@16 packaging
hide these internals completely.  This change adds a submodule to react-dom,
unstable-native-dependencies that includes the necessary modules to
continue enabling that method of dom-native event injection.

* Update ResponderEventPlugin to use "public" interfaces for test

In order to get some sort of smoke testing on
react-dom-unstable-native-dependencies, update ResponderEventPlugin-test
to use the "public" interfaces provided by react-dom and the new
react-dom/unstable-native dependencies

Also adds the missing references in package.json as well as missing
files required for unittests to do imports correctrly

Also exports injectComponentTree() which is required for the unittests
to re-set the shared component state between runs.

* Tweak bundle comment

* Bundle content updates from exporting injectComponentTree

* Added FB_DEV, FB_PROD to bundle types

* Run yarn prettier for -unstable-native-dependencies updates
2017-07-12 02:27:26 +01:00
Ben Alpert
21df484f25 Don't build ReactDOMNodeStream for FB (#10065)
require('stream') doesn't work for us right now.
2017-06-28 16:13:58 -07:00
Sasha Aickin
411e04bd71 Add ReactDOMNodeStream, adding streaming rendering. (#10024)
* Add ReactDOMNodeStream, adding ability to stream generated HTML.

* Forgot to rename a documentation page.

* Tests are passing locally but failing on CI; attempt to fix that with this tweak.

* Adding some debugging info to try to track down CI problem.

* More debugging of CI. Yay for printf debugging.

* More printf debugging of CI to figure out what is going on with includes during tests.

* I made a truly stupid error with my printf debugging statements for CI. Fixing that.

* And another dumb copy and paste typo.

* The node-stream.js stub for tests wasn't being added because of .gitignore.

* Fix for code review coment https://github.com/facebook/react/pull/10024#discussion_r123606138 . Thanks to @razh for helping me out.

* Removing all the console.logs I put in to debug the build problems on the CI server.

* Fix for code review coment https://github.com/facebook/react/pull/10024#discussion_r123628227 . Thanks to @aweary for the suggestion.

* Response to code review comment https://github.com/facebook/react/pull/10024#discussion_r123649131 . Thanks, @gaearon.

* Responding to code comments https://github.com/facebook/react/pull/10024#pullrequestreview-46104491 , https://github.com/facebook/react/pull/10024#pullrequestreview-46104616 , and https://github.com/facebook/react/pull/10024#pullrequestreview-46104822 . Thanks to @sebmarkbage for the help.

* Attempt to tweak spacing to see if it makes the prettier build step happy.

* Found a prettier bug that wasn't being reported by npm run prettier for some reason.

* Fixed a small prettier issue
2017-06-24 22:31:42 -07:00
Dan Abramov
fa98ecba9f Remove Stack-only www shim code (#10019) 2017-06-22 02:38:02 +01:00
Dan Abramov
8e251c5416 Remove unused www shims (#10018)
* Remove unused www shims

* Delete ReactElement.js
2017-06-21 19:10:45 +01:00
Dan Abramov
e68e95284b Remove more isomorphic www shims (#10007) 2017-06-21 17:54:11 +01:00
Andrew Clark
812244b57a Remove Animation priority
There's no advantage to scheduling updates with animation priority
versus scheduling sync work inside requestAnimationCallback. So we can
remove all the animation-specific code. Now there's only one type of
callback.
2017-06-19 09:53:19 -07:00
Andrew Clark
6a0c56cffc ReactNoop.flush methods return an array of yielded values
Allows us to make assertions on the values that are yielded when
performing work. In our existing tests, we do this manually by pushing
into an array.

ReactNoop.flushThrough extends this concept. It accepts an array of
expected values and flushes until those values are yielded.
2017-06-19 09:53:19 -07:00
Dominic Gannaway
54e8478a3d Move out more ReactDOM FB shims (#9987)
* move out further ReactDOM shims from FB

* fixed a typo
2017-06-16 15:41:47 +02:00
Dominic Gannaway
52e13922b5 removes Synthetic event forwarding module shims (#9945) 2017-06-15 17:07:34 +01:00
Dan Abramov
310a6c4fc1 Wrap all non-UMD DEV bundles into a condition (#9969)
* Wrap all non-UMD DEV bundles into a condition

* Update header.js

* Create header.js
2017-06-15 00:53:22 +01:00
Dan Abramov
7dc27d35c1 Streamline Fiber/Stack testing and bundling setup a little bit (#9964)
* Remove internal forwarding modules for /lib/

* Add *Entry suffix to all entry points

* Don't bundle ReactNativeFeatureFlags since it's shimmed

* Delete TestRendererStack

* Switch tests at forwarding modules rather than via Jest

* Share mocks between regular and equivalence fixtures

* Rename environment flag to be more generic

* Remove accidental variable name change

* Minor naming changes for consistency

Files that have two versions get the engine in variable name.
2017-06-14 22:10:33 +01:00
Taehwan, No
35ae38db2f Remove addons path deleted in #9209 (#9921) 2017-06-11 20:23:40 +01:00
Dan Abramov
7cd6fd2bc1 Don't build ReactDOMServerStack (#9916) 2017-06-10 18:08:05 +01:00
Dan Abramov
47731c9f74 16.0.0-alpha.13 2017-06-09 15:00:01 +01:00
Dominic Gannaway
eadc2b1b7f remove alder32.js (#9905) 2017-06-09 15:19:16 +02:00
Dan Abramov
5c6a496d98 Inline some internals, reduce shared/ utilities between isomorphic and renderers (#9903)
* Make ReactControlledValuePropTypes DEV-only

* Remove canDefineProperty

This breaks IE8. We don't support it.

* Remove getNextDebugID

It was added temporarily to avoid Stack shared state issues across renderers.
Not a problem anymore.

* Make KeyEscapeUtils.unescape() DEV-only

* Remove unused deprecated() module

It's unlikely we'll deprecate anything else on React.* object soon.

* Inline getIteratorFn at the call sites

* Inline ReactElementSymbol

* Inline KeyEscapeUtils into Children and move the file into Stack

It's only used in one place in isomorphic.
It's used more broadly in Stack so we move it there to die.

* Update artifacts

* Reorder declarations for consistency

* Fix Flow
2017-06-09 12:41:50 +01:00
Dan Abramov
9ff53dd0f4 Rebuild sizes 2017-06-09 00:47:49 +01:00
Dan Abramov
6ab0531d68 Exclude Stack from DOMServerStream (#9896) 2017-06-08 19:41:02 +01:00
Brian Vaughn
7b16a46e0c Updated label in build-script (#9871)
Changed from "STARTING" to "BUILDING"
2017-06-06 14:54:35 -07:00
Dan Abramov
f50c4c9a43 Stop building ReactTestRendererStack (#9870)
* Stop building ReactTestRendererStack

We no longer use it.

* Remove now-unused sizes in JSON stats
2017-06-06 22:23:16 +01:00