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

Replace Apollo local state management #38

Merged
merged 147 commits into from
Apr 12, 2019

Conversation

lucasconstantino
Copy link
Collaborator

@lucasconstantino lucasconstantino commented Apr 10, 2019

This is a major change. It replaces the whole state management system previously built using Apollo's internal local-state feature, with a completely rewritten GraphQL API layer which interconnects GitHub and NPM using schema stiching.

Goodies:

  • Isolated API environment.
    • Easily expandable API;
    • Can boot standalone (yarn dev-api);
    • Integrates with Apollo Engine for performance lookups;
    • Can easily be moved to the server eventually;
  • DataLoaders to avoid multiple calls to NPMS API, but still keeping code decoupled;
  • Memoization on many parts, including on schema delegation;
  • Added some tests to data-processing parts.

Tradeoffs:

  • I'm no TypeScript expert, so I had to drop a bunch of generated types and type usage along the way. I intend on increment the current components with type safety on another task;

varholak-peter and others added 30 commits March 12, 2019 15:54
This has a minor performance hit, but is by far the simplest solution to have the project up and running again.
@lucasconstantino
Copy link
Collaborator Author

Fixes #31 and #34

This was referenced Apr 11, 2019
@lucasconstantino
Copy link
Collaborator Author

I've made two videos to explain the refactoring! I might just transform the content of those videos into documentation, but may be the docs should be more focused on going forward, not backwards comparisons. Here it goes:

https://www.loom.com/share/96530313f6af42218fb1cadaf8eee974
https://www.loom.com/share/f5337d4551644f3b91b5a11a2f67d0b2

@lucasconstantino lucasconstantino merged commit 33f0fb6 into master Apr 12, 2019
@lucasconstantino lucasconstantino deleted the feat/refactor-api--cleanup-unused branch April 17, 2019 19:17
@lucasconstantino lucasconstantino added this to Done in Kanban Apr 18, 2019
@lucasconstantino lucasconstantino mentioned this pull request Apr 18, 2019
4 tasks
@lucasconstantino lucasconstantino self-assigned this Apr 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants