forked from facebook/react
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve DX when combining react-dom/profiling and schedule/tracking (f…
…acebook#13605) * Added blessed production+profiling entry point for schedule/tracking * Add invariant when profiling renderer is used with non-profiling schedule/tracking
- Loading branch information
Showing
4 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
packages/react-reconciler/src/__tests__/ReactTracking-test.internal.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @emails react-core | ||
* @jest-environment node | ||
*/ | ||
|
||
'use strict'; | ||
|
||
describe('ReactTracking', () => { | ||
it('should error if profiling renderer and non-profiling schedule/tracking bundles are combined', () => { | ||
jest.resetModules(); | ||
|
||
const ReactFeatureFlags = require('shared/ReactFeatureFlags'); | ||
ReactFeatureFlags.enableSchedulerTracking = false; | ||
|
||
require('schedule/tracking'); | ||
|
||
ReactFeatureFlags.enableSchedulerTracking = true; | ||
|
||
expect(() => require('react-dom')).toThrow( | ||
'Learn more at http://fb.me/react-profiling', | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = require('./cjs/schedule-tracking.profiling.min.js'); | ||
} else { | ||
module.exports = require('./cjs/schedule-tracking.development.js'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ | |
"README.md", | ||
"index.js", | ||
"tracking.js", | ||
"tracking-profiling.js", | ||
"cjs/", | ||
"umd/" | ||
] | ||
|