chrome-devtools-frontend 1.0.965611 → 1.0.966086
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/gni/devtools_grd_files.gni +5 -5
- package/front_end/core/protocol_client/InspectorBackend.ts +8 -0
- package/front_end/core/sdk/NetworkManager.ts +58 -70
- package/front_end/entrypoints/formatter_worker/formatter_worker.ts +4 -4
- package/front_end/legacy_test_runner/bindings_test_runner/PersistenceTestRunner.js +2 -2
- package/front_end/legacy_test_runner/heap_profiler_test_runner/heap_profiler_test_runner.js +1 -2
- package/front_end/models/persistence/IsolatedFileSystem.ts +2 -2
- package/front_end/models/persistence/NetworkPersistenceManager.ts +7 -4
- package/front_end/panels/event_listeners/EventListenersUtils.ts +3 -2
- package/front_end/panels/event_listeners/EventListenersView.ts +3 -3
- package/front_end/panels/lighthouse/lighthouse.ts +1 -1
- package/front_end/panels/sources/DebuggerPausedMessage.ts +2 -2
- package/front_end/panels/sources/SourcesPanel.ts +7 -10
- package/front_end/panels/sources/UISourceCodeFrame.ts +4 -4
- package/front_end/panels/sources/debuggerPausedMessage.css +5 -1
- package/front_end/third_party/codemirror/README.chromium +5 -0
- package/front_end/third_party/codemirror/codemirror-tsconfig.json +4 -4
- package/front_end/third_party/codemirror/package/addon/runmode/{runmode-standalone.js → runmode-standalone.mjs} +0 -0
- package/front_end/third_party/codemirror/package/addon/runmode/{runmode-standalone.d.ts → runmode-standalone.mjs.d.ts} +0 -0
- package/front_end/third_party/codemirror/package/mode/css/{css.js → css.mjs} +0 -0
- package/front_end/third_party/codemirror/package/mode/css/{css.d.ts → css.mjs.d.ts} +0 -0
- package/front_end/third_party/codemirror/package/mode/javascript/{javascript.js → javascript.mjs} +0 -0
- package/front_end/third_party/codemirror/package/mode/javascript/{javascript.d.ts → javascript.mjs.d.ts} +0 -0
- package/front_end/third_party/codemirror/package/mode/xml/{xml.js → xml.mjs} +0 -0
- package/front_end/third_party/codemirror/package/mode/xml/{xml.d.ts → xml.mjs.d.ts} +0 -0
- package/front_end/third_party/lighthouse/README.chromium +2 -0
- package/front_end/third_party/lighthouse/lighthouse-tsconfig.json +1 -1
- package/front_end/third_party/lighthouse/report-assets/{report-generator.js → report-generator.mjs} +0 -0
- package/front_end/third_party/lighthouse/report-assets/{report-generator.d.ts → report-generator.mjs.d.ts} +0 -0
- package/front_end/ui/legacy/Icon.ts +2 -2
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +4 -4
- package/front_end/ui/legacy/themeColors.css +1 -1
- package/package.json +1 -1
- package/scripts/build/devtools_plugin.js +10 -0
- package/scripts/build/esbuild.js +62 -0
- package/scripts/build/ninja/bundle.gni +77 -32
@@ -1261,17 +1261,17 @@ grd_files_debug_sources = [
|
|
1261
1261
|
"front_end/third_party/acorn-loose/package/dist/acorn-loose.mjs",
|
1262
1262
|
"front_end/third_party/acorn/package/dist/acorn.mjs",
|
1263
1263
|
"front_end/third_party/chromium/client-variations/ClientVariations.js",
|
1264
|
-
"front_end/third_party/codemirror/package/addon/runmode/runmode-standalone.
|
1265
|
-
"front_end/third_party/codemirror/package/mode/css/css.
|
1266
|
-
"front_end/third_party/codemirror/package/mode/javascript/javascript.
|
1267
|
-
"front_end/third_party/codemirror/package/mode/xml/xml.
|
1264
|
+
"front_end/third_party/codemirror/package/addon/runmode/runmode-standalone.mjs",
|
1265
|
+
"front_end/third_party/codemirror/package/mode/css/css.mjs",
|
1266
|
+
"front_end/third_party/codemirror/package/mode/javascript/javascript.mjs",
|
1267
|
+
"front_end/third_party/codemirror/package/mode/xml/xml.mjs",
|
1268
1268
|
"front_end/third_party/diff/DiffWrapper.js",
|
1269
1269
|
"front_end/third_party/diff/diff_match_patch.js",
|
1270
1270
|
"front_end/third_party/i18n/i18n-impl.js",
|
1271
1271
|
"front_end/third_party/i18n/locales.js",
|
1272
1272
|
"front_end/third_party/i18n/localized-string-set.js",
|
1273
1273
|
"front_end/third_party/intl-messageformat/package/intl-messageformat.esm.js",
|
1274
|
-
"front_end/third_party/lighthouse/report-assets/report-generator.
|
1274
|
+
"front_end/third_party/lighthouse/report-assets/report-generator.mjs",
|
1275
1275
|
"front_end/third_party/lighthouse/report/bundle.js",
|
1276
1276
|
"front_end/third_party/lit-html/directive.js",
|
1277
1277
|
"front_end/third_party/lit-html/directives.js",
|
@@ -648,6 +648,10 @@ export class TargetBase {
|
|
648
648
|
return this.getAgent('EventBreakpoints');
|
649
649
|
}
|
650
650
|
|
651
|
+
fetchAgent(): ProtocolProxyApi.FetchApi {
|
652
|
+
return this.getAgent('Fetch');
|
653
|
+
}
|
654
|
+
|
651
655
|
heapProfilerAgent(): ProtocolProxyApi.HeapProfilerApi {
|
652
656
|
return this.getAgent('HeapProfiler');
|
653
657
|
}
|
@@ -804,6 +808,10 @@ export class TargetBase {
|
|
804
808
|
this.registerDispatcher('DOMStorage', dispatcher);
|
805
809
|
}
|
806
810
|
|
811
|
+
registerFetchDispatcher(dispatcher: ProtocolProxyApi.FetchDispatcher): void {
|
812
|
+
this.registerDispatcher('Fetch', dispatcher);
|
813
|
+
}
|
814
|
+
|
807
815
|
registerHeapProfilerDispatcher(dispatcher: ProtocolProxyApi.HeapProfilerDispatcher): void {
|
808
816
|
this.registerDispatcher('HeapProfiler', dispatcher);
|
809
817
|
}
|
@@ -123,14 +123,17 @@ const CONNECTION_TYPES = new Map([
|
|
123
123
|
|
124
124
|
export class NetworkManager extends SDKModel<EventTypes> {
|
125
125
|
readonly dispatcher: NetworkDispatcher;
|
126
|
+
readonly fetchDispatcher: FetchDispatcher;
|
126
127
|
readonly #networkAgent: ProtocolProxyApi.NetworkApi;
|
127
128
|
readonly #bypassServiceWorkerSetting: Common.Settings.Setting<boolean>;
|
128
129
|
|
129
130
|
constructor(target: Target) {
|
130
131
|
super(target);
|
131
132
|
this.dispatcher = new NetworkDispatcher(this);
|
133
|
+
this.fetchDispatcher = new FetchDispatcher(target.fetchAgent());
|
132
134
|
this.#networkAgent = target.networkAgent();
|
133
135
|
target.registerNetworkDispatcher(this.dispatcher);
|
136
|
+
target.registerFetchDispatcher(this.fetchDispatcher);
|
134
137
|
if (Common.Settings.Settings.instance().moduleSetting('cacheDisabled').get()) {
|
135
138
|
void this.#networkAgent.invoke_setCacheDisabled({cacheDisabled: true});
|
136
139
|
}
|
@@ -372,6 +375,23 @@ export const Fast3GConditions: Conditions = {
|
|
372
375
|
|
373
376
|
const MAX_EAGER_POST_REQUEST_BODY_LENGTH = 64 * 1024; // bytes
|
374
377
|
|
378
|
+
export class FetchDispatcher implements ProtocolProxyApi.FetchDispatcher {
|
379
|
+
readonly #fetchAgent: ProtocolProxyApi.FetchApi;
|
380
|
+
|
381
|
+
constructor(agent: ProtocolProxyApi.FetchApi) {
|
382
|
+
this.#fetchAgent = agent;
|
383
|
+
}
|
384
|
+
|
385
|
+
requestPaused({requestId, request, resourceType, responseStatusCode, responseHeaders}:
|
386
|
+
Protocol.Fetch.RequestPausedEvent): void {
|
387
|
+
void MultitargetNetworkManager.instance().requestIntercepted(new InterceptedRequest(
|
388
|
+
this.#fetchAgent, request, resourceType, requestId, responseStatusCode, responseHeaders));
|
389
|
+
}
|
390
|
+
|
391
|
+
authRequired({}: Protocol.Fetch.AuthRequiredEvent): void {
|
392
|
+
}
|
393
|
+
}
|
394
|
+
|
375
395
|
export class NetworkDispatcher implements ProtocolProxyApi.NetworkDispatcher {
|
376
396
|
readonly #manager: NetworkManager;
|
377
397
|
#requestsById: Map<string, NetworkRequest>;
|
@@ -782,23 +802,7 @@ export class NetworkDispatcher implements ProtocolProxyApi.NetworkDispatcher {
|
|
782
802
|
networkRequest.addEventSourceMessage(time, eventName, eventId, data);
|
783
803
|
}
|
784
804
|
|
785
|
-
requestIntercepted({
|
786
|
-
interceptionId,
|
787
|
-
request,
|
788
|
-
frameId,
|
789
|
-
resourceType,
|
790
|
-
isNavigationRequest,
|
791
|
-
isDownload,
|
792
|
-
redirectUrl,
|
793
|
-
authChallenge,
|
794
|
-
responseErrorReason,
|
795
|
-
responseStatusCode,
|
796
|
-
responseHeaders,
|
797
|
-
requestId,
|
798
|
-
}: Protocol.Network.RequestInterceptedEvent): void {
|
799
|
-
void MultitargetNetworkManager.instance().requestIntercepted(new InterceptedRequest(
|
800
|
-
this.#manager.target().networkAgent(), interceptionId, request, frameId, resourceType, isNavigationRequest,
|
801
|
-
isDownload, redirectUrl, authChallenge, responseErrorReason, responseStatusCode, responseHeaders, requestId));
|
805
|
+
requestIntercepted({}: Protocol.Network.RequestInterceptedEvent): void {
|
802
806
|
}
|
803
807
|
|
804
808
|
requestWillBeSentExtraInfo({requestId, associatedCookies, headers, clientSecurityState, connectTiming}:
|
@@ -1070,7 +1074,8 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
|
|
1070
1074
|
#userAgentOverrideInternal: string;
|
1071
1075
|
#userAgentMetadataOverride: Protocol.Emulation.UserAgentMetadata|null;
|
1072
1076
|
#customAcceptedEncodings: Protocol.Network.ContentEncoding[]|null;
|
1073
|
-
readonly #
|
1077
|
+
readonly #networkAgents: Set<ProtocolProxyApi.NetworkApi>;
|
1078
|
+
readonly #fetchAgents: Set<ProtocolProxyApi.FetchApi>;
|
1074
1079
|
readonly inflightMainResourceRequests: Map<string, NetworkRequest>;
|
1075
1080
|
#networkConditionsInternal: Conditions;
|
1076
1081
|
#updatingInterceptionPatternsPromise: Promise<void>|null;
|
@@ -1087,7 +1092,8 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
|
|
1087
1092
|
this.#userAgentOverrideInternal = '';
|
1088
1093
|
this.#userAgentMetadataOverride = null;
|
1089
1094
|
this.#customAcceptedEncodings = null;
|
1090
|
-
this.#
|
1095
|
+
this.#networkAgents = new Set();
|
1096
|
+
this.#fetchAgents = new Set();
|
1091
1097
|
this.inflightMainResourceRequests = new Map();
|
1092
1098
|
this.#networkConditionsInternal = NoThrottlingConditions;
|
1093
1099
|
this.#updatingInterceptionPatternsPromise = null;
|
@@ -1162,6 +1168,7 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
|
|
1162
1168
|
|
1163
1169
|
modelAdded(networkManager: NetworkManager): void {
|
1164
1170
|
const networkAgent = networkManager.target().networkAgent();
|
1171
|
+
const fetchAgent = networkManager.target().fetchAgent();
|
1165
1172
|
if (this.#extraHeaders) {
|
1166
1173
|
void networkAgent.invoke_setExtraHTTPHeaders({headers: this.#extraHeaders});
|
1167
1174
|
}
|
@@ -1173,14 +1180,15 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
|
|
1173
1180
|
void networkAgent.invoke_setBlockedURLs({urls: this.#effectiveBlockedURLs});
|
1174
1181
|
}
|
1175
1182
|
if (this.isIntercepting()) {
|
1176
|
-
void
|
1183
|
+
void fetchAgent.invoke_enable({patterns: this.#urlsForRequestInterceptor.valuesArray()});
|
1177
1184
|
}
|
1178
1185
|
if (this.#customAcceptedEncodings === null) {
|
1179
1186
|
void networkAgent.invoke_clearAcceptedEncodingsOverride();
|
1180
1187
|
} else {
|
1181
1188
|
void networkAgent.invoke_setAcceptedEncodings({encodings: this.#customAcceptedEncodings});
|
1182
1189
|
}
|
1183
|
-
this.#
|
1190
|
+
this.#networkAgents.add(networkAgent);
|
1191
|
+
this.#fetchAgents.add(fetchAgent);
|
1184
1192
|
if (this.isThrottling()) {
|
1185
1193
|
this.updateNetworkConditions(networkAgent);
|
1186
1194
|
}
|
@@ -1194,7 +1202,8 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
|
|
1194
1202
|
}
|
1195
1203
|
this.inflightMainResourceRequests.delete((entry[0] as string));
|
1196
1204
|
}
|
1197
|
-
this.#
|
1205
|
+
this.#networkAgents.delete(networkManager.target().networkAgent());
|
1206
|
+
this.#fetchAgents.delete(networkManager.target().fetchAgent());
|
1198
1207
|
}
|
1199
1208
|
|
1200
1209
|
isThrottling(): boolean {
|
@@ -1208,7 +1217,7 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
|
|
1208
1217
|
|
1209
1218
|
setNetworkConditions(conditions: Conditions): void {
|
1210
1219
|
this.#networkConditionsInternal = conditions;
|
1211
|
-
for (const agent of this.#
|
1220
|
+
for (const agent of this.#networkAgents) {
|
1212
1221
|
this.updateNetworkConditions(agent);
|
1213
1222
|
}
|
1214
1223
|
this.dispatchEventToListeners(MultitargetNetworkManager.Events.ConditionsChanged);
|
@@ -1236,7 +1245,7 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
|
|
1236
1245
|
|
1237
1246
|
setExtraHTTPHeaders(headers: Protocol.Network.Headers): void {
|
1238
1247
|
this.#extraHeaders = headers;
|
1239
|
-
for (const agent of this.#
|
1248
|
+
for (const agent of this.#networkAgents) {
|
1240
1249
|
void agent.invoke_setExtraHTTPHeaders({headers: this.#extraHeaders});
|
1241
1250
|
}
|
1242
1251
|
}
|
@@ -1247,7 +1256,7 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
|
|
1247
1256
|
|
1248
1257
|
private updateUserAgentOverride(): void {
|
1249
1258
|
const userAgent = this.currentUserAgent();
|
1250
|
-
for (const agent of this.#
|
1259
|
+
for (const agent of this.#networkAgents) {
|
1251
1260
|
void agent.invoke_setUserAgentOverride(
|
1252
1261
|
{userAgent: userAgent, userAgentMetadata: this.#userAgentMetadataOverride || undefined});
|
1253
1262
|
}
|
@@ -1297,7 +1306,7 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
|
|
1297
1306
|
|
1298
1307
|
private updateAcceptedEncodingsOverride(): void {
|
1299
1308
|
const customAcceptedEncodings = this.#customAcceptedEncodings;
|
1300
|
-
for (const agent of this.#
|
1309
|
+
for (const agent of this.#networkAgents) {
|
1301
1310
|
if (customAcceptedEncodings === null) {
|
1302
1311
|
void agent.invoke_clearAcceptedEncodingsOverride();
|
1303
1312
|
} else {
|
@@ -1348,7 +1357,7 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
|
|
1348
1357
|
return;
|
1349
1358
|
}
|
1350
1359
|
this.#effectiveBlockedURLs = urls;
|
1351
|
-
for (const agent of this.#
|
1360
|
+
for (const agent of this.#networkAgents) {
|
1352
1361
|
void agent.invoke_setBlockedURLs({urls: this.#effectiveBlockedURLs});
|
1353
1362
|
}
|
1354
1363
|
}
|
@@ -1381,8 +1390,8 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
|
|
1381
1390
|
}
|
1382
1391
|
this.#updatingInterceptionPatternsPromise = null;
|
1383
1392
|
const promises = ([] as Promise<unknown>[]);
|
1384
|
-
for (const agent of this.#
|
1385
|
-
promises.push(agent.
|
1393
|
+
for (const agent of this.#fetchAgents) {
|
1394
|
+
promises.push(agent.invoke_enable({patterns: this.#urlsForRequestInterceptor.valuesArray()}));
|
1386
1395
|
}
|
1387
1396
|
this.dispatchEventToListeners(MultitargetNetworkManager.Events.InterceptorsChanged);
|
1388
1397
|
await Promise.all(promises);
|
@@ -1401,13 +1410,13 @@ export class MultitargetNetworkManager extends Common.ObjectWrapper.ObjectWrappe
|
|
1401
1410
|
}
|
1402
1411
|
|
1403
1412
|
clearBrowserCache(): void {
|
1404
|
-
for (const agent of this.#
|
1413
|
+
for (const agent of this.#networkAgents) {
|
1405
1414
|
void agent.invoke_clearBrowserCache();
|
1406
1415
|
}
|
1407
1416
|
}
|
1408
1417
|
|
1409
1418
|
clearBrowserCookies(): void {
|
1410
|
-
for (const agent of this.#
|
1419
|
+
for (const agent of this.#networkAgents) {
|
1411
1420
|
void agent.invoke_clearBrowserCookies();
|
1412
1421
|
}
|
1413
1422
|
}
|
@@ -1470,38 +1479,26 @@ export namespace MultitargetNetworkManager {
|
|
1470
1479
|
}
|
1471
1480
|
|
1472
1481
|
export class InterceptedRequest {
|
1473
|
-
readonly #
|
1474
|
-
readonly #interceptionId: Protocol.Network.InterceptionId;
|
1482
|
+
readonly #fetchAgent: ProtocolProxyApi.FetchApi;
|
1475
1483
|
#hasRespondedInternal: boolean;
|
1476
1484
|
request: Protocol.Network.Request;
|
1477
|
-
frameId: Protocol.Page.FrameId;
|
1478
1485
|
resourceType: Protocol.Network.ResourceType;
|
1479
|
-
isNavigationRequest: boolean;
|
1480
|
-
isDownload: boolean;
|
1481
|
-
redirectUrl: string|undefined;
|
1482
|
-
authChallenge: Protocol.Network.AuthChallenge|undefined;
|
1483
|
-
responseErrorReason: Protocol.Network.ErrorReason|undefined;
|
1484
1486
|
responseStatusCode: number|undefined;
|
1485
|
-
responseHeaders: Protocol.
|
1486
|
-
requestId:
|
1487
|
+
responseHeaders: Protocol.Fetch.HeaderEntry[]|undefined;
|
1488
|
+
requestId: Protocol.Fetch.RequestId;
|
1487
1489
|
|
1488
1490
|
constructor(
|
1489
|
-
|
1490
|
-
request: Protocol.Network.Request,
|
1491
|
-
|
1492
|
-
|
1493
|
-
responseStatusCode?: number,
|
1494
|
-
|
1495
|
-
|
1491
|
+
fetchAgent: ProtocolProxyApi.FetchApi,
|
1492
|
+
request: Protocol.Network.Request,
|
1493
|
+
resourceType: Protocol.Network.ResourceType,
|
1494
|
+
requestId: Protocol.Fetch.RequestId,
|
1495
|
+
responseStatusCode?: number,
|
1496
|
+
responseHeaders?: Protocol.Fetch.HeaderEntry[],
|
1497
|
+
) {
|
1498
|
+
this.#fetchAgent = fetchAgent;
|
1496
1499
|
this.#hasRespondedInternal = false;
|
1497
1500
|
this.request = request;
|
1498
|
-
this.frameId = frameId;
|
1499
1501
|
this.resourceType = resourceType;
|
1500
|
-
this.isNavigationRequest = isNavigationRequest;
|
1501
|
-
this.isDownload = Boolean(isDownload);
|
1502
|
-
this.redirectUrl = redirectUrl;
|
1503
|
-
this.authChallenge = authChallenge;
|
1504
|
-
this.responseErrorReason = responseErrorReason;
|
1505
1502
|
this.responseStatusCode = responseStatusCode;
|
1506
1503
|
this.responseHeaders = responseHeaders;
|
1507
1504
|
this.requestId = requestId;
|
@@ -1513,17 +1510,9 @@ export class InterceptedRequest {
|
|
1513
1510
|
|
1514
1511
|
async continueRequestWithContent(contentBlob: Blob): Promise<void> {
|
1515
1512
|
this.#hasRespondedInternal = true;
|
1516
|
-
const
|
1517
|
-
|
1518
|
-
|
1519
|
-
'Server: Chrome Devtools Request Interceptor',
|
1520
|
-
'Connection: closed',
|
1521
|
-
'Content-Length: ' + contentBlob.size,
|
1522
|
-
'Content-Type: ' + contentBlob.type || 'text/x-unknown',
|
1523
|
-
];
|
1524
|
-
const encodedResponse = await blobToBase64(new Blob([headers.join('\r\n'), '\r\n\r\n', contentBlob]));
|
1525
|
-
void this.#networkAgent.invoke_continueInterceptedRequest(
|
1526
|
-
{interceptionId: this.#interceptionId, rawResponse: encodedResponse});
|
1513
|
+
const body = await blobToBase64(contentBlob);
|
1514
|
+
void this.#fetchAgent.invoke_fulfillRequest(
|
1515
|
+
{requestId: this.requestId, responseCode: this.responseStatusCode || 200, body});
|
1527
1516
|
|
1528
1517
|
async function blobToBase64(blob: Blob): Promise<string> {
|
1529
1518
|
const reader = new FileReader();
|
@@ -1548,18 +1537,17 @@ export class InterceptedRequest {
|
|
1548
1537
|
continueRequestWithoutChange(): void {
|
1549
1538
|
console.assert(!this.#hasRespondedInternal);
|
1550
1539
|
this.#hasRespondedInternal = true;
|
1551
|
-
void this.#
|
1540
|
+
void this.#fetchAgent.invoke_continueRequest({requestId: this.requestId});
|
1552
1541
|
}
|
1553
1542
|
|
1554
1543
|
continueRequestWithError(errorReason: Protocol.Network.ErrorReason): void {
|
1555
1544
|
console.assert(!this.#hasRespondedInternal);
|
1556
1545
|
this.#hasRespondedInternal = true;
|
1557
|
-
void this.#
|
1546
|
+
void this.#fetchAgent.invoke_failRequest({requestId: this.requestId, errorReason});
|
1558
1547
|
}
|
1559
1548
|
|
1560
1549
|
async responseBody(): Promise<ContentData> {
|
1561
|
-
const response =
|
1562
|
-
await this.#networkAgent.invoke_getResponseBodyForInterception({interceptionId: this.#interceptionId});
|
1550
|
+
const response = await this.#fetchAgent.invoke_getResponseBody({requestId: this.requestId});
|
1563
1551
|
const error = response.getError() || null;
|
1564
1552
|
return {error: error, content: error ? null : response.body, encoded: response.base64Encoded};
|
1565
1553
|
}
|
@@ -1714,7 +1702,7 @@ export interface Message {
|
|
1714
1702
|
|
1715
1703
|
export interface InterceptionPattern {
|
1716
1704
|
urlPattern: string;
|
1717
|
-
|
1705
|
+
requestStage: Protocol.Fetch.RequestStage;
|
1718
1706
|
}
|
1719
1707
|
|
1720
1708
|
export type RequestInterceptor = (request: InterceptedRequest) => Promise<void>;
|
@@ -2,10 +2,10 @@
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
3
3
|
// found in the LICENSE file.
|
4
4
|
|
5
|
-
import '../../third_party/codemirror/package/addon/runmode/runmode-standalone.
|
6
|
-
import '../../third_party/codemirror/package/mode/css/css.
|
7
|
-
import '../../third_party/codemirror/package/mode/xml/xml.
|
8
|
-
import '../../third_party/codemirror/package/mode/javascript/javascript.
|
5
|
+
import '../../third_party/codemirror/package/addon/runmode/runmode-standalone.mjs';
|
6
|
+
import '../../third_party/codemirror/package/mode/css/css.mjs';
|
7
|
+
import '../../third_party/codemirror/package/mode/xml/xml.mjs';
|
8
|
+
import '../../third_party/codemirror/package/mode/javascript/javascript.mjs';
|
9
9
|
|
10
10
|
import * as CSSFormatter from './CSSFormatter.js';
|
11
11
|
import * as CSSRuleParser from './CSSRuleParser.js';
|
@@ -23,7 +23,7 @@ Persistence.AutomappingStatus.prototype.toString = function() {
|
|
23
23
|
return lines.join('\n');
|
24
24
|
};
|
25
25
|
|
26
|
-
BindingsTestRunner.waitForBinding = function(fileName) {
|
26
|
+
BindingsTestRunner.waitForBinding = async function(fileName) {
|
27
27
|
const uiSourceCodes = self.Workspace.workspace.uiSourceCodes();
|
28
28
|
|
29
29
|
for (const uiSourceCode of uiSourceCodes) {
|
@@ -34,7 +34,7 @@ BindingsTestRunner.waitForBinding = function(fileName) {
|
|
34
34
|
}
|
35
35
|
|
36
36
|
if (uiSourceCode.name() === fileName) {
|
37
|
-
return
|
37
|
+
return binding;
|
38
38
|
}
|
39
39
|
}
|
40
40
|
|
@@ -624,14 +624,13 @@ HeapProfilerTestRunner.takeAndOpenSnapshot = async function(generator, callback)
|
|
624
624
|
const snapshot = generator();
|
625
625
|
const profileType = Profiler.ProfileTypeRegistry.instance.heapSnapshotProfileType;
|
626
626
|
|
627
|
-
function pushGeneratedSnapshot(reportProgress) {
|
627
|
+
async function pushGeneratedSnapshot(reportProgress) {
|
628
628
|
if (reportProgress) {
|
629
629
|
profileType.reportHeapSnapshotProgress({data: {done: 50, total: 100, finished: false}});
|
630
630
|
profileType.reportHeapSnapshotProgress({data: {done: 100, total: 100, finished: true}});
|
631
631
|
}
|
632
632
|
snapshot.snapshot.typeId = 'HEAP';
|
633
633
|
profileType.addHeapSnapshotChunk({data: JSON.stringify(snapshot)});
|
634
|
-
return Promise.resolve();
|
635
634
|
}
|
636
635
|
|
637
636
|
HeapProfilerTestRunner.takeAndOpenSnapshotCallback = callback;
|
@@ -98,12 +98,12 @@ export class IsolatedFileSystem extends PlatformFileSystem {
|
|
98
98
|
this.fileLocks = new Map();
|
99
99
|
}
|
100
100
|
|
101
|
-
static create(
|
101
|
+
static async create(
|
102
102
|
manager: IsolatedFileSystemManager, path: string, embedderPath: string, type: string, name: string,
|
103
103
|
rootURL: string): Promise<IsolatedFileSystem|null> {
|
104
104
|
const domFileSystem = Host.InspectorFrontendHost.InspectorFrontendHostInstance.isolatedFileSystem(name, rootURL);
|
105
105
|
if (!domFileSystem) {
|
106
|
-
return
|
106
|
+
return null as IsolatedFileSystem | null;
|
107
107
|
}
|
108
108
|
|
109
109
|
const fileSystem = new IsolatedFileSystem(manager, path, embedderPath, domFileSystem, type);
|
@@ -383,8 +383,7 @@ export class NetworkPersistenceManager extends Common.ObjectWrapper.ObjectWrappe
|
|
383
383
|
|
384
384
|
return SDK.NetworkManager.MultitargetNetworkManager.instance().setInterceptionHandlerForPatterns(
|
385
385
|
Array.from(patterns).map(
|
386
|
-
pattern =>
|
387
|
-
({urlPattern: pattern, interceptionStage: Protocol.Network.InterceptionStage.HeadersReceived})),
|
386
|
+
pattern => ({urlPattern: pattern, requestStage: Protocol.Fetch.RequestStage.Response})),
|
388
387
|
this.interceptionHandlerBound);
|
389
388
|
}
|
390
389
|
}
|
@@ -467,8 +466,12 @@ export class NetworkPersistenceManager extends Common.ObjectWrapper.ObjectWrappe
|
|
467
466
|
|
468
467
|
let mimeType = '';
|
469
468
|
if (interceptedRequest.responseHeaders) {
|
470
|
-
const
|
471
|
-
|
469
|
+
for (const header of interceptedRequest.responseHeaders) {
|
470
|
+
if (header.name.toLowerCase() === 'content-type') {
|
471
|
+
mimeType = header.value;
|
472
|
+
break;
|
473
|
+
}
|
474
|
+
}
|
472
475
|
}
|
473
476
|
|
474
477
|
if (!mimeType) {
|
@@ -5,10 +5,11 @@
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
6
6
|
import * as SDK from '../../core/sdk/sdk.js';
|
7
7
|
|
8
|
-
export function frameworkEventListeners(object: SDK.RemoteObject.RemoteObject):
|
8
|
+
export async function frameworkEventListeners(object: SDK.RemoteObject.RemoteObject):
|
9
|
+
Promise<FrameworkEventListenersObject> {
|
9
10
|
const domDebuggerModel = object.runtimeModel().target().model(SDK.DOMDebuggerModel.DOMDebuggerModel);
|
10
11
|
if (!domDebuggerModel) {
|
11
|
-
return
|
12
|
+
return {eventListeners: [], internalHandlers: null} as FrameworkEventListenersObject;
|
12
13
|
}
|
13
14
|
|
14
15
|
const listenersResult = {internalHandlers: null, eventListeners: []} as FrameworkEventListenersObject;
|
@@ -116,13 +116,13 @@ export class EventListenersView extends UI.Widget.VBox {
|
|
116
116
|
frameworkEventListenersObject = result;
|
117
117
|
}
|
118
118
|
|
119
|
-
function markInternalEventListeners(): Promise<void> {
|
119
|
+
async function markInternalEventListeners(): Promise<void> {
|
120
120
|
if (!frameworkEventListenersObject) {
|
121
|
-
return
|
121
|
+
return;
|
122
122
|
}
|
123
123
|
|
124
124
|
if (!frameworkEventListenersObject.internalHandlers) {
|
125
|
-
return
|
125
|
+
return;
|
126
126
|
}
|
127
127
|
return frameworkEventListenersObject.internalHandlers.object()
|
128
128
|
.callFunctionJSON(isInternalEventListener as (this: Object) => boolean[], eventListeners.map(handlerArgument))
|
@@ -2,7 +2,7 @@
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
3
3
|
// found in the LICENSE file.
|
4
4
|
|
5
|
-
import '../../third_party/lighthouse/report-assets/report-generator.
|
5
|
+
import '../../third_party/lighthouse/report-assets/report-generator.mjs';
|
6
6
|
|
7
7
|
import * as LighthouseController from './LighthouseController.js';
|
8
8
|
import * as LighthousePanel from './LighthousePanel.js';
|
@@ -142,7 +142,7 @@ export class DebuggerPausedMessage {
|
|
142
142
|
}
|
143
143
|
|
144
144
|
const mainElement = messageWrapper.createChild('div', 'status-main');
|
145
|
-
mainElement.appendChild(UI.Icon.Icon.create('smallicon-info', 'status-icon'));
|
145
|
+
mainElement.appendChild(UI.Icon.Icon.create('smallicon-clear-info', 'status-icon'));
|
146
146
|
const breakpointType = BreakpointTypeNouns.get(data.type);
|
147
147
|
mainElement.appendChild(document.createTextNode(
|
148
148
|
i18nString(UIStrings.pausedOnS, {PH1: breakpointType ? breakpointType() : String(null)})));
|
@@ -256,7 +256,7 @@ export class DebuggerPausedMessage {
|
|
256
256
|
function buildWrapper(mainText: string, subText?: string, title?: string): Element {
|
257
257
|
const messageWrapper = document.createElement('span');
|
258
258
|
const mainElement = messageWrapper.createChild('div', 'status-main');
|
259
|
-
const icon = UI.Icon.Icon.create(errorLike ? 'smallicon-error' : 'smallicon-info', 'status-icon');
|
259
|
+
const icon = UI.Icon.Icon.create(errorLike ? 'smallicon-clear-error' : 'smallicon-clear-info', 'status-icon');
|
260
260
|
mainElement.appendChild(icon);
|
261
261
|
mainElement.appendChild(document.createTextNode(mainText));
|
262
262
|
if (subText) {
|
@@ -1153,12 +1153,11 @@ export class UILocationRevealer implements Common.Revealer.Revealer {
|
|
1153
1153
|
return uILocationRevealerInstance;
|
1154
1154
|
}
|
1155
1155
|
|
1156
|
-
reveal(uiLocation: Object, omitFocus?: boolean): Promise<void> {
|
1156
|
+
async reveal(uiLocation: Object, omitFocus?: boolean): Promise<void> {
|
1157
1157
|
if (!(uiLocation instanceof Workspace.UISourceCode.UILocation)) {
|
1158
|
-
|
1158
|
+
throw new Error('Internal error: not a ui location');
|
1159
1159
|
}
|
1160
1160
|
SourcesPanel.instance().showUILocation(uiLocation, omitFocus);
|
1161
|
-
return Promise.resolve();
|
1162
1161
|
}
|
1163
1162
|
}
|
1164
1163
|
|
@@ -1203,12 +1202,11 @@ export class UISourceCodeRevealer implements Common.Revealer.Revealer {
|
|
1203
1202
|
return uISourceCodeRevealerInstance;
|
1204
1203
|
}
|
1205
1204
|
|
1206
|
-
reveal(uiSourceCode: Object, omitFocus?: boolean): Promise<void> {
|
1205
|
+
async reveal(uiSourceCode: Object, omitFocus?: boolean): Promise<void> {
|
1207
1206
|
if (!(uiSourceCode instanceof Workspace.UISourceCode.UISourceCode)) {
|
1208
|
-
|
1207
|
+
throw new Error('Internal error: not a ui source code');
|
1209
1208
|
}
|
1210
1209
|
SourcesPanel.instance().showUISourceCode(uiSourceCode, undefined, undefined, omitFocus);
|
1211
|
-
return Promise.resolve();
|
1212
1210
|
}
|
1213
1211
|
}
|
1214
1212
|
|
@@ -1226,11 +1224,10 @@ export class DebuggerPausedDetailsRevealer implements Common.Revealer.Revealer {
|
|
1226
1224
|
return debuggerPausedDetailsRevealerInstance;
|
1227
1225
|
}
|
1228
1226
|
|
1229
|
-
reveal(_object: Object): Promise<void> {
|
1230
|
-
if (
|
1231
|
-
return
|
1227
|
+
async reveal(_object: Object): Promise<void> {
|
1228
|
+
if (Common.Settings.Settings.instance().moduleSetting('autoFocusOnDebuggerPausedEnabled').get()) {
|
1229
|
+
return SourcesPanel.instance().setAsCurrentPanel();
|
1232
1230
|
}
|
1233
|
-
return SourcesPanel.instance().setAsCurrentPanel();
|
1234
1231
|
}
|
1235
1232
|
}
|
1236
1233
|
|
@@ -105,9 +105,9 @@ export class UISourceCodeFrame extends
|
|
105
105
|
|
106
106
|
this.initializeUISourceCode();
|
107
107
|
|
108
|
-
function workingCopy(): Promise<TextUtils.ContentProvider.DeferredContent> {
|
108
|
+
async function workingCopy(): Promise<TextUtils.ContentProvider.DeferredContent> {
|
109
109
|
if (uiSourceCode.isDirty()) {
|
110
|
-
return
|
110
|
+
return {content: uiSourceCode.workingCopy(), isEncoded: false};
|
111
111
|
}
|
112
112
|
return uiSourceCode.requestContent();
|
113
113
|
}
|
@@ -494,9 +494,9 @@ export class UISourceCodeFrame extends
|
|
494
494
|
return {
|
495
495
|
box: anchor,
|
496
496
|
hide(): void{},
|
497
|
-
show: (popover: UI.GlassPane.GlassPane): Promise<true> => {
|
497
|
+
show: async(popover: UI.GlassPane.GlassPane): Promise<true> => {
|
498
498
|
popover.contentElement.append(element);
|
499
|
-
return
|
499
|
+
return true;
|
500
500
|
},
|
501
501
|
};
|
502
502
|
}
|
@@ -56,12 +56,16 @@
|
|
56
56
|
}
|
57
57
|
|
58
58
|
.status-icon {
|
59
|
-
filter: hue-rotate(190deg);
|
60
59
|
position: absolute;
|
61
60
|
left: 0;
|
62
61
|
top: calc(50% - 5px);
|
63
62
|
}
|
64
63
|
|
64
|
+
[is="ui-icon"].icon-mask.status-icon,
|
65
|
+
:host-context(.-theme-with-dark-background) [is="ui-icon"].icon-mask.status-icon {
|
66
|
+
--override-icon-mask-background-color: var(--color-button-primary-background-hovering);
|
67
|
+
}
|
68
|
+
|
65
69
|
.paused-status.error-reason .status-icon {
|
66
70
|
filter: none;
|
67
71
|
}
|
@@ -20,3 +20,8 @@ wget -qO- https://registry.npmjs.org/codemirror/-/codemirror-5.61.0.tgz | tar xz
|
|
20
20
|
Local changes applied:
|
21
21
|
- Run `wget -qOpackage/mode/wast/wast.js https://raw.githubusercontent.com/codemirror/CodeMirror/0bf9231f90925acc7b273ef9aaf89730ddf6e07b/mode/wast/wast.js` to synchronize unreleased changes for WebAssembly disassembly syntax highlighting.
|
22
22
|
- Some files have a `.d.ts` file added, as they are used during TypeScript compilation
|
23
|
+
- Change extension of following files from `.js` to `.mjs`.
|
24
|
+
- package/addon/runmode/runmode-standalone.js
|
25
|
+
- package/mode/css/css.js
|
26
|
+
- package/mode/javascript/javascript.js
|
27
|
+
- package/mode/xml/xml.js
|
@@ -3,9 +3,9 @@
|
|
3
3
|
"composite": true
|
4
4
|
},
|
5
5
|
"files": [
|
6
|
-
"package/addon/runmode/runmode-standalone.
|
7
|
-
"package/mode/css/css.
|
8
|
-
"package/mode/javascript/javascript.
|
9
|
-
"package/mode/xml/xml.
|
6
|
+
"package/addon/runmode/runmode-standalone.mjs",
|
7
|
+
"package/mode/css/css.mjs",
|
8
|
+
"package/mode/javascript/javascript.mjs",
|
9
|
+
"package/mode/xml/xml.mjs"
|
10
10
|
]
|
11
11
|
}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
package/front_end/third_party/codemirror/package/mode/javascript/{javascript.js → javascript.mjs}
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
package/front_end/third_party/lighthouse/report-assets/{report-generator.js → report-generator.mjs}
RENAMED
File without changes
|
File without changes
|
@@ -131,8 +131,8 @@ const initialDescriptors = new Map<string, Descriptor>([
|
|
131
131
|
['smallicon-warning', {position: 'd1', spritesheet: 'smallicons'}],
|
132
132
|
['smallicon-network-product', {position: 'e1', spritesheet: 'smallicons'}],
|
133
133
|
['smallicon-clear-warning', {position: 'f1', spritesheet: 'smallicons', isMask: true}],
|
134
|
-
['smallicon-clear-info', {position: 'f2', spritesheet: 'smallicons'}],
|
135
|
-
['smallicon-clear-error', {position: 'f3', spritesheet: 'smallicons'}],
|
134
|
+
['smallicon-clear-info', {position: 'f2', spritesheet: 'smallicons', isMask: true}],
|
135
|
+
['smallicon-clear-error', {position: 'f3', spritesheet: 'smallicons', isMask: true}],
|
136
136
|
['smallicon-account-circle', {position: 'f4', spritesheet: 'smallicons'}],
|
137
137
|
['smallicon-videoplayer-paused', {position: 'f6', spritesheet: 'smallicons', isMask: true}],
|
138
138
|
['smallicon-videoplayer-playing', {position: 'g6', spritesheet: 'smallicons', isMask: true}],
|
@@ -1612,12 +1612,12 @@ export class Renderer implements UI.UIUtils.Renderer {
|
|
1612
1612
|
return rendererInstance;
|
1613
1613
|
}
|
1614
1614
|
|
1615
|
-
render(object: Object, options?: UI.UIUtils.Options): Promise<{
|
1615
|
+
async render(object: Object, options?: UI.UIUtils.Options): Promise<{
|
1616
1616
|
node: Node,
|
1617
1617
|
tree: UI.TreeOutline.TreeOutline|null,
|
1618
1618
|
}|null> {
|
1619
1619
|
if (!(object instanceof SDK.RemoteObject.RemoteObject)) {
|
1620
|
-
|
1620
|
+
throw new Error('Can\'t render ' + object);
|
1621
1621
|
}
|
1622
1622
|
options = options || {title: undefined, editable: undefined};
|
1623
1623
|
const title = options.title;
|
@@ -1626,10 +1626,10 @@ export class Renderer implements UI.UIUtils.Renderer {
|
|
1626
1626
|
section.titleLessMode();
|
1627
1627
|
}
|
1628
1628
|
section.editable = Boolean(options.editable);
|
1629
|
-
return
|
1629
|
+
return {node: section.element, tree: section} as {
|
1630
1630
|
node: Node,
|
1631
1631
|
tree: UI.TreeOutline.TreeOutline | null,
|
1632
|
-
} | null
|
1632
|
+
} | null;
|
1633
1633
|
}
|
1634
1634
|
}
|
1635
1635
|
|
@@ -267,7 +267,7 @@
|
|
267
267
|
--color-input-text-disabled: rgba(128 134 139 / 70%);
|
268
268
|
/* Colors for styling buttons */
|
269
269
|
--color-button-outline-focus: rgb(138 180 248 / 75%);
|
270
|
-
--color-button-primary-background-hovering: rgb(
|
270
|
+
--color-button-primary-background-hovering: rgb(128 167 229 / 100%);
|
271
271
|
--color-button-primary-background-pressed: rgb(210 227 252 / 100%);
|
272
272
|
--color-button-primary-text: rgb(0 0 0);
|
273
273
|
--color-button-secondary-background-hovering: rgb(138 180 248 / 15%);
|
package/package.json
CHANGED
@@ -42,6 +42,16 @@ function devtoolsPlugin(source, importer) {
|
|
42
42
|
if (!importer) {
|
43
43
|
return null;
|
44
44
|
}
|
45
|
+
|
46
|
+
if (source === '../../lib/codemirror' || source === 'fs') {
|
47
|
+
// These are imported via require(...), but we don't use
|
48
|
+
// @rollup/plugin-commonjs. So this check is not necessary for rollup. But
|
49
|
+
// need to have this for esbuild as it doesn't ignore require(...).
|
50
|
+
return {
|
51
|
+
external: true,
|
52
|
+
};
|
53
|
+
}
|
54
|
+
|
45
55
|
const currentDirectory = path.normalize(dirnameWithSeparator(importer));
|
46
56
|
const importedFilelocation = path.normalize(path.join(currentDirectory, source));
|
47
57
|
const importedFileDirectory = dirnameWithSeparator(importedFilelocation);
|
@@ -0,0 +1,62 @@
|
|
1
|
+
// Copyright 2022 The Chromium Authors. All rights reserved.
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
3
|
+
// found in the LICENSE file.
|
4
|
+
|
5
|
+
// @ts-check
|
6
|
+
|
7
|
+
const path = require('path');
|
8
|
+
|
9
|
+
const devtools_paths = require('../devtools_paths.js');
|
10
|
+
const devtools_plugin = require('./devtools_plugin.js');
|
11
|
+
|
12
|
+
// esbuild module uses binary in this path.
|
13
|
+
process.env.ESBUILD_BINARY_PATH = path.join(devtools_paths.devtoolsRootPath(), 'third_party', 'esbuild', 'esbuild');
|
14
|
+
|
15
|
+
const entryPoints = [process.argv[2]];
|
16
|
+
const outfile = process.argv[3];
|
17
|
+
|
18
|
+
const outdir = path.dirname(outfile);
|
19
|
+
|
20
|
+
const plugin = {
|
21
|
+
name: 'devtools-plugin',
|
22
|
+
setup(build) {
|
23
|
+
// https://esbuild.github.io/plugins/#on-resolve
|
24
|
+
build.onResolve({filter: /.*/}, args => {
|
25
|
+
const res = devtools_plugin.devtoolsPlugin(args.path, args.importer);
|
26
|
+
if (!res) {
|
27
|
+
return null;
|
28
|
+
}
|
29
|
+
|
30
|
+
if (res.external && res.id) {
|
31
|
+
return {
|
32
|
+
external: res.external,
|
33
|
+
path: './' + path.relative(outdir, res.id),
|
34
|
+
};
|
35
|
+
}
|
36
|
+
|
37
|
+
if (res.external) {
|
38
|
+
return {
|
39
|
+
external: true,
|
40
|
+
};
|
41
|
+
}
|
42
|
+
|
43
|
+
return {
|
44
|
+
path: res.id,
|
45
|
+
};
|
46
|
+
});
|
47
|
+
},
|
48
|
+
};
|
49
|
+
|
50
|
+
require('esbuild')
|
51
|
+
.build({
|
52
|
+
entryPoints,
|
53
|
+
outfile,
|
54
|
+
bundle: true,
|
55
|
+
format: 'esm',
|
56
|
+
platform: 'browser',
|
57
|
+
plugins: [plugin],
|
58
|
+
})
|
59
|
+
.catch(err => {
|
60
|
+
console.error('failed to run esbuild:', err);
|
61
|
+
process.exit(1);
|
62
|
+
});
|
@@ -2,46 +2,91 @@
|
|
2
2
|
# Use of this source code is governed by a BSD-style license that can be
|
3
3
|
# found in the LICENSE file.
|
4
4
|
|
5
|
+
import("../../../third_party/typescript/typescript.gni")
|
5
6
|
import("./node.gni")
|
6
7
|
import("./vars.gni")
|
7
8
|
|
9
|
+
declare_args() {
|
10
|
+
# If this is enabled, devtools build uses esbuild instead of rollup.js to
|
11
|
+
# bundle JavaScript files.
|
12
|
+
devtools_fast_bundle = devtools_skip_typecheck
|
13
|
+
}
|
14
|
+
|
15
|
+
assert(!(devtools_fast_bundle && is_official_build),
|
16
|
+
"Official build should not bundle with esbuild")
|
17
|
+
|
8
18
|
template("bundle") {
|
9
19
|
assert(defined(invoker.entrypoint),
|
10
20
|
"You must define the 'entrypoint' for a bundle target")
|
11
21
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
if (!devtools_dcheck_always_on) {
|
42
|
-
args += [ "--configDCHECK" ]
|
22
|
+
if (devtools_fast_bundle) {
|
23
|
+
node_action(target_name) {
|
24
|
+
script = "scripts/build/esbuild.js"
|
25
|
+
forward_variables_from(invoker,
|
26
|
+
[
|
27
|
+
"visibility",
|
28
|
+
"deps",
|
29
|
+
"public_deps",
|
30
|
+
])
|
31
|
+
|
32
|
+
inputs = [
|
33
|
+
invoker.entrypoint,
|
34
|
+
devtools_location_prepend + "scripts/build/devtools_plugin.js",
|
35
|
+
devtools_location_prepend + "scripts/devtools_paths.js",
|
36
|
+
]
|
37
|
+
|
38
|
+
_esbuild = devtools_location_prepend + "third_party/esbuild/esbuild"
|
39
|
+
if (host_os == "win") {
|
40
|
+
inputs += [ _esbuild + ".exe" ]
|
41
|
+
} else {
|
42
|
+
inputs += [ _esbuild ]
|
43
|
+
}
|
44
|
+
|
45
|
+
args = [
|
46
|
+
rebase_path(invoker.entrypoint, root_build_dir),
|
47
|
+
rebase_path(invoker.output_file_location, root_build_dir),
|
48
|
+
]
|
49
|
+
|
50
|
+
outputs = [ invoker.output_file_location ]
|
43
51
|
}
|
52
|
+
} else {
|
53
|
+
node_action(target_name) {
|
54
|
+
script = "node_modules/rollup/dist/bin/rollup"
|
55
|
+
|
56
|
+
forward_variables_from(invoker,
|
57
|
+
[
|
58
|
+
"visibility",
|
59
|
+
"deps",
|
60
|
+
"public_deps",
|
61
|
+
])
|
62
|
+
|
63
|
+
inputs = [
|
64
|
+
invoker.entrypoint,
|
65
|
+
devtools_location_prepend + "scripts/build/rollup.config.js",
|
66
|
+
devtools_location_prepend + "scripts/build/devtools_plugin.js",
|
67
|
+
devtools_location_prepend + "scripts/devtools_paths.js",
|
68
|
+
]
|
44
69
|
|
45
|
-
|
70
|
+
args = [
|
71
|
+
# TODO(crbug.com/1098074): We need to hide warnings that are written stderr,
|
72
|
+
# as Chromium does not process the returncode of the subprocess correctly
|
73
|
+
# and instead looks if `stderr` is empty.
|
74
|
+
"--silent",
|
75
|
+
"--config",
|
76
|
+
rebase_path(
|
77
|
+
devtools_location_prepend + "scripts/build/rollup.config.js",
|
78
|
+
root_build_dir),
|
79
|
+
"--input",
|
80
|
+
rebase_path(invoker.entrypoint, root_build_dir),
|
81
|
+
"--file",
|
82
|
+
rebase_path(invoker.output_file_location, root_build_dir),
|
83
|
+
]
|
84
|
+
|
85
|
+
if (!devtools_dcheck_always_on) {
|
86
|
+
args += [ "--configDCHECK" ]
|
87
|
+
}
|
88
|
+
|
89
|
+
outputs = [ invoker.output_file_location ]
|
90
|
+
}
|
46
91
|
}
|
47
92
|
}
|