Skip to content

Commit

Permalink
Implements wiring for Flight to have it's own "HostConfig" (#26590)
Browse files Browse the repository at this point in the history
This reverts commit 9429ec9.

DiffTrain build for [cdf4588](cdf4588)
  • Loading branch information
kassens committed Apr 20, 2023
1 parent 1f49af9 commit 6325f82
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 587 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1d3ffd9d9addb4aa0988b92ee6917c07c3c261ae
cdf4588242e1dc0c9b29f7539d9ae97d216d03d4
243 changes: 3 additions & 240 deletions compiled/facebook-www/ReactFlightDOMRelayServer-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,246 +189,6 @@ function getIteratorFn(maybeIterable) {
return null;
}

// Re-export dynamic flags from the www version.
require("ReactFeatureFlags");

// A simple string attribute.
// Attributes that aren't in the filter are presumed to have this type.
var STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called
// "enumerated" attributes with "true" and "false" as possible values.
// When true, it should be set to a "true" string.
// When false, it should be set to a "false" string.

var BOOLEANISH_STRING = 2; // A real boolean attribute.
// When true, it should be present (set either to an empty string or its name).
// When false, it should be omitted.

var BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value.
// When true, it should be present (set either to an empty string or its name).
// When false, it should be omitted.
// For any other value, should be present with that value.

var OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric.
// When falsy, it should be removed.

var NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric.

function PropertyInfoRecord(
type,
attributeName,
attributeNamespace,
sanitizeURL,
removeEmptyString
) {
this.acceptsBooleans =
type === BOOLEANISH_STRING ||
type === BOOLEAN ||
type === OVERLOADED_BOOLEAN;
this.attributeName = attributeName;
this.attributeNamespace = attributeNamespace;
this.type = type;
this.sanitizeURL = sanitizeURL;
this.removeEmptyString = removeEmptyString;
} // When adding attributes to this list, be sure to also add them to
// In React, we let users pass `true` and `false` even though technically
// these aren't boolean attributes (they are coerced to strings).

["contentEditable", "draggable", "spellCheck", "value"].forEach(function (
name
) {
// $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions
new PropertyInfoRecord(
BOOLEANISH_STRING,
name.toLowerCase(), // attributeName
null, // attributeNamespace
false, // sanitizeURL
false
);
}); // These are "enumerated" SVG attributes that accept "true" and "false".

[
"allowFullScreen",
"async", // Note: there is a special case that prevents it from being written to the DOM
// on the client side because the browsers are inconsistent. Instead we call focus().
"autoFocus",
"autoPlay",
"controls",
"default",
"defer",
"disabled",
"disablePictureInPicture",
"disableRemotePlayback",
"formNoValidate",
"hidden",
"loop",
"noModule",
"noValidate",
"open",
"playsInline",
"readOnly",
"required",
"reversed",
"scoped",
"seamless", // Microdata
"itemScope"
].forEach(function (name) {
// $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions
new PropertyInfoRecord(
BOOLEAN,
name.toLowerCase(), // attributeName
null, // attributeNamespace
false, // sanitizeURL
false
);
}); // These are HTML attributes that are "overloaded booleans": they behave like

["rowSpan", "start"].forEach(function (name) {
// $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions
new PropertyInfoRecord(
NUMERIC,
name.toLowerCase(), // attributeName
null, // attributeNamespace
false, // sanitizeURL
false
);
});
var CAMELIZE = /[\-\:]([a-z])/g;

var capitalize = function (token) {
return token[1].toUpperCase();
}; // This is a list of all SVG attributes that need special casing, namespacing,
// or boolean value assignment. Regular attributes that just accept strings
// and have the same names are omitted, just like in the HTML attribute filter.
// Some of these attributes can be hard to find. This list was created by
// scraping the MDN documentation.

[
"accent-height",
"alignment-baseline",
"arabic-form",
"baseline-shift",
"cap-height",
"clip-path",
"clip-rule",
"color-interpolation",
"color-interpolation-filters",
"color-profile",
"color-rendering",
"dominant-baseline",
"enable-background",
"fill-opacity",
"fill-rule",
"flood-color",
"flood-opacity",
"font-family",
"font-size",
"font-size-adjust",
"font-stretch",
"font-style",
"font-variant",
"font-weight",
"glyph-name",
"glyph-orientation-horizontal",
"glyph-orientation-vertical",
"horiz-adv-x",
"horiz-origin-x",
"image-rendering",
"letter-spacing",
"lighting-color",
"marker-end",
"marker-mid",
"marker-start",
"overline-position",
"overline-thickness",
"paint-order",
"panose-1",
"pointer-events",
"rendering-intent",
"shape-rendering",
"stop-color",
"stop-opacity",
"strikethrough-position",
"strikethrough-thickness",
"stroke-dasharray",
"stroke-dashoffset",
"stroke-linecap",
"stroke-linejoin",
"stroke-miterlimit",
"stroke-opacity",
"stroke-width",
"text-anchor",
"text-decoration",
"text-rendering",
"transform-origin",
"underline-position",
"underline-thickness",
"unicode-bidi",
"unicode-range",
"units-per-em",
"v-alphabetic",
"v-hanging",
"v-ideographic",
"v-mathematical",
"vector-effect",
"vert-adv-y",
"vert-origin-x",
"vert-origin-y",
"word-spacing",
"writing-mode",
"xmlns:xlink",
"x-height" // NOTE: if you add a camelCased prop to this list,
// you'll need to set attributeName to name.toLowerCase()
// instead in the assignment below.
].forEach(function (attributeName) {
attributeName.replace(CAMELIZE, capitalize); // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions
}); // String SVG attributes with the xlink namespace.

[
"xlink:actuate",
"xlink:arcrole",
"xlink:role",
"xlink:show",
"xlink:title",
"xlink:type" // NOTE: if you add a camelCased prop to this list,
// you'll need to set attributeName to name.toLowerCase()
// instead in the assignment below.
].forEach(function (attributeName) {
attributeName.replace(CAMELIZE, capitalize); // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions
}); // String SVG attributes with the xml namespace.

[
"xml:base",
"xml:lang",
"xml:space" // NOTE: if you add a camelCased prop to this list,
// you'll need to set attributeName to name.toLowerCase()
// instead in the assignment below.
].forEach(function (attributeName) {
attributeName.replace(CAMELIZE, capitalize); // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions
}); // These attribute exists both in HTML and SVG.
// The attribute name is case-sensitive in SVG so we can't just use
// the React name like we do for attributes that exist only in HTML.

["tabIndex", "crossOrigin"].forEach(function (attributeName) {
// $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions
new PropertyInfoRecord(
STRING,
attributeName.toLowerCase(), // attributeName
null, // attributeNamespace
false, // sanitizeURL
false
);
}); // These attributes accept URLs. These must not allow javascript: URLS.
["src", "href", "action"].forEach(function (attributeName) {
// $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions
new PropertyInfoRecord(
STRING,
attributeName.toLowerCase(), // attributeName
null, // attributeNamespace
true, // sanitizeURL
true
);
});

var rendererSigil;

{
Expand Down Expand Up @@ -637,6 +397,9 @@ function readContext$1(context) {
return value;
}

// Re-export dynamic flags from the www version.
require("ReactFeatureFlags");

// Corresponds to ReactFiberWakeable and ReactFizzWakeable modules. Generally,
// changes to one module should be reflected in the others.
// TODO: Rename this module and the corresponding Fiber one to "Thenable"
Expand Down
Loading

0 comments on commit 6325f82

Please sign in to comment.