-
Notifications
You must be signed in to change notification settings - Fork 47k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#22988 - Fix Bug: @license header in React 18 bundles contains vundefined #23004
Conversation
try |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Actually, I need to think on this one further.
This change will fix the undefined
issue but the version number shown in the header comment will lag behind the version we are building to publish.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing approval for now to avoid confusion.
If I can help with something else LMK please |
There's an interesting mix of concerns here between the Rollup scripts that are building the JS bundles we're about to publish and the bespoke release scripts we use that inject the right version number after building and before publishing. Honestly maybe the best fix here for now is just to remove the version from the header comment. 😄 diff --git a/scripts/rollup/wrappers.js b/scripts/rollup/wrappers.js
index 46b162cee..9f61b8b17 100644
--- a/scripts/rollup/wrappers.js
+++ b/scripts/rollup/wrappers.js
@@ -3,7 +3,6 @@
const {resolve} = require('path');
const {readFileSync} = require('fs');
const {bundleTypes, moduleTypes} = require('./bundles');
-const reactVersion = require('../../packages/react-dom/package.json').version;
const {
NODE_ES2015,
@@ -54,7 +53,8 @@ const license = ` * Copyright (c) Facebook, Inc. and its affiliates.
const wrappers = {
/***************** NODE_ES2015 *****************/
[NODE_ES2015](source, globalName, filename, moduleType) {
- return `/** @license React v${reactVersion}
+ return `/**
+ * @license React
* ${filename}
*
${license}
@@ -67,7 +67,8 @@ ${source}`;
/***************** NODE_ESM *****************/
[NODE_ESM](source, globalName, filename, moduleType) {
- return `/** @license React v${reactVersion}
+ return `/**
+ * @license React
* ${filename}
*
${license}
@@ -78,7 +79,8 @@ ${source}`;
/***************** UMD_DEV *****************/
[UMD_DEV](source, globalName, filename, moduleType) {
- return `/** @license React v${reactVersion}
+ return `/**
+ * @license React
* ${filename}
*
${license}
@@ -88,7 +90,8 @@ ${source}`;
/***************** UMD_PROD *****************/
[UMD_PROD](source, globalName, filename, moduleType) {
- return `/** @license React v${reactVersion}
+ return `/**
+ * @license React
* ${filename}
*
${license}
@@ -98,7 +101,8 @@ ${license}
/***************** UMD_PROFILING *****************/
[UMD_PROFILING](source, globalName, filename, moduleType) {
- return `/** @license React v${reactVersion}
+ return `/**
+ * @license React
* ${filename}
*
${license}
@@ -108,7 +112,8 @@ ${license}
/***************** NODE_DEV *****************/
[NODE_DEV](source, globalName, filename, moduleType) {
- return `/** @license React v${reactVersion}
+ return `/**
+ * @license React
* ${filename}
*
${license}
@@ -125,7 +130,8 @@ ${source}
/***************** NODE_PROD *****************/
[NODE_PROD](source, globalName, filename, moduleType) {
- return `/** @license React v${reactVersion}
+ return `/**
+ * @license React
* ${filename}
*
${license}
@@ -135,7 +141,8 @@ ${source}`;
/***************** NODE_PROFILING *****************/
[NODE_PROFILING](source, globalName, filename, moduleType) {
- return `/** @license React v${reactVersion}
+ return `/**
+ * @license React
* ${filename}
*
${license}
@@ -294,7 +301,8 @@ ${source}`;
const reconcilerWrappers = {
/***************** NODE_DEV (reconciler only) *****************/
[NODE_DEV](source, globalName, filename, moduleType) {
- return `/** @license React v${reactVersion}
+ return `/**
+ * @license React
* ${filename}
*
${license}
@@ -313,7 +321,8 @@ ${source}
/***************** NODE_PROD (reconciler only) *****************/
[NODE_PROD](source, globalName, filename, moduleType) {
- return `/** @license React v${reactVersion}
+ return `/**
+ * @license React
* ${filename}
*
${license}
@@ -327,7 +336,8 @@ ${source}
/***************** NODE_PROFILING (reconciler only) *****************/
[NODE_PROFILING](source, globalName, filename, moduleType) {
- return `/** @license React v${reactVersion}
+ return `/**
+ * @license React
* ${filename}
*
${license} |
haha, ok, i pushed the change |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Summary: This sync includes the following changes: - **[fe905f152](facebook/react@fe905f152 )**: Update package.json ([#22954](facebook/react#22954)) //<Jack Works>// - **[3dc41d8a2](facebook/react@3dc41d8a2 )**: fix: parseExportNamesInto specifiers typo ([#22537](facebook/react#22537)) //<btea>// - **[bd0a5dd68](facebook/react@bd0a5dd68 )**: #22988 - Fix Bug: license header in React 18 bundles contains vundefined ([#23004](facebook/react#23004)) //<Vitalie>// - **[ceee524a8](facebook/react@ceee524a8 )**: Remove unnecessary clearContainer call ([#22979](facebook/react#22979)) //<Sebastian Markbåge>// - **[cd1a3e9b5](facebook/react@cd1a3e9b5 )**: Build both a partial renderer and fizz renderer of the legacy API for FB ([#22933](facebook/react#22933)) //<Sebastian Markbåge>// Changelog: [General][Changed] - React Native sync for revisions a049aa0...fe905f1 jest_e2e[run_all_tests] Reviewed By: rickhanlonii Differential Revision: D33512179 fbshipit-source-id: c2df06c8af6bb674ea0c5524538259e6d6d98f78
…s vundefined (facebook#23004) * Fix Bug: @license header in React 18 bundles contains vundefined * Remove React version from the header comment
…s vundefined (facebook#23004) * Fix Bug: @license header in React 18 bundles contains vundefined * Remove React version from the header comment
Fix the version issue - #22988