Skip to content

Commit 69c5dcc

Browse files
Jason LasterjasonLaster
Jason Laster
authored andcommitted
sync 127
1 parent e576a4a commit 69c5dcc

File tree

13 files changed

+100
-85
lines changed

13 files changed

+100
-85
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ env:
1212
global:
1313
- DISPLAY=':99.0'
1414
- YARN_VERSION='1.9.4'
15-
- MC_COMMIT='1a199fcf0ef6' # https://hg.mozilla.org/mozilla-central/shortlog
15+
- MC_COMMIT='d97cc5b9eeae' # https://hg.mozilla.org/mozilla-central/shortlog
1616

1717
notifications:
1818
slack:

src/actions/breakpoints/tests/__snapshots__/breakpoints.spec.js.snap

-14
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,8 @@ Array [
4545
},
4646
],
4747
"contentType": "text/javascript",
48-
"error": undefined,
4948
"id": "a",
50-
"isBlackBoxed": false,
51-
"isExtension": false,
52-
"isPrettyPrinted": false,
53-
"isWasm": false,
5449
"loadedState": "loaded",
55-
"relativeUrl": "/examples/a",
56-
"sourceMapURL": undefined,
5750
"text": "function a() {
5851
return a
5952
}",
@@ -145,15 +138,8 @@ Array [
145138
},
146139
],
147140
"contentType": "text/javascript",
148-
"error": undefined,
149141
"id": "a",
150-
"isBlackBoxed": false,
151-
"isExtension": false,
152-
"isPrettyPrinted": false,
153-
"isWasm": false,
154142
"loadedState": "loaded",
155-
"relativeUrl": "/examples/a",
156-
"sourceMapURL": undefined,
157143
"text": "function a() {
158144
return a
159145
}",

src/actions/pause/commands.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import type { ThunkArgs } from "../types";
2222
import type { Command } from "../../reducers/types";
2323

2424
export function selectThread(thread: string) {
25-
return { type: "SELECT_THREAD", thread }
25+
return { type: "SELECT_THREAD", thread };
2626
}
2727

