Skip to content

Commit 98a03a9

Browse files
author
github-actions
committed
fast-follow - apply patch
1 parent ac3975b commit 98a03a9

File tree

173 files changed

+3298
-21800
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+3298
-21800
lines changed

WorkspaceStatic/jest/matchers/createConsoleMatcher.lua

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,7 @@
1-
<<<<<<< HEAD
21
--!nonstrict
3-
-- ROBLOX upstream: https://github.com/facebook/react/blob/6d50a9d090a2a672fc3dea5ce77a3a05332a6caa/fixtures/legacy-jsx-runtimes/setupTests.js
2+
-- ROBLOX upstream: https://github.com/facebook/react/blob/v18.2.0/fixtures/legacy-jsx-runtimes/setupTests.js
43
local Packages = script.Parent.Parent.Parent.TestRunner
54
local JestDiff = require(Packages.Dev.JestDiff)
6-
7-
=======
8-
-- ROBLOX upstream: https://github.com/facebook/react/blob/v18.2.0/fixtures/legacy-jsx-runtimes/setupTests.js
9-
local Packages --[[ ROBLOX comment: must define Packages module ]]
10-
local LuauPolyfill = require(Packages.LuauPolyfill)
11-
local Array = LuauPolyfill.Array
12-
local Boolean = LuauPolyfill.Boolean
13-
local Error = LuauPolyfill.Error
14-
type Object = LuauPolyfill.Object
15-
local RegExp = require(Packages.RegExp)
16-
-- This is mostly copypasta from toWarnDev.js matchers
17-
-- that we use in the main repo Jest configuration.
18-
local expect = global.expect
19-
local jestDiff = require_("jest-diff").default
20-
local util = require_("util")
21-
>>>>>>> upstream-apply
225
local function shouldIgnoreConsoleError(format, args)
236
-- deviation: instead of checking if `process.env.NODE_ENV ~= "production"`
247
-- we use the __DEV__ global
@@ -48,7 +31,6 @@ local function shouldIgnoreConsoleError(format, args)
4831
-- // They are noisy too so we'll try to ignore them.
4932
return true
5033
end
51-
<<<<<<< HEAD
5234
if
5335
string.find(format, "act(...) is not supported in production builds of React")
5436
== 0
@@ -60,9 +42,6 @@ local function shouldIgnoreConsoleError(format, args)
6042
end
6143
end
6244

63-
=======
64-
end -- Looks legit
65-
>>>>>>> upstream-apply
6645
return false
6746
end
6847

WorkspaceStatic/jest/matchers/reactTestMatchers.lua

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
<<<<<<< HEAD
2-
-- ROBLOX upstream: https://github.com/facebook/react/blob/v17.0.2/scripts/jest/matchers/reactTestMatchers.js
3-
local Packages = script.Parent.Parent.Parent.TestRunner
4-
=======
51
-- ROBLOX upstream: https://github.com/facebook/react/blob/v18.2.0/scripts/jest/matchers/reactTestMatchers.js
6-
local Packages --[[ ROBLOX comment: must define Packages module ]]
7-
>>>>>>> upstream-apply
2+
local Packages = script.Parent.Parent.Parent.TestRunner
83
-- ROBLOX deviation START: fix import
94
-- local LuauPolyfill = require(Packages.LuauPolyfill)
105
local LuauPolyfill = require(Packages.Dev.LuauPolyfill)

WorkspaceStatic/jest/matchers/schedulerTestMatchers.lua

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
<<<<<<< HEAD
2-
-- ROBLOX upstream: https://github.com/facebook/react/blob/v17.0.2/scripts/jest/matchers/schedulerTestMatchers.js
3-
local Packages = script.Parent.Parent.Parent.TestRunner
4-
=======
51
-- ROBLOX upstream: https://github.com/facebook/react/blob/v18.2.0/scripts/jest/matchers/schedulerTestMatchers.js
6-
local Packages --[[ ROBLOX comment: must define Packages module ]]
7-
>>>>>>> upstream-apply
2+
local Packages = script.Parent.Parent.Parent.TestRunner
83
-- ROBLOX deviation START: fix import
94
-- local LuauPolyfill = require(Packages.LuauPolyfill)
105
local LuauPolyfill = require(Packages.Dev.LuauPolyfill)

