Skip to content

Commit 3fceabc

Browse files
committed
refactor[ci/build]: preserve header format in artifacts (#27671)
In order to make Haste work with React's artifacts, It is important to keep headers in this format: ``` /** * ... ... * ... */ ``` For optimization purposes, Closure compiler will actually modify these headers by removing * prefixes, which is expected. We should pass sources to the compiler without license headers, with these changes the current flow will be: 1. Apply top-level definitions. For UMD-bundles, for example, or DEV-only bundles (e. g. `if (__DEV__) { ...`) 2. Apply licence headers for artifacts with sourcemaps: oss-production and oss-profiling bundles, they don't need to preserve the header format to comply with Haste. We need to apply these headers before passing sources to Closure, so it can build correct mappings for sourcemaps. 3. Pass these sources to closure compiler for minification and sourcemaps building. 4. Apply licence headers for artifacts without sourcemaps: dev bundles, fb bundles. This way the header style will be preserved and not changed by Closure. DiffTrain build for [c47c306a7a23d3c796b148d303764e2832da480c](facebook/react@c47c306)
1 parent e523a5e commit 3fceabc

File tree

59 files changed

+391
-400
lines changed

Some content is hidden

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

59 files changed

+391
-400
lines changed

compiled/facebook-www/JSXDEVRuntime-dev.classic.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/**
2-
* @preserve
32
* Copyright (c) Meta Platforms, Inc. and affiliates.
43
*
54
* This source code is licensed under the MIT license found in the

compiled/facebook-www/JSXDEVRuntime-dev.modern.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/**
2-
* @preserve
32
* Copyright (c) Meta Platforms, Inc. and affiliates.
43
*
54
* This source code is licensed under the MIT license found in the

compiled/facebook-www/JSXDEVRuntime-prod.classic.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
/*
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*
7+
* @noflow
8+
* @nolint
9+
* @preventMunge
10+
* @preserve-invariant-messages
11+
*/
212

3-
Copyright (c) Meta Platforms, Inc. and affiliates.
4-
5-
This source code is licensed under the MIT license found in the
6-
LICENSE file in the root directory of this source tree.
7-
8-
@noflow
9-
@nolint
10-
@preventMunge
11-
@preserve-invariant-messages
12-
*/
1313
"use strict";
1414
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
1515
require("ReactFeatureFlags");

compiled/facebook-www/JSXDEVRuntime-prod.modern.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
/*
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*
7+
* @noflow
8+
* @nolint
9+
* @preventMunge
10+
* @preserve-invariant-messages
11+
*/
212

3-
Copyright (c) Meta Platforms, Inc. and affiliates.
4-
5-
This source code is licensed under the MIT license found in the
6-
LICENSE file in the root directory of this source tree.
7-
8-
@noflow
9-
@nolint
10-
@preventMunge
11-
@preserve-invariant-messages
12-
*/
1313
"use strict";
1414
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
1515
require("ReactFeatureFlags");

compiled/facebook-www/JSXDEVRuntime-profiling.classic.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
/*
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*
7+
* @noflow
8+
* @nolint
9+
* @preventMunge
10+
* @preserve-invariant-messages
11+
*/
212

3-
Copyright (c) Meta Platforms, Inc. and affiliates.
4-
5-
This source code is licensed under the MIT license found in the
6-
LICENSE file in the root directory of this source tree.
7-
8-
@noflow
9-
@nolint
10-
@preventMunge
11-
@preserve-invariant-messages
12-
*/
1313
"use strict";
1414
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
1515
require("ReactFeatureFlags");

compiled/facebook-www/JSXDEVRuntime-profiling.modern.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
/*
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*
7+
* @noflow
8+
* @nolint
9+
* @preventMunge
10+
* @preserve-invariant-messages
11+
*/
212

3-
Copyright (c) Meta Platforms, Inc. and affiliates.
4-
5-
This source code is licensed under the MIT license found in the
6-
LICENSE file in the root directory of this source tree.
7-
8-
@noflow
9-
@nolint
10-
@preventMunge
11-
@preserve-invariant-messages
12-
*/
1313
"use strict";
1414
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
1515
require("ReactFeatureFlags");

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
746890329452cbec8685eb3466847c5f17d9dc77
1+
c47c306a7a23d3c796b148d303764e2832da480c

compiled/facebook-www/React-dev.classic.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/**
2-
* @preserve
32
* Copyright (c) Meta Platforms, Inc. and affiliates.
43
*
54
* This source code is licensed under the MIT license found in the
@@ -25,7 +24,7 @@ if (__DEV__) {
2524
) {
2625
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
2726
}
28-
var ReactVersion = "18.3.0-www-classic-f8cc3c6a";
27+
var ReactVersion = "18.3.0-www-classic-b3007162";
2928

3029
// ATTENTION
3130
// When adding new symbols to this file,

compiled/facebook-www/React-dev.modern.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/**
2-
* @preserve
32
* Copyright (c) Meta Platforms, Inc. and affiliates.
43
*
54
* This source code is licensed under the MIT license found in the
@@ -25,7 +24,7 @@ if (__DEV__) {
2524
) {
2625
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
2726
}
28-
var ReactVersion = "18.3.0-www-modern-d32ba12c";
27+
var ReactVersion = "18.3.0-www-modern-a41cc3f4";
2928

3029
// ATTENTION
3130
// When adding new symbols to this file,

compiled/facebook-www/React-prod.classic.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
/*
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*
7+
* @noflow
8+
* @nolint
9+
* @preventMunge
10+
* @preserve-invariant-messages
11+
*/
212

3-
Copyright (c) Meta Platforms, Inc. and affiliates.
4-
5-
This source code is licensed under the MIT license found in the
6-
LICENSE file in the root directory of this source tree.
7-
8-
@noflow
9-
@nolint
10-
@preventMunge
11-
@preserve-invariant-messages
12-
*/
1313
"use strict";
1414
var REACT_ELEMENT_TYPE = Symbol.for("react.element"),
1515
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
@@ -587,4 +587,4 @@ exports.useSyncExternalStore = function (
587587
exports.useTransition = function () {
588588
return ReactCurrentDispatcher.current.useTransition();
589589
};
590-
exports.version = "18.3.0-www-classic-d1dd6614";
590+
exports.version = "18.3.0-www-classic-93c0536e";

0 commit comments

Comments
 (0)