Skip to content

Commit 998c193

Browse files
committed
[Float] Refactor public interface and internal HostDispatcher implementation (#27361)
When Float was first developed the internal implementation and external interface were the same. This is problematic for a few reasons. One, the public interface is typed but it is also untrusted and we should not assume that it is actually respected. Two, the internal implementations can get called from places other than the the public interface and having to construct an options argument that ends up being destructured to process the request is computationally wasteful and may limit JIT optimizations to some degree. Lastly, the wire format was not as compressed as it could be and it was untyped. This refactor aims to address that by separating the public interface from the internal implementations so we can solve these challenges and also make it easier to change Float in the future * The internal dispatcher method preinit is now preinitStyle and preinitScript. * The internal dispatcher method preinitModule is now preinitModuleScript in anticipation of different implementations for other module types in the future. * The wire format is explicitly typed and only includes options if they are actually used omitting undefined and nulls. * Some function arguments are not options even if they are optional. For instance precedence can be null/undefined because we deafult it to 'default' however we don't cosnider this an option because it is not something we transparently apply as props to the underlying instance. * Fixes a problem with keying images in flight where srcset and sizes were not being taken into account. * Moves argument validation into the ReactDOMFloat file where it is shared with all runtimes that expose these methods * Fixes crossOrigin serialization to use empty string except when 'use-credentials' DiffTrain build for [bbc8530](bbc8530)
1 parent afe6905 commit 998c193

21 files changed

+4743
-5287
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
bb1d8d166799eb97892be6c7826179270ba283d0
1+
bbc8530ed7a67859583a7c990ac51cd39c7746e5

compiled/facebook-www/React-dev.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (
2727
}
2828
"use strict";
2929

30-
var ReactVersion = "18.3.0-www-modern-1275e069";
30+
var ReactVersion = "18.3.0-www-modern-5ff32fc3";
3131

3232
// ATTENTION
3333
// When adding new symbols to this file,

0 commit comments

Comments
 (0)