Skip to content

Commit

Permalink
Use > as a marker for attention
Browse files Browse the repository at this point in the history
Co-authored-by: tjallingt <tjallingt@gmail.com>
  • Loading branch information
sebmarkbage and tjallingt committed Jul 10, 2024
1 parent b409317 commit 5dee34a
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function describeAncestors(
if (node !== null) {
// Describe the node using the hydration diff logic.
// Replace + with - to mark ancestor and child. It's kind of arbitrary.
return describeDiff(node).replace(/\n\+/g, '\n-');
return describeDiff(node).replaceAll(/^[+-]/gm, '>');
}
return '';
}
Expand Down
28 changes: 14 additions & 14 deletions packages/react-dom/src/__tests__/ReactDOMComponent-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2197,8 +2197,8 @@ describe('ReactDOMComponent', () => {
'In HTML, <tr> cannot be a child of <div>.\n' +
'This will cause a hydration error.\n' +
'\n' +
'- <div>\n' +
'- <tr>\n' +
'> <div>\n' +
'> <tr>\n' +
' ...\n' +
'\n in tr (at **)' +
(gate(flags => flags.enableOwnerStacks)
Expand Down Expand Up @@ -2263,9 +2263,9 @@ describe('ReactDOMComponent', () => {
'This will cause a hydration error.\n' +
'\n' +
' <Foo>\n' +
'- <table>\n' +
'> <table>\n' +
' <Row>\n' +
'- <tr>\n' +
'> <tr>\n' +
' ...\n' +
'\n in tr (at **)' +
'\n in Row (at **)',
Expand All @@ -2280,7 +2280,7 @@ describe('ReactDOMComponent', () => {
' <table>\n' +
' <Row>\n' +
' <tr>\n' +
'- x\n' +
'> x\n' +
' ...\n' +
'\n in tr (at **)' +
'\n in Row (at **)',
Expand All @@ -2290,9 +2290,9 @@ describe('ReactDOMComponent', () => {
'This will cause a hydration error.\n' +
'\n' +
' <Foo>\n' +
'- <table>\n' +
'> <table>\n' +
' <Row>\n' +
'- {" "}\n' +
'> {" "}\n' +
'\n in table (at **)' +
'\n in Foo (at **)',
]
Expand All @@ -2303,9 +2303,9 @@ describe('ReactDOMComponent', () => {
'This will cause a hydration error.\n' +
'\n' +
' <Foo>\n' +
'- <table>\n' +
'> <table>\n' +
' <Row>\n' +
'- <tr>\n' +
'> <tr>\n' +
' ...\n' +
'\n in tr (at **)' +
'\n in Row (at **)' +
Expand All @@ -2319,7 +2319,7 @@ describe('ReactDOMComponent', () => {
' <table>\n' +
' <Row>\n' +
' <tr>\n' +
'- x\n' +
'> x\n' +
' ...\n' +
'\n in tr (at **)' +
'\n in Row (at **)' +
Expand All @@ -2331,9 +2331,9 @@ describe('ReactDOMComponent', () => {
'This will cause a hydration error.\n' +
'\n' +
' <Foo>\n' +
'- <table>\n' +
'> <table>\n' +
' <Row>\n' +
'- {" "}\n' +
'> {" "}\n' +
'\n in table (at **)' +
'\n in Foo (at **)',
],
Expand Down Expand Up @@ -2368,7 +2368,7 @@ describe('ReactDOMComponent', () => {
'\n' +
' <Foo>\n' +
' <table>\n' +
'- {" "}\n' +
'> {" "}\n' +
'\n in table (at **)' +
'\n in Foo (at **)',
]);
Expand Down Expand Up @@ -2403,7 +2403,7 @@ describe('ReactDOMComponent', () => {
' <tbody>\n' +
' <Row>\n' +
' <tr>\n' +
'- text\n' +
'> text\n' +
'\n in tr (at **)' +
'\n in Row (at **)' +
(gate(flags => flags.enableOwnerStacks)
Expand Down
4 changes: 2 additions & 2 deletions packages/react-dom/src/__tests__/ReactDOMForm-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,9 @@ describe('ReactDOMForm', () => {
'In HTML, <form> cannot be a descendant of <form>.\n' +
'This will cause a hydration error.\n' +
'\n' +
'- <form action={function outerAction}>\n' +
'> <form action={function outerAction}>\n' +
' <input>\n' +
'- <form action={function innerAction} ref={{current:null}}>\n' +
'> <form action={function innerAction} ref={{current:null}}>\n' +
'\n in form (at **)' +
(gate(flags => flags.enableOwnerStacks) ? '' : '\n in form (at **)'),
);
Expand Down
8 changes: 4 additions & 4 deletions packages/react-dom/src/__tests__/ReactDOMOption-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ describe('ReactDOMOption', () => {
'In HTML, <div> cannot be a child of <option>.\n' +
'This will cause a hydration error.\n' +
'\n' +
'- <option value="12">\n' +
'- <div>\n' +
'> <option value="12">\n' +
'> <div>\n' +
' ...\n' +
'\n' +
' in div (at **)' +
Expand Down Expand Up @@ -278,8 +278,8 @@ describe('ReactDOMOption', () => {
'This will cause a hydration error.\n' +
'\n' +
' <select readOnly={true} value="bar">\n' +
'- <option value="bar">\n' +
'- <div ref={{current:null}}>\n' +
'> <option value="bar">\n' +
'> <div ref={{current:null}}>\n' +
' ...\n' +
'\n' +
' in div (at **)' +
Expand Down
16 changes: 8 additions & 8 deletions packages/react-dom/src/__tests__/validateDOMNesting-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ describe('validateDOMNesting', () => {
'This will cause a hydration error.\n' +
'\n' +
' <ul>\n' +
'- <li>\n' +
'> <li>\n' +
' <div>\n' +
'- <li>\n' +
'> <li>\n' +
'\n' +
' in li (at **)',
'<li> cannot contain a nested <li>.\nSee this log for the ancestor stack trace.\n' +
Expand All @@ -112,9 +112,9 @@ describe('validateDOMNesting', () => {
'This will cause a hydration error.\n' +
'\n' +
' <ul>\n' +
'- <li>\n' +
'> <li>\n' +
' <div>\n' +
'- <li>\n' +
'> <li>\n' +
'\n' +
' in li (at **)\n' +
' in div (at **)\n' +
Expand Down Expand Up @@ -146,8 +146,8 @@ describe('validateDOMNesting', () => {
'In HTML, <body> cannot be a child of <foreignObject>.\n' +
'This will cause a hydration error.\n' +
'\n' +
'- <foreignObject>\n' +
'- <body>\n' +
'> <foreignObject>\n' +
'> <body>\n' +
'\n' +
' in body (at **)',
'You are mounting a new body component when a previous one has not first unmounted. It is an error to render more than one body component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <body> and if you need to mount a new one, ensure any previous ones have unmounted first.\n' +
Expand All @@ -158,8 +158,8 @@ describe('validateDOMNesting', () => {
'In HTML, <body> cannot be a child of <foreignObject>.\n' +
'This will cause a hydration error.\n' +
'\n' +
'- <foreignObject>\n' +
'- <body>\n' +
'> <foreignObject>\n' +
'> <body>\n' +
'\n' +
' in body (at **)\n' +
' in foreignObject (at **)',
Expand Down

0 comments on commit 5dee34a

Please sign in to comment.