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

Update vendored React packages to next-41110021f #46636

Merged
merged 2 commits into from
Mar 1, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,11 @@
"random-seed": "0.3.0",
"react": "18.2.0",
"react-17": "npm:react@17.0.2",
"react-builtin": "npm:react@18.3.0-next-bfb9cbd8c-20230223",
"react-builtin": "npm:react@18.3.0-next-41110021f-20230301",
"react-dom": "18.2.0",
"react-dom-17": "npm:react-dom@17.0.2",
"react-dom-builtin": "npm:react-dom@18.3.0-next-bfb9cbd8c-20230223",
"react-server-dom-webpack": "18.3.0-next-bfb9cbd8c-20230223",
"react-dom-builtin": "npm:react-dom@18.3.0-next-41110021f-20230301",
"react-server-dom-webpack": "18.3.0-next-41110021f-20230301",
"react-ssr-prepass": "1.0.8",
"react-virtualized": "9.22.3",
"relay-compiler": "13.0.2",
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") {
var React = require('react');
var ReactDOM = require('react-dom');

var ReactVersion = '18.3.0-next-bfb9cbd8c-20230223';
var ReactVersion = '18.3.0-next-41110021f-20230301';

var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

Expand Down Expand Up @@ -2007,6 +2007,8 @@ var ReactDOMSharedInternals = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL

var ReactDOMCurrentDispatcher = ReactDOMSharedInternals.Dispatcher;
var ReactDOMServerDispatcher = {
prefetchDNS: prefetchDNS,
preconnect: preconnect,
preload: preload,
preinit: preinit
} ;
Expand Down Expand Up @@ -4551,7 +4553,10 @@ function writePreamble(destination, resources, responseState, willFlushAllSegmen
writeChunk(destination, charsetChunks[i]);
}

charsetChunks.length = 0;
charsetChunks.length = 0; // emit preconnect resources

resources.preconnects.forEach(flushResourceInPreamble, destination);
resources.preconnects.clear();
var preconnectChunks = responseState.preconnectChunks;

for (i = 0; i < preconnectChunks.length; i++) {
Expand Down Expand Up @@ -4624,6 +4629,8 @@ function writeHoistables(destination, resources, responseState) {
// We omit charsetChunks because we have already sent the shell and if it wasn't
// already sent it is too late now.

resources.preconnects.forEach(flushResourceLate, destination);
resources.preconnects.clear();
var preconnectChunks = responseState.preconnectChunks;

for (i = 0; i < preconnectChunks.length; i++) {
Expand Down Expand Up @@ -4911,9 +4918,11 @@ function createResources() {
return {
// persistent
preloadsMap: new Map(),
preconnectsMap: new Map(),
stylesMap: new Map(),
scriptsMap: new Map(),
// cleared on flush
preconnects: new Set(),
fontPreloads: new Set(),
// usedImagePreloads: new Set(),
precedences: new Map(),
Expand All @@ -4939,6 +4948,98 @@ function getResourceKey(as, href) {
return "[" + as + "]" + href;
}

function prefetchDNS(href, options) {
if (!currentResources) {
// While we expect that preconnect calls are primarily going to be observed
// during render because effects and events don't run on the server it is
// still possible that these get called in module scope. This is valid on
// the client since there is still a document to interact with but on the
// server we need a request to associate the call to. Because of this we
// simply return and do not warn.
return;
}

var resources = currentResources;

{
if (typeof href !== 'string' || !href) {
error('ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.', getValueDescriptorExpectingObjectForWarning(href));
} else if (options != null) {
if (typeof options === 'object' && options.hasOwnProperty('crossOrigin')) {
error('ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.', getValueDescriptorExpectingEnumForWarning(options));
} else {
error('ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.', getValueDescriptorExpectingEnumForWarning(options));
}
}
}

if (typeof href === 'string' && href) {
var key = getResourceKey('prefetchDNS', href);
var resource = resources.preconnectsMap.get(key);

if (!resource) {
resource = {
type: 'preconnect',
chunks: [],
state: NoState,
props: null
};
resources.preconnectsMap.set(key, resource);
pushLinkImpl(resource.chunks, {
href: href,
rel: 'dns-prefetch'
});
}

resources.preconnects.add(resource);
}
}
function preconnect(href, options) {
if (!currentResources) {
// While we expect that preconnect calls are primarily going to be observed
// during render because effects and events don't run on the server it is
// still possible that these get called in module scope. This is valid on
// the client since there is still a document to interact with but on the
// server we need a request to associate the call to. Because of this we
// simply return and do not warn.
return;
}

var resources = currentResources;

{
if (typeof href !== 'string' || !href) {
error('ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.', getValueDescriptorExpectingObjectForWarning(href));
} else if (options != null && typeof options !== 'object') {
error('ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.', getValueDescriptorExpectingEnumForWarning(options));
} else if (options != null && typeof options.crossOrigin !== 'string') {
error('ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.', getValueDescriptorExpectingObjectForWarning(options.crossOrigin));
}
}

if (typeof href === 'string' && href) {
var crossOrigin = options == null || typeof options.crossOrigin !== 'string' ? null : options.crossOrigin === 'use-credentials' ? 'use-credentials' : '';
var key = "[preconnect][" + (crossOrigin === null ? 'null' : crossOrigin) + "]" + href;
var resource = resources.preconnectsMap.get(key);

if (!resource) {
resource = {
type: 'preconnect',
chunks: [],
state: NoState,
props: null
};
resources.preconnectsMap.set(key, resource);
pushLinkImpl(resource.chunks, {
rel: 'preconnect',
href: href,
crossOrigin: crossOrigin
});
}

resources.preconnects.add(resource);
}
}
function preload(href, options) {
if (!currentResources) {
// While we expect that preload calls are primarily going to be observed
Expand Down Expand Up @@ -5219,7 +5320,8 @@ function preloadPropsFromPreloadOptions(href, as, options) {
as: as,
href: href,
crossOrigin: as === 'font' ? '' : options.crossOrigin,
integrity: options.integrity
integrity: options.integrity,
type: options.type
};
}

Expand Down