Skip to content

Commit cbc4196

Browse files
Merge branch 'main' into react/ref-init-impure-purity
2 parents d140b4d + 3f0b9e6 commit cbc4196

17 files changed

Lines changed: 353 additions & 37 deletions

File tree

compiler/yarn.lock

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10525,7 +10525,16 @@ string-length@^4.0.1:
1052510525
char-regex "^1.0.2"
1052610526
strip-ansi "^6.0.0"
1052710527

10528-
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
10528+
"string-width-cjs@npm:string-width@^4.2.0":
10529+
version "4.2.3"
10530+
resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz"
10531+
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
10532+
dependencies:
10533+
emoji-regex "^8.0.0"
10534+
is-fullwidth-code-point "^3.0.0"
10535+
strip-ansi "^6.0.1"
10536+
10537+
string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
1052910538
version "4.2.3"
1053010539
resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz"
1053110540
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@@ -10598,7 +10607,14 @@ string_decoder@~1.1.1:
1059810607
dependencies:
1059910608
safe-buffer "~5.1.0"
1060010609

10601-
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
10610+
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
10611+
version "6.0.1"
10612+
resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz"
10613+
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
10614+
dependencies:
10615+
ansi-regex "^5.0.1"
10616+
10617+
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
1060210618
version "6.0.1"
1060310619
resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz"
1060410620
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
@@ -11064,9 +11080,9 @@ undici-types@~6.19.2:
1106411080
integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==
1106511081

1106611082
undici@^6.19.5:
11067-
version "6.21.2"
11068-
resolved "https://registry.npmjs.org/undici/-/undici-6.21.2.tgz"
11069-
integrity sha512-uROZWze0R0itiAKVPsYhFov9LxrPMHLMEQFszeI2gCN6bnIIZ8twzBCJcN2LJrBBLfrP0t1FW0g+JmKVl8Vk1g==
11083+
version "6.23.0"
11084+
resolved "https://registry.yarnpkg.com/undici/-/undici-6.23.0.tgz#7953087744d9095a96f115de3140ca3828aff3a4"
11085+
integrity sha512-VfQPToRA5FZs/qJxLIinmU59u0r7LXqoJkCzinq3ckNJp3vKEh7jTWN589YQ5+aoAC/TGRLyJLCPKcLQbM8r9g==
1107011086

1107111087
unicode-canonical-property-names-ecmascript@^2.0.0:
1107211088
version "2.0.1"
@@ -11375,7 +11391,7 @@ workerpool@^6.5.1:
1137511391
resolved "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz"
1137611392
integrity sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==
1137711393

11378-
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
11394+
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
1137911395
version "7.0.0"
1138011396
resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz"
1138111397
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
@@ -11393,6 +11409,15 @@ wrap-ansi@^6.2.0:
1139311409
string-width "^4.1.0"
1139411410
strip-ansi "^6.0.0"
1139511411

11412+
wrap-ansi@^7.0.0:
11413+
version "7.0.0"
11414+
resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz"
11415+
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
11416+
dependencies:
11417+
ansi-styles "^4.0.0"
11418+
string-width "^4.1.0"
11419+
strip-ansi "^6.0.0"
11420+
1139611421
wrap-ansi@^8.1.0:
1139711422
version "8.1.0"
1139811423
resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz"

fixtures/packaging/webpack-alias/dev/yarn.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -936,8 +936,8 @@ punycode@^1.2.4, punycode@^1.4.1:
936936
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
937937

938938
qs@~6.4.0:
939-
version "6.4.0"
940-
resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233"
939+
version "6.4.1"
940+
resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.1.tgz#2bad97710a5b661c366b378b1e3a44a592ff45e6"
941941

942942
querystring-es3@^0.2.0:
943943
version "0.2.1"

fixtures/packaging/webpack/prod/yarn.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -936,8 +936,8 @@ punycode@^1.2.4, punycode@^1.4.1:
936936
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
937937

938938
qs@~6.4.0:
939-
version "6.4.0"
940-
resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233"
939+
version "6.4.1"
940+
resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.1.tgz#2bad97710a5b661c366b378b1e3a44a592ff45e6"
941941

942942
querystring-es3@^0.2.0:
943943
version "0.2.1"

packages/react-client/src/ReactFlightClient.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,6 +1040,8 @@ function initializeModelChunk<T>(chunk: ResolvedModelChunk<T>): void {
10401040
// Initialize any debug info and block the initializing chunk on any
10411041
// unresolved entries.
10421042
initializeDebugChunk(response, chunk);
1043+
// TODO: The chunk might have transitioned to ERRORED now.
1044+
// Should we return early if that happens?
10431045
}
10441046

