Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fizz/Float] Float for stylesheet resources #25243

Merged
merged 35 commits into from
Sep 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
09c091d
[Fizz/Float] Float for stylesheet resources
gnoff Jun 10, 2022
589485d
determine preamble while flushing and make postamble resilient to asy…
gnoff Sep 28, 2022
b562d26
refactor render prep
gnoff Sep 28, 2022
ca98449
setCurrentlyRenderingBoundaryResources => setCurrentlyRenderingBounda…
gnoff Sep 28, 2022
72bbd2c
fixes
gnoff Sep 28, 2022
52b1388
add react-dom to fizz entry externals
gnoff Sep 28, 2022
d3bffc2
refactor default dispatcher initialization
gnoff Sep 28, 2022
24a8638
set default dispatcher in creatRoot and hydra
gnoff Sep 29, 2022
f06f1ad
clarify render start and stop function names
gnoff Sep 29, 2022
3793c2e
make TODO proper TODO and cleanup comments
gnoff Sep 29, 2022
16be133
integrate push/pop dispatcher with renderer prep / reset
gnoff Sep 29, 2022
0dc98d2
forks
gnoff Sep 29, 2022
9956a77
wip insertstyles
gnoff Sep 29, 2022
eec88a3
wip
gnoff Sep 29, 2022
e2bc267
wip fixes
gnoff Sep 29, 2022
0af21ba
query for existing styles in acquisition instead of construction. rem…
gnoff Sep 29, 2022
8da096c
revert to request based preamble
gnoff Sep 29, 2022
02984d7
cleanup style insertion scripts
gnoff Sep 29, 2022
52d2e66
lint
gnoff Sep 29, 2022
db245b0
remove rootDidFlush
gnoff Sep 29, 2022
4987d19
fix test
gnoff Sep 29, 2022
1dba4c0
remove extraneous preamableopen
gnoff Sep 29, 2022
3704af3
add react-dom external to flight entries
gnoff Sep 29, 2022
4d30694
types
gnoff Sep 30, 2022
33fa6e1
make insert style script slightly smaller
gnoff Sep 30, 2022
a0bf190
add react-dom externals
gnoff Sep 30, 2022
763fadc
fix double call of hasStyleResourceDependencies
gnoff Sep 30, 2022
3f3f9d5
remove special casing of precedence prop
gnoff Sep 30, 2022
f1925a8
escape hrefs in document queries
gnoff Sep 30, 2022
b845eff
use a stack for currentResources
gnoff Sep 30, 2022
7c45420
lints
gnoff Sep 30, 2022
17fde2c
flow
gnoff Sep 30, 2022
b544927
escape newline in attribute selector
gnoff Sep 30, 2022
5ebdce8
remove unecessary export
gnoff Sep 30, 2022
1ccdb00
nits
gnoff Sep 30, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/react-art/src/ReactARTHostConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ export * from 'react-reconciler/src/ReactFiberHostConfigWithNoHydration';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoScopes';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoTestSelectors';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoMicrotasks';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoResources';

export function appendInitialChild(parentInstance, child) {
if (typeof child === 'string') {
Expand Down Expand Up @@ -455,3 +456,11 @@ export function detachDeletedInstance(node: Instance): void {
export function requestPostPaintCallback(callback: (time: number) => void) {
// noop
}

export function prepareRendererToRender(container: Container): void {
// noop
}

export function resetRendererAfterRender(): void {
// noop
}
12 changes: 0 additions & 12 deletions packages/react-dom-bindings/src/client/ReactDOMComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ import {
enableTrustedTypesIntegration,
enableCustomElementPropertySupport,
enableClientRenderFallbackOnTextMismatch,
enableFloat,
} from 'shared/ReactFeatureFlags';
import {
mediaEventTypes,
Expand Down Expand Up @@ -1019,17 +1018,6 @@ export function diffHydratedProperties(
: getPropertyInfo(propKey);
if (rawProps[SUPPRESS_HYDRATION_WARNING] === true) {
// Don't bother comparing. We're ignoring all these warnings.
} else if (
enableFloat &&
tag === 'link' &&
rawProps.rel === 'stylesheet' &&
propKey === 'precedence'
) {
// @TODO this is a temporary rule while we haven't implemented HostResources yet. This is used to allow
// for hydrating Resources (at the moment, stylesheets with a precedence prop) by using a data attribute.
// When we implement HostResources there will be no hydration directly so this code can be deleted
// $FlowFixMe - Should be inferred as not undefined.
extraAttributeNames.delete('data-rprec');
} else if (
propKey === SUPPRESS_CONTENT_EDITABLE_WARNING ||
propKey === SUPPRESS_HYDRATION_WARNING ||
Expand Down
12 changes: 9 additions & 3 deletions packages/react-dom-bindings/src/client/ReactDOMComponentTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ import type {

import {
HostComponent,
HostResource,
HostText,
HostRoot,
SuspenseComponent,
} from 'react-reconciler/src/ReactWorkTags';

import {getParentSuspenseInstance} from './ReactDOMHostConfig';

import {enableScopeAPI} from 'shared/ReactFeatureFlags';
import {enableScopeAPI, enableFloat} from 'shared/ReactFeatureFlags';

const randomKey = Math.random()
.toString(36)
Expand Down Expand Up @@ -166,7 +167,8 @@ export function getInstanceFromNode(node: Node): Fiber | null {
inst.tag === HostComponent ||
inst.tag === HostText ||
inst.tag === SuspenseComponent ||
inst.tag === HostRoot
inst.tag === HostRoot ||
(enableFloat ? inst.tag === HostResource : false)
) {
return inst;
} else {
Expand All @@ -181,7 +183,11 @@ export function getInstanceFromNode(node: Node): Fiber | null {
* DOM node.
*/
export function getNodeFromInstance(inst: Fiber): Instance | TextInstance {
if (inst.tag === HostComponent || inst.tag === HostText) {
if (
inst.tag === HostComponent ||
inst.tag === HostText ||
(enableFloat ? inst.tag === HostResource : false)
) {
// In Fiber this, is just the state node right now. We assume it will be
// a host component or host text.
return inst.stateNode;
Expand Down
Loading