Commit Graph

31 Commits

Author SHA1 Message Date
Alan Pierce
1bcb88670b Set up Prettier and run it on the whole codebase
* Install prettier, set up the config file, and run it on all ts and tsx files.
* Install eslint and configure it with just eslint-plugin-prettier to check to
  make sure that prettier has been run.
* Add a basic .travis.yml that runs eslint.

There are other style things that might be nice to enforce with ESLint/TSLint,
like using const, import order, etc, but this commit just focuses on prettier,
which gets most of the way there.

One annoying issue for now is that typescript-eslint-parser gives a big warning
message since they haven't updated to officially support TypeScript 2.8 yet. We
aren't even using any ESLint rules that need the parser, but if we don't include
it, ESLint will crash. TS2.8 support is hopefully coming really soon, though:
https://github.com/eslint/typescript-eslint-parser/pull/454

As for the prettier config specifically, see https://prettier.io/docs/en/options.html
for the available options.

Config settings that seem non-controversial:

Semicolons: You don't use semicolons. (I prefer semicolons, but either way is fine.)

Quote style: Looks like you consistently use single quotes outside JSX and double
quotes in JSX, which is the `singleQuote: true` option.

Config settings worth discussion:

Line width: You don't have a specific max. I put 100 since I think it's a good number
for people (like both of us, probably) who find 80 a bit cramped. (At Benchling we use
110.) Prettier has a big red warning box recommending 80, but I still prefer 100ish.

Bracket spacing: This is `{foo}` vs `{ foo }` for imports, exports, object literals,
and destructuring. Looks like you're inconsistent but lean toward spaces. I personally
really dislike bracket spacing (it feels inconsistent with arrays and function calls),
but I'm certainly fine with it and Prettier has it enabled by default, so I kept it
enabled.

Trailing comma style: Options are "no trailing commas", "trailing commas for
everything exception function calls and parameter lists", and "trailing commas
everywhere". TypeScript can handle trailing commas everywhere, so there isn't a
concern with tooling. You're inconsistent, and it looks like you tend to not have
trailing commas, but I think it's probably best to just have them everywhere, so I
enabled them.

JSX Brackets: You're inconsistent about this, I think. I'd prefer to just keep the
default and wrap the `>` to the next line.

Arrow function parens: I only found two cases of arrow functions with one param
(both `c => c.frame === frame`), and both omitted the parens, so I kept the
default of omitting parens. This makes it mildly more annoying to add a typescript
type or additional param, which is a possible reason for always requiring parens.

Everything else is non-configurable, although it's possible some places would be
better with a `// prettier-ignore` comment (but I usually try to avoid those).
2018-04-14 08:40:06 -07:00
Jamie Wong
971c0a2dc4 More tweaks to release process 2018-04-05 00:53:21 -07:00
Jamie Wong
5104e5cdcb
Demangle C++ symbols (#2)
This adds support for demangling C++ symbols automatically (they'll have a name prefix of `__Z`).
2018-04-05 00:27:03 -07:00
Jamie Wong
1987e83bde
Upgrade libraries & change release procedure (#8)
Previously, I was doing a hacky release process where I had `index.html` serve contents for `jlfwong.github.io/speedscope`, but used `dev.html` locally. This seems like it broke with the latest parcel release, so I just revamped the release process instead.

Now, the `release.sh` script creates a temporary shallow clone of the repository, overwrites its contents with build artifacts, runs a local server to verify it's working, then commits and pushes to the `gh-pages` branches.
2018-04-05 00:15:42 -07:00
Jamie Wong
53656fef43 I think it works!!!!! 2018-01-30 01:51:02 -08:00
Jamie Wong
37e2b78ad8 Rendering from one big texture working, make using texture rendering more ergonomic 2018-01-27 20:19:45 -08:00
Jamie Wong
82ad36f55a Texture based approach WIP 2018-01-25 21:15:35 -08:00
Jamie Wong
24c58d5e34 Flamechart Renderer with no culling 2018-01-25 10:17:17 -08:00
Jamie Wong
61d321f6d4 Fix hot reloading 2018-01-23 23:47:17 -08:00
Jamie Wong
fe9561f709 Refactor into a single CanvasContext 2018-01-23 09:59:14 -08:00
Jamie Wong
b3213a2f44 WIP: Single GL context 2018-01-22 11:22:24 -08:00
Jamie Wong
7b60a0e4f1 Add simple loading indicator 2018-01-19 10:50:22 -08:00
Jamie Wong
d5c1d8439a Add utils, time import more granularly 2018-01-16 22:27:31 -08:00
Jamie Wong
63765631cc Better file format detection & warn on failure 2018-01-16 09:59:22 -08:00
Jamie Wong
464824f8d8 Add support for .cpuprofile format 2018-01-07 19:50:33 -08:00
Jamie Wong
8e3997d81f Speed up color genration 2018-01-07 18:36:23 -08:00
Jamie Wong
ebb1627f76 Toolbar changes 2018-01-07 16:18:41 -08:00
Jamie Wong
61ca86f60e Release 2018-01-07 11:46:44 -08:00
Jamie Wong
8ba298b216 Basic landing page 2018-01-07 11:45:05 -08:00
Jamie Wong
33b305191d Basic keyboard navigation 2018-01-07 08:36:11 -08:00
Jamie Wong
0f776cfb10 user-select: none for toolbar 2018-01-07 08:36:11 -08:00
Jamie Wong
2188025165 Basic horizontal axis labelling 2018-01-07 08:36:11 -08:00
Jamie Wong
ffc82360c0 Alternative sorting solution 2017-12-31 19:51:26 -05:00
Jamie Wong
9ee5b53eda Rename times to weights, start refactor for sorted flamegraphs 2017-12-31 18:25:37 -05:00
Jamie Wong
c240ac8694 Chrome timeline import, optimization of mergeAdjacentFrames 2017-12-30 22:48:30 -05:00
Jamie Wong
6bd70e24e9 Fix weird resize issues 2017-12-29 22:07:41 -05:00
Jamie Wong
0644f16814 Toolbar, pull viewport rect state source of truth out of panzoom component 2017-12-29 21:15:12 -05:00
Jamie Wong
15c708105e Split Flamechart from views 2017-12-26 12:59:42 -05:00
Jamie Wong
d7ea70c9d0 Minimap WIP 2017-12-26 12:52:03 -05:00
Jamie Wong
ca0d29c033 Hotloading tweaks, frame rectangle stroke 2017-12-26 11:49:25 -05:00
Jamie Wong
a51382c525 Hot reloading WIP 2017-12-23 13:37:56 -05:00