Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
⬆️: Upgrading Flow to 0.61 (#4983)
Browse files Browse the repository at this point in the history
  • Loading branch information
wldcordeiro authored and jasonLaster committed Jan 4, 2018
1 parent 629cd9d commit 8f633d6
Show file tree
Hide file tree
Showing 6 changed files with 123 additions and 22 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
"eslint-plugin-prettier": "^2.3.1",
"eslint-plugin-react": "^7.2.1",
"expect.js": "^0.3.1",
"flow-bin": "0.57.3",
"flow-bin": "0.61.0",
"github-airtable-bridge": "0.0.5",
"glob": "^7.0.3",
"husky": "^0.14.2",
Expand Down
127 changes: 114 additions & 13 deletions src/actions/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ import type {
} from "debugger-html";

import type { State } from "../reducers/types";
import type { ActiveSearchType } from "../reducers/ui";
import type {
ActiveSearchType,
OrientationType,
SelectedPrimaryPaneTabType
} from "../reducers/ui";
import type { MatchedLocations } from "../reducers/file-search";

import type { SymbolDeclaration, AstLocation } from "../workers/parser";
Expand Down Expand Up @@ -105,7 +109,21 @@ type BreakpointAction =
status: AsyncStatus,
error: string,
value: any
};
}
| {
type: "SYNC_BREAKPOINT",
breakpoint: Breakpoint,
previousLocation: Location
}
| {
type: "ENABLE_BREAKPOINT",
breakpoint: Breakpoint,
status: AsyncStatus,
error: string,
value: AddBreakpointResult
}
| { type: "DISABLE_BREAKPOINT", breakpoint: Breakpoint }
| { type: "REMAP_BREAKPOINTS", breakpoints: Breakpoint[] };

type SourceAction =
| { type: "ADD_SOURCE", source: Source }
Expand All @@ -124,12 +142,14 @@ type SourceAction =
error: string,
value: Source
}
| { type: "CLEAR_SELECTED_SOURCE" }
| {
type: "BLACKBOX",
source: Source,
error: string,
value: { isBlackBoxed: boolean }
}
| { type: "ADD_TAB", source: Source, tabIndex: number }
| { type: "MOVE_TAB", url: string, tabIndex: number }
| { type: "CLOSE_TAB", url: string, tabs: any }
| { type: "CLOSE_TABS", urls: string[], tabs: any };
Expand Down Expand Up @@ -160,6 +180,43 @@ type UIAction =
type: "TOGGLE_PANE",
position: panelPositionType,
paneCollapsed: boolean
}
| {
type: "SET_CONTEXT_MENU",
contextMenu: { type: string, event: any }
}
| {
type: "SET_ORIENTATION",
orientation: OrientationType
}
| {
type: "HIGHLIGHT_LINES",
location: {
start: number,
end: number,
sourceId: number
}
}
| {
type: "CLEAR_HIGHLIGHT_LINES"
}
| {
type: "OPEN_CONDITIONAL_PANEL",
line: number
}
| {
type: "CLOSE_CONDITIONAL_PANEL"
}
| {
type: "SET_PROJECT_DIRECTORY_ROOT",
url: Object
}
| {
type: "SET_PRIMARY_PANE_TAB",
tabName: SelectedPrimaryPaneTabType
}
| {
type: "CLOSE_PROJECT_SEARCH"
};

type PauseAction =
Expand Down Expand Up @@ -211,20 +268,41 @@ type PauseAction =
| {
type: "DELETE_EXPRESSION",
input: string
}
| {
type: "MAP_SCOPES",
frame: Frame,
scopes: Scope[]
}
| {
type: "ADD_SCOPES",
frame: Frame,
scopes: Scope[]
};

type NavigateAction = { type: "NAVIGATE", url: string };
type NavigateAction =
| { type: "CONNECT", url: string }
| { type: "NAVIGATE", url: string };

