Skip to content

Commit 213128f

Browse files
committed
Update base for Update on "[compiler] When preserving user-level useMemos, don't memoize arguments"
Summary: This work enhances the don't-drop-memoization mode to not memoize the arguments to useMemo and useCallback (or technically, to memoize them in the same block as the hook call -- but since hooks can't be memoized, this is equivalent to never memoizing them). The advantage here is that we preserve the source-level code structure around memoization callbacks more, and avoid the compiler bug of having function expression dependencies be unconditional when their actual semantics are conditional. This conceptually replaces some of the work of #30177: some of that was motivated by avoiding the deps bug, and the rest of the motivation was to better exercise the compiler's semantics, which was really happening as much as I'd hoped, as mofeiZ explained to me in that PR and offline! [ghstack-poisoned]
2 parents ce58ab1 + b9af819 commit 213128f

File tree

2,105 files changed

+18467
-16221
lines changed

Some content is hidden

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

2,105 files changed

+18467
-16221
lines changed

.circleci/config.yml

Lines changed: 0 additions & 263 deletions
Original file line numberDiff line numberDiff line change
@@ -48,197 +48,6 @@ parameters:
4848
default: ''
4949

5050
jobs:
51-
scrape_warning_messages:
52-
docker: *docker
53-
environment: *environment
54-
55-
steps:
56-
- checkout
57-
- setup_node_modules
58-
- run:
59-
command: |
60-
mkdir -p ./build/__test_utils__
61-
node ./scripts/print-warnings/print-warnings.js > build/__test_utils__/ReactAllWarnings.js
62-
- persist_to_workspace:
63-
root: .
64-
paths:
65-
- build
66-
67-
yarn_build:
68-
docker: *docker
69-
environment: *environment
70-
parallelism: 40
71-
steps:
72-
- checkout
73-
- setup_node_modules
74-
- run: yarn build --ci=circleci
75-
- persist_to_workspace:
76-
root: .
77-
paths:
78-
- build
79-
80-
download_build:
81-
docker: *docker
82-
environment: *environment
83-
parameters:
84-
revision:
85-
type: string
86-
steps:
87-
- checkout
88-
- setup_node_modules
89-
- run:
90-
name: Download artifacts for revision
91-
command: |
92-
git fetch origin main
93-
cd ./scripts/release && yarn && cd ../../
94-
scripts/release/download-experimental-build.js --commit=<< parameters.revision >> --allowBrokenCI
95-
- persist_to_workspace:
96-
root: .
97-
paths:
98-
- build
99-
100-
download_base_build_for_sizebot:
101-
docker: *docker
102-
environment: *environment
103-
steps:
104-
- checkout
105-
- setup_node_modules
106-
- run:
107-
name: Download artifacts for base revision
108-
command: |
109-
git fetch origin main
110-
cd ./scripts/release && yarn && cd ../../
111-
scripts/release/download-experimental-build.js --commit=$(git merge-base HEAD origin/main) --allowBrokenCI
112-
mv ./build ./base-build
113-
114-
- run:
115-
# TODO: The `download-experimental-build` script copies the npm
116-
# packages into the `node_modules` directory. This is a historical
117-
# quirk of how the release script works. Let's pretend they
118-
# don't exist.
119-
name: Delete extraneous files
120-
command: rm -rf ./base-build/node_modules
121-
122-
- persist_to_workspace:
123-
root: .
124-
paths:
125-
- base-build
126-
127-
process_artifacts_combined:
128-
docker: *docker
129-
environment: *environment
130-
steps:
131-
- checkout
132-
- attach_workspace:
133-
at: .
134-
- setup_node_modules
135-
- run: echo "<< pipeline.git.revision >>" >> build/COMMIT_SHA
136-
# Compress build directory into a single tarball for easy download
137-
- run: tar -zcvf ./build.tgz ./build
138-
# TODO: Migrate scripts to use `build` directory instead of `build2`
139-
- run: cp ./build.tgz ./build2.tgz
140-
- store_artifacts:
141-
path: ./build2.tgz
142-
- store_artifacts:
143-
path: ./build.tgz
144-
145-
sizebot:
146-
docker: *docker
147-
environment: *environment
148-
steps:
149-
- checkout
150-
- attach_workspace:
151-
at: .
152-
- run: echo "<< pipeline.git.revision >>" >> build/COMMIT_SHA
153-
- setup_node_modules
154-
- run:
155-
command: node ./scripts/tasks/danger
156-
- store_artifacts:
157-
path: sizebot-message.md
158-
159-
build_devtools_and_process_artifacts:
160-
docker: *docker
161-
environment: *environment
162-
steps:
163-
- checkout
164-
- attach_workspace:
165-
at: .
166-
- setup_node_modules
167-
- run:
168-
environment:
169-
RELEASE_CHANNEL: experimental
170-
command: ./scripts/circleci/pack_and_store_devtools_artifacts.sh
171-
- store_artifacts:
172-
path: ./build/devtools.tgz
173-
# Simplifies getting the extension for local testing
174-
- store_artifacts:
175-
path: ./build/devtools/chrome-extension.zip
176-
destination: react-devtools-chrome-extension.zip
177-
- store_artifacts:
178-
path: ./build/devtools/firefox-extension.zip
179-
destination: react-devtools-firefox-extension.zip
180-
181-
run_devtools_e2e_tests:
182-
docker: *docker
183-
environment: *environment
184-
steps:
185-
- checkout
186-
- attach_workspace:
187-
at: .
188-
- setup_node_modules
189-
- run:
190-
name: Playwright install deps
191-
command: |
192-
npx playwright install
193-
sudo npx playwright install-deps
194-
- run:
195-
environment:
196-
RELEASE_CHANNEL: experimental
197-
command: ./scripts/circleci/run_devtools_e2e_tests.js
198-
199-
run_devtools_tests_for_versions:
200-
docker: *docker
201-
environment: *environment
202-
parallelism: *TEST_PARALLELISM
203-
parameters:
204-
version:
205-
type: string
206-
steps:
207-
- checkout
208-
- attach_workspace:
209-
at: .
210-
- setup_node_modules
211-
- run: ./scripts/circleci/download_devtools_regression_build.js << parameters.version >> --replaceBuild
212-
- run: node ./scripts/jest/jest-cli.js --build --project devtools --release-channel=experimental --reactVersion << parameters.version >> --ci=circleci
213-
214-
run_devtools_e2e_tests_for_versions:
215-
docker: *docker
216-
environment: *environment
217-
parallelism: *TEST_PARALLELISM
218-
parameters:
219-
version:
220-
type: string
221-
steps:
222-
- checkout
223-
- attach_workspace:
224-
at: .
225-
- setup_node_modules
226-
- run:
227-
name: Playwright install deps
228-
command: |
229-
npx playwright install
230-
sudo npx playwright install-deps
231-
- run: ./scripts/circleci/download_devtools_regression_build.js << parameters.version >>
232-
- run:
233-
environment:
234-
RELEASE_CHANNEL: experimental
235-
command: ./scripts/circleci/run_devtools_e2e_tests.js << parameters.version >>
236-
- run:
237-
name: Cleanup build regression folder
238-
command: rm -r ./build-regression
239-
- store_artifacts:
240-
path: ./tmp/screenshots
241-
24251
publish_prerelease:
24352
parameters:
24453
commit_sha:
@@ -262,78 +71,6 @@ jobs:
26271
scripts/release/publish.js --ci --tags << parameters.dist_tag >>
26372
26473
workflows:
265-
266-
build_and_test:
267-
unless: << pipeline.parameters.prerelease_commit_sha >>
268-
jobs:
269-
- yarn_build:
270-
filters:
271-
branches:
272-
ignore:
273-
- builds/facebook-www
274-
- scrape_warning_messages:
275-
filters:
276-
branches:
277-
ignore:
278-
- builds/facebook-www
279-
- process_artifacts_combined:
280-
requires:
281-
- scrape_warning_messages
282-
- yarn_build
283-
- download_base_build_for_sizebot:
284-
filters:
285-
branches:
286-
ignore:
287-
- main
288-
- builds/facebook-www
289-
- sizebot:
290-
filters:
291-
branches:
292-
ignore:
293-
- main
294-
requires:
295-
- download_base_build_for_sizebot
296-
- yarn_build
297-
298-
devtools_regression_tests:
299-
unless: << pipeline.parameters.prerelease_commit_sha >>
300-
triggers:
301-
- schedule:
302-
# DevTools regression tests run once a day
303-
cron: "0 0 * * *"
304-
filters:
305-
branches:
306-
only:
307-
- main
308-
jobs:
309-
- download_build:
310-
revision: << pipeline.git.revision >>
311-
- build_devtools_and_process_artifacts:
312-
requires:
313-
- download_build
314-
- run_devtools_tests_for_versions:
315-
requires:
316-
- build_devtools_and_process_artifacts
317-
matrix:
318-
parameters:
319-
version:
320-
- "16.0"
321-
- "16.5" # schedule package
322-
- "16.8" # hooks
323-
- "17.0"
324-
- "18.0"
325-
- run_devtools_e2e_tests_for_versions:
326-
requires:
327-
- build_devtools_and_process_artifacts
328-
matrix:
329-
parameters:
330-
version:
331-
- "16.0"
332-
- "16.5" # schedule package
333-
- "16.8" # hooks
334-
- "17.0"
335-
- "18.0"
336-
33774
# Used to publish a prerelease manually via the command line
33875
publish_preleases:
33976
when: << pipeline.parameters.prerelease_commit_sha >>

.git-blame-ignore-revs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
c998bb1ed4b3285398c9c7797135d3f060243c6a
2+
fd2b3e13d330a4559f5aa21462e1cb2cbbcf144b

0 commit comments

Comments
 (0)