-
Notifications
You must be signed in to change notification settings - Fork 47.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is an outline for the new reconciler infrastructure. I created a noop renderer to have something to get started from. I split the reconciler folder into old and new, as well as shared. I put shouldUpdateReactComponent in shared as an example of a utility that can easily be shared between both. I plan on breaking out more utilities like these.
- Loading branch information
1 parent
2c4dbc2
commit a81b218
Showing
23 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* Copyright 2013-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
* @providesModule ReactNoop | ||
* @flow | ||
*/ | ||
|
||
/** | ||
* This is a renderer of React that doesn't have a render target output. | ||
* It is useful to demonstrate the internals of the reconciler in isolation | ||
* and for testing semantics of reconciliation separate from the host | ||
* environment. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
var ReactNewReconciler = require('ReactNewReconciler'); | ||
|
||
var NoopRenderer = ReactNewReconciler({ | ||
|
||
createHostInstance() { | ||
|
||
} | ||
|
||
}); | ||
|
||
var ReactNoop = { | ||
|
||
render(element : ReactElement) { | ||
|
||
} | ||
|
||
}; | ||
|
||
module.exports = ReactNoop; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* Copyright 2013-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
* @providesModule ReactFiber | ||
* @flow | ||
*/ | ||
|
||
'use strict'; | ||
|
||
type EffectTag = number; | ||
|
||
export type Fiber = { | ||
|
||
handlerTag: EffectTag | ||
|
||
}; | ||
|
||
module.exports = function() : Fiber { | ||
return { | ||
|
||
handlerTag: 0 | ||
|
||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/** | ||
* Copyright 2013-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
* @providesModule ReactNewReconciler | ||
* @flow | ||
*/ | ||
|
||
'use strict'; | ||
|
||
type ReactHostElement<T, P> = { | ||
type: T, | ||
props: P | ||
}; | ||
|
||
export type HostConfig<T, P, I> = { | ||
|
||
createHostInstance(element : ReactHostElement) : I | ||
|
||
}; | ||
|
||
export type Reconciler = { | ||
mountNewRoot(element : ReactElement) : void; | ||
}; | ||
|
||
module.exports = function<T, P, I>(config : HostConfig<T, P, I>) : Reconciler { | ||
return { | ||
|
||
mountNewRoot() { | ||
|
||
} | ||
|
||
}; | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.