Skip to content

Commit 95319ab

Browse files
authored
Switch facebook-www build version to file content hash (#28633)
Unifies the React version string pattern with RN just to simplify the build script a tiny bit and not have 2 mechanisms for the Meta-internal build.
1 parent c3048aa commit 95319ab

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

scripts/rollup/build-all-release-channels.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -158,18 +158,16 @@ function processStable(buildDir) {
158158
}
159159

160160
if (fs.existsSync(buildDir + '/facebook-www')) {
161-
const hash = crypto.createHash('sha1');
162161
for (const fileName of fs.readdirSync(buildDir + '/facebook-www').sort()) {
163162
const filePath = buildDir + '/facebook-www/' + fileName;
164163
const stats = fs.statSync(filePath);
165164
if (!stats.isDirectory()) {
166-
hash.update(fs.readFileSync(filePath));
167165
fs.renameSync(filePath, filePath.replace('.js', '.classic.js'));
168166
}
169167
}
170168
updatePlaceholderReactVersionInCompiledArtifacts(
171169
buildDir + '/facebook-www',
172-
ReactVersion + '-www-classic-' + hash.digest('hex').slice(0, 8)
170+
ReactVersion + '-www-classic-%FILEHASH%'
173171
);
174172
}
175173

@@ -224,18 +222,16 @@ function processExperimental(buildDir, version) {
224222
}
225223

226224
if (fs.existsSync(buildDir + '/facebook-www')) {
227-
const hash = crypto.createHash('sha1');
228225
for (const fileName of fs.readdirSync(buildDir + '/facebook-www').sort()) {
229226
const filePath = buildDir + '/facebook-www/' + fileName;
230227
const stats = fs.statSync(filePath);
231228
if (!stats.isDirectory()) {
232-
hash.update(fs.readFileSync(filePath));
233229
fs.renameSync(filePath, filePath.replace('.js', '.modern.js'));
234230
}
235231
}
236232
updatePlaceholderReactVersionInCompiledArtifacts(
237233
buildDir + '/facebook-www',
238-
ReactVersion + '-www-modern-' + hash.digest('hex').slice(0, 8)
234+
ReactVersion + '-www-modern-%FILEHASH%'
239235
);
240236
}
241237

0 commit comments

Comments
 (0)