getIOShortName() — react Function Reference
Architecture documentation for the getIOShortName() function in ReactFlightPerformanceTrack.js from the react codebase.
Entity Profile
Dependency Diagram
graph TD 1fae0211_be70_95cf_fc81_b888b3d13b71["getIOShortName()"] e5244d6e_35d7_7c99_420d_82c7be8fe931["ReactFlightPerformanceTrack.js"] 1fae0211_be70_95cf_fc81_b888b3d13b71 -->|defined in| e5244d6e_35d7_7c99_420d_82c7be8fe931 2060f35f_5c20_8dc4_8358_fe4c45025636["logComponentAwaitAborted()"] 2060f35f_5c20_8dc4_8358_fe4c45025636 -->|calls| 1fae0211_be70_95cf_fc81_b888b3d13b71 140b374c_3cb5_3136_78dd_28fc9fcebf9e["logComponentAwaitErrored()"] 140b374c_3cb5_3136_78dd_28fc9fcebf9e -->|calls| 1fae0211_be70_95cf_fc81_b888b3d13b71 9451f4fe_f2bc_9af9_1665_335f6e9fbde4["logComponentAwait()"] 9451f4fe_f2bc_9af9_1665_335f6e9fbde4 -->|calls| 1fae0211_be70_95cf_fc81_b888b3d13b71 cffda84e_9918_c200_5374_a64e1dd39c68["logIOInfoErrored()"] cffda84e_9918_c200_5374_a64e1dd39c68 -->|calls| 1fae0211_be70_95cf_fc81_b888b3d13b71 aa2e5ee4_c196_6356_596a_168da72d2783["logIOInfo()"] aa2e5ee4_c196_6356_596a_168da72d2783 -->|calls| 1fae0211_be70_95cf_fc81_b888b3d13b71 style 1fae0211_be70_95cf_fc81_b888b3d13b71 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/react-client/src/ReactFlightPerformanceTrack.js lines 328–373
function getIOShortName(
ioInfo: ReactIOInfo,
description: string,
env: void | string,
rootEnv: string,
): string {
const name = ioInfo.name;
const isPrimaryEnv = env === rootEnv;
const envSuffix = isPrimaryEnv || env === undefined ? '' : ' [' + env + ']';
let desc = '';
const descMaxLength = 30 - name.length - envSuffix.length;
if (descMaxLength > 1) {
const l = description.length;
if (l > 0 && l <= descMaxLength) {
// We can fit the full description
desc = ' (' + description + ')';
} else if (
description.startsWith('http://') ||
description.startsWith('https://') ||
description.startsWith('/')
) {
// Looks like a URL. Let's see if we can extract something shorter.
// We don't have to do a full parse so let's try something cheaper.
let queryIdx = description.indexOf('?');
if (queryIdx === -1) {
queryIdx = description.length;
}
if (description.charCodeAt(queryIdx - 1) === 47 /* "/" */) {
// Ends with slash. Look before that.
queryIdx--;
}
const slashIdx = description.lastIndexOf('/', queryIdx - 1);
if (queryIdx - slashIdx < descMaxLength) {
// This may now be either the file name or the host.
// Include the slash to make it more obvious what we trimmed.
desc = ' (…' + description.slice(slashIdx, queryIdx) + ')';
} else {
// cut out the middle to not exceed the max length
const start = description.slice(slashIdx, slashIdx + descMaxLength / 2);
const end = description.slice(queryIdx - descMaxLength / 2, queryIdx);
desc = ' (' + (slashIdx > 0 ? '…' : '') + start + '…' + end + ')';
}
}
}
return name + desc + envSuffix;
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does getIOShortName() do?
getIOShortName() is a function in the react codebase, defined in packages/react-client/src/ReactFlightPerformanceTrack.js.
Where is getIOShortName() defined?
getIOShortName() is defined in packages/react-client/src/ReactFlightPerformanceTrack.js at line 328.
What calls getIOShortName()?
getIOShortName() is called by 5 function(s): logComponentAwait, logComponentAwaitAborted, logComponentAwaitErrored, logIOInfo, logIOInfoErrored.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free