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

Migrate to use patch-package instead of module augmentation #26

Merged
merged 11 commits into from
Aug 2, 2020

Conversation

dotansimha
Copy link
Owner

@dotansimha dotansimha commented Jul 29, 2020

Related:
#23

The goal of this PR is to use patch-package internals, wrapped with simple CLI that's being shipped with the core library.
This will allow us to have better typings for libraries that isn't supporting this yet, just by running it as part of the postinstall script.

The reason it's wrapped is because patch-package is for local patching, while here we would like to ship it as part of the package it self, and allow flexible transformation over the dependencies using semver. For example - all range of 3.0.0~3.0.2 or @apollo/client works with the same patch.
It also means that it's no longer required to have changes to tsconfig.json or need to use module augmentation - just by running the patch script it will make the code fully typed.

Tested it for all available versions of @apollo/client and it works great. Testing became a bit more complex because we need node_moduels exists on the FS in order to test the effect of the patch on the TypeScript types.

TODO:

  • Fix issues with Incorrect variables leads to signature fallback #15
  • All latest versions of @apollo/client (v3) - for all features (direct usage of client, cache access, HOC, Data Component and hooks, different patches needed).
  • graphql - execute and executeSync - from 15.0.0 to 15.3.0 (different patches needed)
  • apollo-client v2 (also in apollo-cache)
  • simplify testing flow
  • improve package detection by using resolutions (as done in patch-package internally)
  • Latest version of react-apollo
  • Latest version of apollo-angular
  • Latest version of urql
  • Update README
  • Update blogpost on https://the-guild.dev/blog/typed-document-node

@dotansimha dotansimha mentioned this pull request Jul 29, 2020
@dotansimha dotansimha mentioned this pull request Jul 30, 2020
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.

1 participant