Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(site): match v1 tsconfig; simplify tsconfig.test.json #426

Merged
merged 2 commits into from
Mar 13, 2022

Conversation

greyscaled
Copy link
Contributor

@greyscaled greyscaled commented Mar 13, 2022

Summary (a1164f4)

Matched the tsconfig.json post migration to webpack with that of v1

Details

  • allowJs removed -> not needed after Next.js
  • removed lingering next-env.d.ts from file includes
  • noImplicitAny removed -> this is set to true by strict and is really only meaningful when being selectively strict
  • strictNullChecks removed -> this is set to true by strict and is really only meaningful when being selectively strict
  • ordered configurations for ease of readability

Impact of Changes

There is no observable impact (this is just a refactor), outside of readability and parity with v1.

Why re-order?

Sometimes using an arbitrary ordering means more scans (think like a O(N) search) to figure out what properties are configured. In the case of TS configuration, I think alphabetical makes sense because the configurations are usually small. In other cases, it's helpful to have logical groupings. In other words, this improvement is in theme of "at a glance behaviors": being able to retrieve information "at a glance" without having to search for it.

Summary (7e195d3)

Greatly simplified the tsconfig.test.json given the changes that happened to the base tsconfig.json from the migration. The tsconfig.test.json was duplicating properties that were already configured in the base tsconfig.json! The only real difference now is the includes/excludes, which makes sense given that one is meant for the test project, and not the other. Having parity on all other configurations means less "magic" between these scenarios.

Impact of Changes

  • Easier to understand our TS project configuration and the differences between test and source environments.

Summary of changes:

* ordered configurations for ease of readability
* allowJs removed -> not needed after Next.js
* noImplicitAny removed -> this is set to true by strict
* strictNullChecks removed -> this is set to true by strict
* removed lingering next-env.d.ts in include
Because that the base tsconfig was simplified when changing from
Next.js, this one now duplicates most of it. I still believe having a
separate tsconfig is a good idea for the purposes of separating tests
from source code. It especially can make it easier for eslint and jest
performance.
@greyscaled greyscaled self-assigned this Mar 13, 2022
Copy link
Member

@kylecarbs kylecarbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the simplification here!

@codecov
Copy link

codecov bot commented Mar 13, 2022

Codecov Report

Merging #426 (7e195d3) into main (ec077c6) will decrease coverage by 0.06%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #426      +/-   ##
==========================================
- Coverage   68.29%   68.23%   -0.07%     
==========================================
  Files         159      159              
  Lines        9226     9226              
  Branches       73       73              
==========================================
- Hits         6301     6295       -6     
- Misses       2305     2312       +7     
+ Partials      620      619       -1     
Flag Coverage Δ
unittest-go-macos-latest 62.79% <ø> (-0.04%) ⬇️
unittest-go-ubuntu-latest 67.53% <ø> (-0.03%) ⬇️
unittest-go-windows-2022 62.42% <ø> (+0.09%) ⬆️
unittest-js 64.07% <ø> (ø)
Impacted Files Coverage Δ
peerbroker/dial.go 82.45% <0.00%> (-7.02%) ⬇️
peer/conn.go 78.51% <0.00%> (-2.82%) ⬇️
peer/channel.go 83.62% <0.00%> (-2.34%) ⬇️
provisionerd/provisionerd.go 80.33% <0.00%> (+1.28%) ⬆️
provisioner/echo/serve.go 57.50% <0.00%> (+2.50%) ⬆️
peerbroker/listen.go 83.89% <0.00%> (+2.54%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ec077c6...7e195d3. Read the comment docs.

@greyscaled greyscaled merged commit 6c83907 into main Mar 13, 2022
@greyscaled greyscaled deleted the vapurrmaid/refactor-tsconfigs branch March 13, 2022 23:54
@misskniss misskniss added this to the V2 Beta milestone May 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants