Skip to content

Commit

Permalink
Upgrade dependencies (#10)
Browse files Browse the repository at this point in the history
Notable upgrades:

- `react-d3-graph`: `1.5.0` ➡️  `1.6.0`
  - This includes some potential fixes for dragging the viewport after focusing on a node (danielcaldas/react-d3-graph#374)
- `react-scripts` (Create React App): `3.4.1` ➡️  `4.0.1` 
- Move from `@emotion/core` `10.0.28` ➡️  `@emotion/react` `11.1.4`
   - This now requires using [Babel macros](https://emotion.sh/docs/babel-macros)
   - This also required changing `/** @jsx jsx */` to `/** @jsxImportSource @emotion/react */` 🤮 
- `typescript`: `3.9.6` ➡️ `4.1.3`
  • Loading branch information
TranquilMarmot committed Feb 6, 2021
1 parent b872a29 commit e715fb3
Show file tree
Hide file tree
Showing 19 changed files with 16,165 additions and 9,683 deletions.
11,193 changes: 6,852 additions & 4,341 deletions loom-editor/package-lock.json

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions loom-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
"version": "1.0.3",
"private": true,
"dependencies": {
"@emotion/core": "^10.0.28",
"@emotion/babel-plugin": "^11.1.2",
"@emotion/react": "^11.1.4",
"d3": "^5.16.0",
"loom-common": "file:../loom-common/out",
"react-d3-graph": "^2.5.0",
"react-hotkeys-hook": "^2.2.2",
"react-scripts": "3.4.1",
"react-d3-graph": "^2.6.0",
"react-hotkeys-hook": "^3.0.3",
"react-scripts": "4.0.1",
"typesafe-actions": "^5.1.0"
},
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion loom-editor/src/Styles.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css } from "@emotion/core";
import { css } from "@emotion/react";

/** Base button styles */
export const buttonBase = css`
Expand All @@ -17,6 +17,7 @@ export const buttonBase = css`
/** Used to style a button in a list of items */
export const listItemBase = css`
display: flex;
align-items: center;
color: var(--vscode-menu-foreground);
Expand Down
4 changes: 2 additions & 2 deletions loom-editor/src/components/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @jsx jsx */
import { jsx, css } from "@emotion/core";
/** @jsxImportSource @emotion/react */
import { css } from "@emotion/react/macro";
import { FunctionComponent } from "react";
import { useHotkeys } from "react-hotkeys-hook";

Expand Down
4 changes: 2 additions & 2 deletions loom-editor/src/components/NodeGraph.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @jsx jsx */
import { jsx, css } from "@emotion/core";
/** @jsxImportSource @emotion/react */
import { css } from "@emotion/react/macro";
import { FunctionComponent, useCallback, useState } from "react";
import {
Graph,
Expand Down
4 changes: 2 additions & 2 deletions loom-editor/src/components/NodeGraphView/NodeBody.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @jsx jsx */
import { jsx, css } from "@emotion/core";
/** @jsxImportSource @emotion/react */
import { css } from "@emotion/react/macro";
import { FunctionComponent } from "react";

const bodyStyle = css`
Expand Down
10 changes: 5 additions & 5 deletions loom-editor/src/components/NodeGraphView/NodeColorChooser.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @jsx jsx */
import { jsx, css } from "@emotion/core";
/** @jsxImportSource @emotion/react */
import { css } from "@emotion/react/macro";
import { FunctionComponent } from "react";

import { setNodeColor } from "loom-common/EditorActions";
Expand Down Expand Up @@ -60,9 +60,9 @@ const NodeGraphViewColorChooser: FunctionComponent<NodeGraphViewColorChooserProp
key={color}
aria-label={`Choose color ${index}`}
css={css`
${buttonStyle}
background-color: ${color};
`}
${buttonStyle}
background-color: ${color};
`}
>
{" "}
</button>
Expand Down
7 changes: 4 additions & 3 deletions loom-editor/src/components/NodeGraphView/NodeFooter.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @jsx jsx */
import { jsx, css } from "@emotion/core";
/** @jsxImportSource @emotion/react */
import { css } from "@emotion/react/macro";
import { FunctionComponent } from "react";

import { useYarnState } from "../../state/YarnContext";
Expand Down Expand Up @@ -91,7 +91,8 @@ const NodeFooter: FunctionComponent<NodeFooterProps> = ({
<div
css={css`
${containerStyle}
background-color: ${nodeColor}`}
background-color: ${nodeColor}
`}
>
<div css={tagListContainerStyle}>
<div css={tagListStyle}>
Expand Down
12 changes: 9 additions & 3 deletions loom-editor/src/components/NodeGraphView/NodeHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @jsx jsx */
import { jsx, css } from "@emotion/core";
/** @jsxImportSource @emotion/react */
import { css } from "@emotion/react/macro";
import { FunctionComponent } from "react";

import { deleteNode, renameNode } from "loom-common/EditorActions";
Expand Down Expand Up @@ -72,7 +72,13 @@ const NodeHeader: FunctionComponent<NodeHeaderProps> = ({
background-color: ${nodeColor}
`}
>
<div css={css`${titleLabelStyle}${fontStyle}`}>{title}</div>
<div
css={css`
${titleLabelStyle}${fontStyle}
`}
>
{title}
</div>
<button
css={settingsButtonStyle}
onClick={() => window.vsCodeApi.postMessage(renameNode(title))}
Expand Down
4 changes: 2 additions & 2 deletions loom-editor/src/components/NodeGraphView/NodeTagChooser.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @jsx jsx */
import { jsx, css } from "@emotion/core";
/** @jsxImportSource @emotion/react */
import { css } from "@emotion/react/macro";
import { FunctionComponent } from "react";

import { YarnNode } from "loom-common/YarnNode";
Expand Down
8 changes: 5 additions & 3 deletions loom-editor/src/components/NodeGraphView/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @jsx jsx */
import { jsx, css } from "@emotion/core";
/** @jsxImportSource @emotion/react */
import { css } from "@emotion/react/macro";
import { FunctionComponent, useState } from "react";

import { useYarnState } from "../../state/YarnContext";
Expand Down Expand Up @@ -212,7 +212,9 @@ const NodeGraphView: FunctionComponent<NodeGraphViewProps> = ({

return (
<div
css={css`${containerStyle}${!searched && dimmedStyle}`}
css={css`
${containerStyle}${!searched && dimmedStyle}
`}
data-testid={
searched ? "node-graph-view-searched" : "node-graph-view-not-searched"
}
Expand Down
12 changes: 7 additions & 5 deletions loom-editor/src/components/NodeSearch/NodeList.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @jsx jsx */
import { jsx, css } from "@emotion/core";
/** @jsxImportSource @emotion/react */
import { css } from "@emotion/react/macro";
import { FunctionComponent } from "react";

import { createNewNode } from "loom-common/EditorActions";
Expand Down Expand Up @@ -44,9 +44,11 @@ const NodeList: FunctionComponent = () => {
data-testid="node-search-node-button"
>
<div
css={css`${colorBlockStyle} background-color: ${
nodeColors[node.colorID || 0]
};`}
css={css`
${colorBlockStyle} background-color: ${nodeColors[
node.colorID || 0
]};
`}
>
{" "}
</div>
Expand Down
20 changes: 14 additions & 6 deletions loom-editor/src/components/NodeSearch/SearchBox.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @jsx jsx */
import { jsx, css } from "@emotion/core";
/** @jsxImportSource @emotion/react */
import { css } from "@emotion/react/macro";
import { FunctionComponent, useRef } from "react";
import { useHotkeys } from "react-hotkeys-hook";

Expand Down Expand Up @@ -150,7 +150,9 @@ const SearchBox: FunctionComponent = () => {
<CaseSensitiveIcon />
</button>
<button
css={css`${iconButtonStyle}${regexEnabled && buttonActiveStyle}`}
css={css`
${iconButtonStyle}${regexEnabled && buttonActiveStyle}
`}
type="button"
role="switch"
aria-checked={regexEnabled}
Expand All @@ -163,7 +165,9 @@ const SearchBox: FunctionComponent = () => {
<RegExIcon />
</button>
<button
css={css`${textButtonStyle}${searchingTitle && buttonActiveStyle}`}
css={css`
${textButtonStyle}${searchingTitle && buttonActiveStyle}
`}
type="button"
role="switch"
aria-checked={searchingTitle}
Expand All @@ -177,7 +181,9 @@ const SearchBox: FunctionComponent = () => {
</button>

<button
css={css`${textButtonStyle}${searchingBody && buttonActiveStyle}`}
css={css`
${textButtonStyle}${searchingBody && buttonActiveStyle}
`}
type="button"
role="switch"
aria-checked={searchingBody}
Expand All @@ -191,7 +197,9 @@ const SearchBox: FunctionComponent = () => {
</button>

<button
css={css`${textButtonStyle}${searchingTags && buttonActiveStyle}`}
css={css`
${textButtonStyle}${searchingTags && buttonActiveStyle}
`}
type="button"
role="switch"
aria-checked={searchingTags}
Expand Down
8 changes: 5 additions & 3 deletions loom-editor/src/components/NodeSearch/TagList.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @jsx jsx */
import { jsx, css } from "@emotion/core";
/** @jsxImportSource @emotion/react */
import { css } from "@emotion/react/macro";
import { FunctionComponent } from "react";

import { getNodes } from "../../state/Selectors";
Expand Down Expand Up @@ -64,7 +64,9 @@ const NodeList: FunctionComponent = () => {
<button
data-testid="node-search-tag-button"
key={`tag-list-${tag}`}
css={css`${listItemBase}${listItemStyle}`}
css={css`
${listItemBase}${listItemStyle}
`}
onClick={() => dispatch(searchForTag(tag))}
>
<div>{tag}</div>
Expand Down
4 changes: 2 additions & 2 deletions loom-editor/src/components/NodeSearch/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @jsx jsx */
import { jsx, css } from "@emotion/core";
/** @jsxImportSource @emotion/react */
import { css } from "@emotion/react/macro";
import { FunctionComponent, useState } from "react";

import { ReactComponent as ChevronDown } from "../../icons/chevron-down.svg";
Expand Down
4 changes: 3 additions & 1 deletion loom-editor/src/state/Reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const searchForTag = (state: State, tag: string): State => {
};
};

export default (state: State, action: EditorActions | UiActions): State => {
const reducer = (state: State, action: EditorActions | UiActions): State => {
switch (action.type) {
case YarnEditorMessageTypes.SetNodes:
return {
Expand Down Expand Up @@ -115,3 +115,5 @@ export default (state: State, action: EditorActions | UiActions): State => {
return state;
}
};

export default reducer;
9 changes: 7 additions & 2 deletions loom-editor/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react"
"jsx": "react-jsx",
"noFallthroughCasesInSwitch": true
},
"include": ["src"],
"references": [{ "path": "../loom-common" }]
"references": [
{
"path": "../loom-common"
}
]
}
Loading

0 comments on commit e715fb3

Please sign in to comment.