2828
/**

src/actions/sources/newSources.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -219,18 +219,17 @@ export function newSource(source: Source) {
219219

220220
export function newSources(sources: Source[]) {
221221
return async ({ dispatch, getState }: ThunkArgs) => {
222-
223-
const newSources = sources.filter(
222+
const _newSources = sources.filter(
224223
source => !getSource(getState(), source.id)
225224
);
226225

227226
dispatch({ type: "ADD_SOURCES", sources });
228227

229-
for (const source of newSources) {
228+
for (const source of _newSources) {
230229
dispatch(checkSelectedSource(source.id));
231230
}
232231

233-
dispatch(restoreBlackBoxedSources(newSources));
234-
dispatch(loadSourceMaps(newSources));
232+
dispatch(restoreBlackBoxedSources(_newSources));
233+
dispatch(loadSourceMaps(_newSources));
235234
};
236235
}

src/actions/sources/select.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,10 @@ export function selectSourceURL(
8787
* @memberof actions/sources
8888
* @static
8989
*/
90-
export function selectSource(sourceId: string,
91-
options: PartialPosition = { line: 1 }) {
90+
export function selectSource(
91+
sourceId: string,
92+
options: PartialPosition = { line: 1 }
93+
) {
9294
return async ({ dispatch }: ThunkArgs) => {
9395
const location = createLocation({ ...options, sourceId });
9496
return await dispatch(selectSpecificLocation(location));

src/actions/sources/tests/__snapshots__/prettyPrint.spec.js.snap

-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ exports[`sources - pretty print returns a pretty source for a minified file 1`]
44
Object {
55
"actors": Array [],
66
"contentType": "text/javascript",
7-
"error": undefined,
87
"id": "base.js/originalSource-36c718d4bde9a75edb388ff7733efe7f",
98
"introductionUrl": null,
109
"isBlackBoxed": false,
@@ -13,7 +12,6 @@ Object {
1312
"isWasm": false,
1413
"loadedState": "loaded",
1514
"relativeUrl": "http://localhost:8000/examples/base.js:formatted",
16-
"sourceMapURL": undefined,
1715
"text": "undefined
1816
",
1917
"url": "http://localhost:8000/examples/base.js:formatted",

src/components/PrimaryPanes/tests/__snapshots__/PrimaryPanes.spec.js.snap

+6-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ exports[`PrimaryPanes with custom root renders custom root source list 1`] = `
3232
className="source-outline-panel has-root"
3333
hasFocusableContent={true}
3434
>
35-
<div>
35+
<div
36+
className="threads-list"
37+
>
3638
<div
3739
className="sources-clear-root-container"
3840
key="root"
@@ -96,7 +98,9 @@ exports[`PrimaryPanes with custom root renders empty custom root source list 1`]
9698
className="source-outline-panel has-root"
9799
hasFocusableContent={true}
98100
>
99-
<div>
101+
<div
102+
className="threads-list"
103+
>
100104
<div
101105
className="sources-clear-root-container"
102106
key="root"

src/components/PrimaryPanes/tests/__snapshots__/SourcesTree.spec.js.snap

+52-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,21 @@
22

33
exports[`SourcesTree After changing expanded nodes Shows the tree with four.js, five.js and six.js expanded 1`] = `
44
<div
5-
className="sources-pane"
5+
className="sources-pane thread"
66
key="pane"
77
>
8+
<div
9+
className="node thread-header"
10+
>
11+
<AccessibleImage
12+
className="file"
13+
/>
14+
<span
15+
className="label"
16+
>
17+
Main Thread
18+
</span>
19+
</div>
820
<div
921
className="sources-list"
1022
key="tree"
@@ -38,9 +50,21 @@ exports[`SourcesTree After changing expanded nodes Shows the tree with four.js,
3850

3951
exports[`SourcesTree Should show the tree with nothing expanded 1`] = `
4052
<div
41-
className="sources-pane"
53+
className="sources-pane thread"
4254
key="pane"
4355
>
56+
<div
57+
className="node thread-header"
58+
>
59+
<AccessibleImage
60+
className="file"
61+
/>
62+
<span
63+
className="label"
64+
>
65+
Main Thread
66+
</span>
67+
</div>
4468
<div
4569
className="sources-list"
4670
key="tree"
@@ -67,9 +91,21 @@ exports[`SourcesTree Should show the tree with nothing expanded 1`] = `
6791

6892
exports[`SourcesTree When loading initial source Shows the tree with one.js, two.js and three.js expanded 1`] = `
6993
<div
70-
className="sources-pane"
94+
className="sources-pane thread"
7195
key="pane"
7296
>
97+
<div
98+
className="node thread-header"
99+
>
100+
<AccessibleImage
101+
className="file"
102+
/>
103+
<span
104+
className="label"
105+
>
106+
Main Thread
107+
</span>
108+
</div>
73109
<div
74110
className="sources-list"
75111
key="tree"
@@ -103,9 +139,21 @@ exports[`SourcesTree When loading initial source Shows the tree with one.js, two
103139

104140
exports[`SourcesTree on receiving new props updates highlighted items updates highlightItems if selectedSource changes 1`] = `
105141
<div
106-
className="sources-pane"
142+
className="sources-pane thread"
107143
key="pane"
108144
>
145+
<div
146+
className="node thread-header"
147+
>
148+
<AccessibleImage
149+
className="file"
150+
/>
151+
<span
152+
className="label"
153+
>
154+
Main Thread
155+
</span>
156+
</div>
109157
<div
110158
className="sources-list"
111159
key="tree"

src/main.development.js

-9
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,7 @@
77
import React from "react";
88
import ReactDOM from "react-dom";
99

10-
import { isFirefoxPanel } from "devtools-environment";
11-
1210
import { onConnect } from "./client";
13-
import { teardownWorkers } from "./utils/bootstrap";
14-
import sourceQueue from "./utils/source-queue";
15-
16-
function unmountRoot() {
17-
const mount = document.querySelector("#mount .launchpad-root");
18-
ReactDOM.unmountComponentAtNode(mount);
19-
}
2011

2112
const { bootstrap, L10N } = require("devtools-launchpad");
2213

src/main.js

+13-14
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
// @flow
66

7-
import React from "react";
87
import ReactDOM from "react-dom";
98

109
import { onConnect } from "./client";
@@ -23,19 +22,19 @@ module.exports = {
2322
debuggerClient,
2423
sourceMaps,
2524
panel
26-
}: any) =>
27-
onConnect(
28-
{
29-
tab: { clientType: "firefox" },
30-
tabConnection: {
31-
tabTarget,
32-
threadClient,
33-
debuggerClient
34-
}
35-
},
36-
sourceMaps,
37-
panel
38-
),
25+
}: any) =>
26+
onConnect(
27+
{
28+
tab: { clientType: "firefox" },
29+
tabConnection: {
30+
tabTarget,
31+
threadClient,
32+
debuggerClient
33+
}
34+
},
35+
sourceMaps,
36+
panel
37+
),
3938
destroy: () => {
4039
unmountRoot();
4140
sourceQueue.clear();

src/reducers/sources.js

+15-24
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,7 @@ import {
2222
import { originalToGeneratedId } from "devtools-source-map";
2323
import { prefs } from "../utils/prefs";
2424

25-
import type {
26-
Source,
27-
SourceId,
28-
SourceLocation,
29-
ThreadId,
30-
WorkerList
31-
} from "../types";
25+
import type { Source, SourceId, SourceLocation, ThreadId } from "../types";
3226
import type { PendingSelectedLocation, Selector } from "./types";
3327
import type { Action, DonePromiseAction, FocusItem } from "../actions/types";
3428
import type { LoadSourceAction } from "../actions/types/SourceAction";
@@ -186,9 +180,9 @@ function update(
186180
function updateSource(state: SourcesState, source: Object) {
187181
const existingSource = state.sources[source.id];
188182
return {
189-
...state,
183+
...state,
190184
sources: {
191-
...state.sources,
185+
...state.sources,
192186
[source.id]: { ...existingSource, ...source }
193187
}
194188
};
@@ -198,14 +192,11 @@ function updateSource(state: SourcesState, source: Object) {
198192
* Update all of the sources when an event occurs.
199193
* e.g. workers are updated, project directory root changes
200194
*/
201-
function updateAllSources(
202-
state: SourcesState,
203-
callback: any
204-
) {
195+
function updateAllSources(state: SourcesState, callback: any) {
205196
const updatedSources = Object.values(state.sources).map(source => ({
206197
...source,
207198
...callback(source)
208-
}))
199+
}));
209200

210201
return addSources({ ...state, ...emptySources }, updatedSources);
211202
}
@@ -249,11 +240,12 @@ function addSources(state: SourcesState, sources: Source[]) {
249240
// 3. Update the displayed actor map
250241
if (
251242
underRoot(source, state.projectDirectoryRoot) &&
252-
(!source.isExtension || getChromeAndExtenstionsEnabled({ sources: state }))
243+
(!source.isExtension ||
244+
getChromeAndExtenstionsEnabled({ sources: state }))
253245
) {
254246
for (const actor of getSourceActors(state, source)) {
255247
if (!state.displayed[actor.thread]) {
256-
state.displayed[actor.thread] = {}
248+
state.displayed[actor.thread] = {};
257249
}
258250
state.displayed[actor.thread][source.id] = true;
259251
}
@@ -285,10 +277,9 @@ function updateWorkers(state: SourcesState, action: Object) {
285277
function updateProjectDirectoryRoot(state: SourcesState, root: string) {
286278
prefs.projectDirectoryRoot = root;
287279

288-
return updateAllSources(
289-
{ ...state, projectDirectoryRoot: root },
290-
source => ({ relativeUrl: getRelativeUrl(source, root) })
291-
);
280+
return updateAllSources({ ...state, projectDirectoryRoot: root }, source => ({
281+
relativeUrl: getRelativeUrl(source, root)
282+
}));
292283
}
293284

294285
/*
@@ -301,12 +292,9 @@ function updateLoadedState(state, action: LoadSourceAction): SourcesState {
301292

302293
if (action.status === "start") {
303294
source = { id: sourceId, loadedState: "loading" };
304-
305295
} else if (action.status === "error") {
306296
source = { id: sourceId, error: action.error, loadedState: "loaded" };
307-
308297
} else {
309-
310298
if (!action.value) {
311299
return state;
312300
}
@@ -378,7 +366,10 @@ export function getSourceFromId(state: OuterState, id: string): Source {
378366
return source;
379367
}
380368

381-
export function getSourceByActorId(state: OuterState, actorId: string): ?Source {
369+
export function getSourceByActorId(
370+
state: OuterState,
371+
actorId: string
372+
): ?Source {
382373
// We don't index the sources by actor IDs, so this method should be used
383374
// sparingly.
384375
for (const source of getSourceList(state)) {

src/reducers/tests/sources.spec.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,16 @@ declare var it: (desc: string, func: () => void) => void;
88
declare var expect: (value: any) => any;
99

1010
import update, { initialSourcesState, getDisplayedSources } from "../sources";
11-
import { foobar } from "../../test/fixtures";
1211
import type { Source } from "../../types";
1312
import { prefs } from "../../utils/prefs";
1413
import { makeMockSource } from "../../utils/test-mockup";
1514

16-
17-
18-
const fakeSources = foobar.sources.sources;
19-
2015
const extensionSource = {
2116
...makeMockSource(),
2217
id: "extensionId",
2318
url: "http://example.com/script.js",
2419
actors: [{ actor: "extensionId-actor", source: "extensionId", thread: "foo" }]
25-
}
20+
};
2621

2722
const firefoxExtensionSource = {
2823
...makeMockSource(),

0 commit comments

Comments
 (0)