modules/jest-react/src/JestReact.lua

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,8 @@
55
* This source code is licensed under the MIT license found in the
66
* LICENSE file in the root directory of this source tree.
77
]]
8-
<<<<<<< HEAD
98
local LuauPolyfill = require("@pkg/@jsdotlua/luau-polyfill")
109
local Array = LuauPolyfill.Array
11-
=======
12-
local Packages --[[ ROBLOX comment: must define Packages module ]]
13-
local LuauPolyfill = require(Packages.LuauPolyfill)
14-
>>>>>>> upstream-apply
1510
-- ROBLOX deviation START: not used
1611
-- local Boolean = LuauPolyfill.Boolean
1712
-- ROBLOX deviation END
@@ -29,18 +24,13 @@ local sharedReactSymbolsModule = require("@pkg/@jsdotlua/shared").ReactSymbols
2924
-- ROBLOX deviation END
3025
local REACT_ELEMENT_TYPE = sharedReactSymbolsModule.REACT_ELEMENT_TYPE
3126
local REACT_FRAGMENT_TYPE = sharedReactSymbolsModule.REACT_FRAGMENT_TYPE
32-
<<<<<<< HEAD
3327
-- ROBLOX deviation START: fix import
3428
-- local invariant = require("@pkg/@jsdotlua/shared").default
3529
local invariant = require("@pkg/@jsdotlua/shared").invariant
3630
-- ROBLOX deviation END
3731
-- ROBLOX deviation START: predeclare variables
3832
local jsonChildToJSXChild, jsonChildrenToJSXChildren
3933
-- ROBLOX deviation END
40-
=======
41-
local isArray = require(Packages.shared.isArray).default
42-
exports.act = require(script.Parent.internalAct).act
43-
>>>>>>> upstream-apply
4434
local function captureAssertion(fn)
4535
-- Trick to use a Jest matcher inside another Jest matcher. `fn` contains an
4636
-- assertion; if it throws, we capture the error and return it, so the stack
@@ -86,7 +76,6 @@ local function assertYieldsWereCleared(root)
8676
-- local actualYields = Scheduler:unstable_clearYields()
8777
local actualYields = Scheduler.unstable_clearYields()
8878
-- ROBLOX deviation END
89-
<<<<<<< HEAD
9079
invariant(
9180
-- ROBLOX deviation START: fix .length
9281
-- actualYields.length == 0,
@@ -95,16 +84,6 @@ local function assertYieldsWereCleared(root)
9584
"Log of yielded values is not empty. "
9685
.. "Call expect(ReactTestRenderer).unstable_toHaveYielded(...) first."
9786
)
98-
=======
99-
if actualYields.length ~= 0 then
100-
error(
101-
Error.new(
102-
"Log of yielded values is not empty. "
103-
.. "Call expect(ReactTestRenderer).unstable_toHaveYielded(...) first."
104-
)
105-
)
106-
end
107-
>>>>>>> upstream-apply
10887
end
10988
local function unstable_toMatchRenderedOutput(root, expectedJSX)
11089
assertYieldsWereCleared(root)
@@ -115,14 +94,10 @@ local function unstable_toMatchRenderedOutput(root, expectedJSX)
11594
local actualJSX
11695
if actualJSON == nil or typeof(actualJSON) == "string" then
11796
actualJSX = actualJSON
118-
<<<<<<< HEAD
11997
-- ROBLOX deviation START: remove toJSBoolean
12098
-- elseif Boolean.toJSBoolean(Array.isArray(actualJSON)) then
12199
elseif Array.isArray(actualJSON) then
122100
-- ROBLOX deviation END
123-
=======
124-
elseif Boolean.toJSBoolean(isArray(actualJSON)) then
125-
>>>>>>> upstream-apply
126101
-- ROBLOX deviation START: fix .length
127102
-- if actualJSON.length == 0 then
128103
if #actualJSON == 0 then