10451047
try {
@@ -1075,6 +1077,7 @@ function initializeModelChunk<T>(chunk: ResolvedModelChunk<T>): void {
10751077
const initializedChunk: InitializedChunk<T> = (chunk: any);
10761078
initializedChunk.status = INITIALIZED;
10771079
initializedChunk.value = value;
1080+
initializedChunk.reason = null;
10781081

10791082
if (__DEV__) {
10801083
processChunkDebugInfo(response, initializedChunk, value);
@@ -1097,6 +1100,7 @@ function initializeModuleChunk<T>(chunk: ResolvedModuleChunk<T>): void {
10971100
const initializedChunk: InitializedChunk<T> = (chunk: any);
10981101
initializedChunk.status = INITIALIZED;
10991102
initializedChunk.value = value;
1103+
initializedChunk.reason = null;
11001104
} catch (error) {
11011105
const erroredChunk: ErroredChunk<T> = (chunk: any);
11021106
erroredChunk.status = ERRORED;

packages/react-devtools-shared/src/devtools/views/Components/InspectedElementSuspendedBy.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,9 @@ export default function InspectedElementSuspendedBy({
584584
break;
585585
}
586586

587+
if (groups.length === 0) {
588+
return null;
589+
}
587590
return (
588591
<div>
589592
<div className={styles.HeaderRow}>

packages/react-dom-bindings/src/client/CSSShorthandProperty.js

Lines changed: 72 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
// List derived from Gecko source code:
9-
// https://github.com/mozilla/gecko-dev/blob/4e638efc71/layout/style/test/property_database.js
8+
// List derived from Firefox source code:
9+
// https://github.com/mozilla-firefox/firefox/blob/58f365ba0eb5761a182f1925e4654cc75212b8ac/layout/style/test/property_database.js
1010
export const shorthandToLonghand = {
1111
animation: [
1212
'animationDelay',
@@ -49,6 +49,15 @@ export const shorthandToLonghand = {
4949
'borderTopStyle',
5050
'borderTopWidth',
5151
],
52+
borderBlock: [
53+
'borderBlockEndColor',
54+
'borderBlockEndStyle',
55+
'borderBlockEndWidth',
56+
'borderBlockStartColor',
57+
'borderBlockStartStyle',
58+
'borderBlockStartWidth',
59+
],
60+
borderBlockColor: ['borderBlockEndColor', 'borderBlockStartColor'],
5261
borderBlockEnd: [
5362
'borderBlockEndColor',
5463
'borderBlockEndStyle',
@@ -59,6 +68,8 @@ export const shorthandToLonghand = {
5968
'borderBlockStartStyle',
6069
'borderBlockStartWidth',
6170
],
71+
borderBlockStyle: ['borderBlockEndStyle', 'borderBlockStartStyle'],
72+
borderBlockWidth: ['borderBlockEndWidth', 'borderBlockStartWidth'],
6273
borderBottom: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth'],
6374
borderColor: [
6475
'borderBottomColor',
@@ -73,6 +84,15 @@ export const shorthandToLonghand = {
7384
'borderImageSource',
7485
'borderImageWidth',
7586
],
87+
borderInline: [
88+
'borderInlineEndColor',
89+
'borderInlineEndStyle',
90+
'borderInlineEndWidth',
91+
'borderInlineStartColor',
92+
'borderInlineStartStyle',
93+
'borderInlineStartWidth',
94+
],
95+
borderInlineColor: ['borderInlineEndColor', 'borderInlineStartColor'],
7696
borderInlineEnd: [
7797
'borderInlineEndColor',
7898
'borderInlineEndStyle',
@@ -83,6 +103,8 @@ export const shorthandToLonghand = {
83103
'borderInlineStartStyle',
84104
'borderInlineStartWidth',
85105
],
106+
borderInlineStyle: ['borderInlineEndStyle', 'borderInlineStartStyle'],
107+
borderInlineWidth: ['borderInlineEndWidth', 'borderInlineStartWidth'],
86108
borderLeft: ['borderLeftColor', 'borderLeftStyle', 'borderLeftWidth'],
87109
borderRadius: [
88110
'borderBottomLeftRadius',
@@ -104,8 +126,11 @@ export const shorthandToLonghand = {
104126
'borderRightWidth',
105127
'borderTopWidth',
106128
],
129+
colorAdjust: ['printColorAdjust'],
107130
columnRule: ['columnRuleColor', 'columnRuleStyle', 'columnRuleWidth'],
108131
columns: ['columnCount', 'columnWidth'],
132+
containIntrinsicSize: ['containIntrinsicHeight', 'containIntrinsicWidth'],
133+
container: ['containerName', 'containerType'],
109134
flex: ['flexBasis', 'flexGrow', 'flexShrink'],
110135
flexFlow: ['flexDirection', 'flexWrap'],
111136
font: [
@@ -127,6 +152,12 @@ export const shorthandToLonghand = {
127152
'fontWeight',
128153
'lineHeight',
129154
],
155+
fontSynthesis: [
156+
'fontSynthesisPosition',
157+
'fontSynthesisSmallCaps',
158+
'fontSynthesisStyle',
159+
'fontSynthesisWeight',
160+
],
130161
fontVariant: [
131162
'fontVariantAlternates',
132163
'fontVariantCaps',
@@ -155,8 +186,13 @@ export const shorthandToLonghand = {
155186
'gridTemplateColumns',
156187
'gridTemplateRows',
157188
],
189+
inset: ['bottom', 'left', 'right', 'top'],
190+
insetBlock: ['insetBlockEnd', 'insetBlockStart'],
191+
insetInline: ['insetInlineEnd', 'insetInlineStart'],
158192
listStyle: ['listStyleImage', 'listStylePosition', 'listStyleType'],
159193
margin: ['marginBottom', 'marginLeft', 'marginRight', 'marginTop'],
194+
marginBlock: ['marginBlockEnd', 'marginBlockStart'],
195+
marginInline: ['marginInlineEnd', 'marginInlineStart'],
160196
marker: ['markerEnd', 'markerMid', 'markerStart'],
161197
mask: [
162198
'maskClip',
@@ -170,23 +206,57 @@ export const shorthandToLonghand = {
170206
'maskSize',
171207
],
172208
maskPosition: ['maskPositionX', 'maskPositionY'],
209+
offset: [
210+
'offsetAnchor',
211+
'offsetDistance',
212+
'offsetPath',
213+
'offsetPosition',
214+
'offsetRotate',
215+
],
173216
outline: ['outlineColor', 'outlineStyle', 'outlineWidth'],
174217
overflow: ['overflowX', 'overflowY'],
218+
overscrollBehavior: ['overscrollBehaviorX', 'overscrollBehaviorY'],
175219
padding: ['paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop'],
220+
paddingBlock: ['paddingBlockEnd', 'paddingBlockStart'],
221+
paddingInline: ['paddingInlineEnd', 'paddingInlineStart'],
222+
pageBreakAfter: ['breakAfter'],
223+
pageBreakBefore: ['breakBefore'],
224+
pageBreakInside: ['breakInside'],
176225
placeContent: ['alignContent', 'justifyContent'],
177226
placeItems: ['alignItems', 'justifyItems'],
178227
placeSelf: ['alignSelf', 'justifySelf'],
228+
scrollMargin: [
229+
'scrollMarginBottom',
230+
'scrollMarginLeft',
231+
'scrollMarginRight',
232+
'scrollMarginTop',
233+
],
234+
scrollMarginBlock: ['scrollMarginBlockEnd', 'scrollMarginBlockStart'],
235+
scrollMarginInline: ['scrollMarginInlineEnd', 'scrollMarginInlineStart'],
236+
scrollPadding: [
237+
'scrollPaddingBottom',
238+
'scrollPaddingLeft',
239+
'scrollPaddingRight',
240+
'scrollPaddingTop',
241+
],
242+
scrollPaddingBlock: ['scrollPaddingBlockEnd', 'scrollPaddingBlockStart'],
243+
scrollPaddingInline: ['scrollPaddingInlineEnd', 'scrollPaddingInlineStart'],
179244
textDecoration: [
180245
'textDecorationColor',
181246
'textDecorationLine',
182247
'textDecorationStyle',
248+
'textDecorationThickness',
183249
],
184250
textEmphasis: ['textEmphasisColor', 'textEmphasisStyle'],
251+
textWrap: ['textWrapMode', 'textWrapStyle'],
185252
transition: [
253+
'transitionBehavior',
186254
'transitionDelay',
187255
'transitionDuration',
188256
'transitionProperty',
189257
'transitionTimingFunction',
190258
],
259+
verticalAlign: ['alignmentBaseline', 'baselineShift', 'baselineSource'],
260+
whiteSpace: ['textWrapMode', 'whiteSpaceCollapse'],
191261
wordWrap: ['overflowWrap'],
192262
};

packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4520,18 +4520,30 @@ export function setFocusIfFocusable(
45204520
//
45214521
// We could compare the node to document.activeElement after focus,
45224522
// but this would not handle the case where application code managed focus to automatically blur.
4523+
const element = ((node: any): HTMLElement);
4524+
4525+
// If this element is already the active element, it's focusable and already
4526+
// focused. Calling .focus() on it would be a no-op (no focus event fires),
4527+
// so we short-circuit here.
4528+
if (element.ownerDocument.activeElement === element) {
4529+
return true;
4530+
}
4531+
45234532
let didFocus = false;
45244533
const handleFocus = () => {
45254534
didFocus = true;
45264535
};
45274536

4528-
const element = ((node: any): HTMLElement);
45294537
try {
4530-
element.addEventListener('focus', handleFocus);
4538+
// Listen on the document in the capture phase so we detect focus even when
4539+
// it lands on a different element than the one we called .focus() on. This
4540+
// happens with <label> elements (focus delegates to the associated input)
4541+
// and shadow hosts with delegatesFocus.
4542+
element.ownerDocument.addEventListener('focus', handleFocus, true);
45314543
// $FlowFixMe[method-unbinding]
45324544
(element.focus || HTMLElement.prototype.focus).call(element, focusOptions);
45334545
} finally {
4534-
element.removeEventListener('focus', handleFocus);
4546+
element.ownerDocument.removeEventListener('focus', handleFocus, true);
45354547
}
45364548

45374549
return didFocus;

0 commit comments

Comments
 (0)