type ASTAction =
| {
type: "SET_SYMBOLS",
source: Source,
symbols: SymbolDeclaration[]
}
| {
type: "SET_EMPTY_LINES",
source: Source,
emptyLines: AstLocation[]
}
| {
type: "OUT_OF_SCOPE_LOCATIONS",
locations: AstLocation[]
}
| {
type: "IN_SCOPE_LINES",
lines: AstLocation[]
}
| {
type: "SET_PREVIEW",
value: {
Expand All @@ -236,21 +314,28 @@ type ASTAction =
extra: any
}
}
| {
type: "SET_SOURCE_METADATA",
sourceId: string,
sourceMetaData: {
isReactComponent: boolean
}
}
| {
type: "CLEAR_SELECTION"
};

export type SourceTreeAction = { type: "SET_EXPANDED_STATE", expanded: any };

export type ProjectTextSearchAction = {
type: "ADD_QUERY",
query: string
} & {
type: "ADD_SEARCH_RESULT",
result: ProjectTextSearchResult
} & {
type: "CLEAR_QUERY"
};
export type ProjectTextSearchAction =
| { type: "ADD_QUERY", query: string }
| {
type: "ADD_SEARCH_RESULT",
result: ProjectTextSearchResult
}
| { type: "CLEAR_QUERY" }
| { type: "UPDATE_STATUS", status: string }
| { type: "CLEAR_SEARCH_RESULTS" };

export type FileTextSearchAction =
| {
Expand All @@ -276,6 +361,18 @@ export type QuickOpenAction =
| { type: "OPEN_QUICK_OPEN", query?: string }
| { type: "CLOSE_QUICK_OPEN" };

export type CoverageAction = {
type: "RECORD_COVERAGE",
value: { coverage: Object }
};

export type DebugeeAction = {
type: "SET_WORKERS",
workers: {
workers: Object[]
}
};

/**
* Actions: Source, Breakpoint, and Navigation
*
Expand All @@ -289,4 +386,8 @@ export type Action =
| NavigateAction
| UIAction
| ASTAction
| QuickOpenAction;
| QuickOpenAction
| FileTextSearchAction
| ProjectTextSearchAction
| CoverageAction
| DebugeeAction;
2 changes: 1 addition & 1 deletion src/reducers/ast.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function update(
});
}

case "RESUMED": {
case "RESUME": {
return state.set("outOfScopeLocations", null);
}

Expand Down
1 change: 0 additions & 1 deletion src/reducers/pending-breakpoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ function addBreakpoint(state, action) {
if (action.status !== "done") {
return state;
}

// when the action completes, we can commit the breakpoint
const { value: { breakpoint } } = action;
const locationId = makePendingLocationId(breakpoint.location);
Expand Down
7 changes: 4 additions & 3 deletions src/reducers/project-text-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import * as I from "immutable";
import makeRecord from "../utils/makeRecord";

import type { ProjectTextSearchAction } from "../actions/types";
import type { Action } from "../actions/types";
import type { Record } from "../utils/makeRecord";
import type { List } from "immutable";

Expand Down Expand Up @@ -50,11 +50,12 @@ export function InitialState(): Record<ProjectTextSearchState> {

function update(
state: Record<ProjectTextSearchState> = InitialState(),
action: ProjectTextSearchAction
action: Action
): Record<ProjectTextSearchState> {
switch (action.type) {
case "ADD_QUERY":
return state.update("query", value => action.query);
const actionCopy = action;
return state.update("query", value => actionCopy.query);

case "CLEAR_QUERY":
return state.remove("query");
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3978,9 +3978,9 @@ flatten@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.2.tgz#dae46a9d78fbe25292258cc1e780a41d95c03782"

flow-bin@0.57.3:
version "0.57.3"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.57.3.tgz#843fb80a821b6d0c5847f7bb3f42365ffe53b27b"
flow-bin@0.61.0:
version "0.61.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.61.0.tgz#d0473a8c35dbbf4de573823f4932124397d32d35"

fn-name@^2.0.1:
version "2.0.1"
Expand Down

0 comments on commit 8f633d6

Please sign in to comment.