modules/react-cache/src/LRU.lua

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ local exports = {}
1515
local Scheduler = require("@pkg/@jsdotlua/scheduler")
1616
-- ROBLOX deviation END
1717
-- use dynamic dispatch for CommonJS interop named imports.
18-
local scheduleCallback, IdlePriority =
19-
Scheduler.unstable_scheduleCallback, Scheduler.unstable_IdlePriority
18+
local scheduleCallback, IdlePriority = Scheduler.unstable_scheduleCallback, Scheduler.unstable_IdlePriority
2019
-- ROBLOX deviation START: use next_ instead
2120
-- type Entry<T> = { value: T, onDelete: () -> unknown, previous: Entry<T>, next: Entry<T> }
2221
export type Entry<T> = {
@@ -32,8 +31,7 @@ local function createLRU<T>(limit: number)
3231
local cleanUp
3332
-- ROBLOX deviation END
3433
local LIMIT = limit -- Circular, doubly-linked list
35-
local first: Entry<T> | nil --[[ ROBLOX CHECK: verify if `null` wasn't used differently than `undefined` ]] =
36-
nil
34+
local first: Entry<T> | nil --[[ ROBLOX CHECK: verify if `null` wasn't used differently than `undefined` ]] = nil
3735
local size: number = 0
3836
local cleanUpIsScheduled: boolean = false
3937
local function scheduleCleanUp()

modules/react-cache/src/ReactCacheOld.lua

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,7 @@ local lru = createLRU(CACHE_LIMIT)
121121
local entries: Record<Resource<any, any>, Record<number, Entry<any>>> = {}
122122
-- ROBLOX deviation END
123123
local CacheContext = React.createContext(nil)
124-
local function accessResult<I, K, V>(
125-
resource: any,
126-
fetch: (I) -> Thenable<V>,
127-
input: I,
128-
key: K
129-
): Result<V>
124+
local function accessResult<I, K, V>(resource: any, fetch: (I) -> Thenable<V>, input: I, key: K): Result<V>
130125
-- ROBLOX deviation START: use regular indexing instead
131126
-- local entriesForResource = entries:get(resource)
132127
local entriesForResource = entries[resource]
@@ -143,9 +138,7 @@ local function accessResult<I, K, V>(
143138
end
144139
-- ROBLOX deviation START: cast as Luau doesn't narrow type on itself
145140
-- local entry = entriesForResource:get(key)
146-
local entriesForResource_ = (
147-
entriesForResource :: Record<any, Entry<any>>
148-
) :: Record<K, Entry<any>>
141+
local entriesForResource_ = (entriesForResource :: Record<any, Entry<any>>) :: Record<K, Entry<any>>
149142
local entry = entriesForResource_[key]
150143
-- ROBLOX deviation END
151144
if entry == nil then
@@ -227,20 +220,15 @@ local function unstable_createResource<
227220
I,
228221
K, --[[ ROBLOX CHECK: upstream type uses type constraint which is not supported by Luau ]] --[[ K: string | number ]]
229222
V
230-
>(
231-
fetch: (
232-
I
233-
) -> Thenable<V>,
234-
maybeHashInput: (
235-
(I) -> K
236-
)?
237-
): Resource<
223+
>(fetch: (
224+
I
225+
) -> Thenable<V>, maybeHashInput: (
226+
(I) -> K
227+
)?): Resource<
238228
I,
239229
V
240230
>
241-
local hashInput: (I) -> K = if maybeHashInput ~= nil
242-
then maybeHashInput
243-
else identityHashFn :: any
231+
local hashInput: (I) -> K = if maybeHashInput ~= nil then maybeHashInput else identityHashFn :: any
244232
-- ROBLOX deviation START: split declaration and assignment
245233
-- local resource = {
246234
local resource

0 commit comments

Comments
 (0)