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

Overall infrastructure cleanup #3817

Merged
merged 61 commits into from
Aug 17, 2018
Merged

Overall infrastructure cleanup #3817

merged 61 commits into from
Aug 17, 2018

Conversation

hwillson
Copy link
Member

The intent of this PR is to kick start the process of dealing with some of the technical debt we've acquired over the past while. This PR is mostly focused on Apollo Client's support infrastructure, covering things like repo layout adjustments, common config re-use, file cleanup, test speed enhancements, Circle changes, etc. The inspiration for a lot of the test performance and Circle changes came from apollographql/apollo-server#1521 (thanks @martijnwalraven!).

@codecov
Copy link

codecov bot commented Aug 16, 2018

Codecov Report

Merging #3817 into master will decrease coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3817      +/-   ##
==========================================
- Coverage   89.18%   89.14%   -0.04%     
==========================================
  Files          43       43              
  Lines        2357     2358       +1     
  Branches      566      554      -12     
==========================================
  Hits         2102     2102              
- Misses        239      240       +1     
  Partials       16       16
Impacted Files Coverage Δ
...kages/apollo-cache-inmemory/src/fragmentMatcher.ts 89.28% <0%> (-1.63%) ⬇️

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 a9481d8...aa5d083. Read the comment docs.

 - apollo-boost@0.2.0-verify.0
 - apollo-cache-inmemory@1.3.0-verify.0
 - apollo-cache@1.2.0-verify.0
 - apollo-client@2.5.0-verify.0
 - apollo-utilities@1.1.0-verify.0
 - graphql-anywhere@4.2.0-verify.0
 - apollo-boost@0.2.0-verify.1
 - apollo-cache-inmemory@1.3.0-verify.1
 - apollo-cache@1.2.0-verify.1
 - apollo-client@2.5.0-verify.1
 - apollo-utilities@1.1.0-verify.1
 - graphql-anywhere@4.2.0-verify.1
 - apollo-boost@0.2.0-verify.2
 - apollo-cache-inmemory@1.3.0-verify.2
 - apollo-cache@1.2.0-verify.2
 - apollo-client@2.5.0-verify.2
 - apollo-utilities@1.1.0-verify.2
 - graphql-anywhere@4.2.0-verify.2
 - apollo-boost@0.2.0-verify.3
 - apollo-cache-inmemory@1.3.0-verify.3
 - apollo-cache@1.2.0-verify.3
 - apollo-client@2.5.0-verify.3
 - apollo-utilities@1.1.0-verify.3
 - graphql-anywhere@4.2.0-verify.3
 - apollo-boost@0.2.0-verify.4
 - apollo-cache-inmemory@1.3.0-verify.4
 - apollo-cache@1.2.0-verify.4
 - apollo-client@2.5.0-verify.4
 - apollo-utilities@1.1.0-verify.4
 - graphql-anywhere@4.2.0-verify.4
@hwillson
Copy link
Member Author

Okay, fingers crossed we should be all set here. This PR introduces a handful of infrastructure changes, the most important of which I've listed below:

  • All shared configs (that could be moved) are now in the /config directory
  • All packages inherit from the same typescript settings, leveraging the same config as much as possible. This means all packages (including apollo-boost) are configured via typescript to target es5 and use es2015 module resolution.
  • All packages are bundled using rollup (including apollo-boost) into a UMD based bundle.
  • All packages have proper package.json module references pointing to the es2015 module code, to facilitate code splitting / tree shaking.
  • All packages are wired together using npm file references instead of lerna's defualt approach, which means lerna bootstrap is no longer needed (npm install takes care of the file references).
  • Jest based tests run from the root of the monorepo now use multiple Jest workers, to run the tests from all packages. Running npm test in the project root handles this (and is super fast - 5 seconds for all tests).
  • Our CI config has been updated to consolidate the individual package jobs into one main monorepo job, to leverage the speed improvements gained from using npm ci and Jest test workers. CI usually finishes in about 1.5 minutes now. We could take this further and leverage parallelism, shared initial environment setup, etc., but 1.5 minutes isn't bad. This can be addressed further as needed.
  • Packages no longer use browserify to calculate bundle sizes. Bundle sizes are now calculated directly from the rollup based bundles (to be more accurate).

This PR includes a bunch of other smaller cleanup items, so if anyone is interested please review the commit history. I've tried to keep the commits as clean as possible, and will preserve the merge history in-case we run into any issues.

If anyone is interested in trying these changes out, you can use the verify tag when installing any of the packages from this repo (e.g. apollo-client@verify, apollo-boost@verify, etc.).

Thanks!

@hwillson hwillson changed the title [WIP] Overall infrastructure cleanup Overall infrastructure cleanup Aug 17, 2018
@hwillson hwillson merged commit e820595 into master Aug 17, 2018
@hwillson hwillson deleted the hwillson/infra-cleanup branch August 17, 2018 19:29
LevanArabuli pushed a commit to LevanArabuli/apollo-client that referenced this pull request Nov 3, 2022
…ra-cleanup

Overall infrastructure cleanup (CI, typescript config, bundling, shared config restructuring, test performance improvements, etc.).
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants