-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Merge Apollo Link common + HTTP functionality into core #5412
Commits on Oct 4, 2019
-
Add fetch-mock dep for link testing
And remove the unused isomorphic fetch dep.
Configuration menu - View commit details
-
Copy full SHA for de18694 - Browse repository at this point
Copy the full SHA de18694View commit details -
Initial import of Apollo Link code
Introductory import of the Apollo Link core, common and HTTP code that is going to be integrated into the Apollo Client core. This code is going to change, but this commit gets the initial code moved over, and ensures that all Link tests still pass.
Configuration menu - View commit details
-
Copy full SHA for 3edfd4b - Browse repository at this point
Copy the full SHA 3edfd4bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8861959 - Browse repository at this point
Copy the full SHA 8861959View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7f045f8 - Browse repository at this point
Copy the full SHA 7f045f8View commit details -
Adjust AC constructor to accept uri, crendentials, headers
Now that the HTTP link code is part of AC, we can open up the constructor to allow additional options, like Apollo Boost did. Most people will just want to use `uri`, but `credentials` and `headers` use is common enough that it probably makes sense to expose them as well. Other HTTP link options can still be accessed by instantiating an `HttpLink` and passing it in via AC's constructor `link` option. Defining a custom link overrides the `uri`, `credentials`, and `headers` options.
Configuration menu - View commit details
-
Copy full SHA for 7b35832 - Browse repository at this point
Copy the full SHA 7b35832View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3cf1efa - Browse repository at this point
Copy the full SHA 3cf1efaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6be12f3 - Browse repository at this point
Copy the full SHA 6be12f3View commit details -
Re-export link core and htttp code
The Apollo Link project will be updated to re-use common and HTTP based link code from Apollo Client, so we need to make sure that code is reachable externally.
Configuration menu - View commit details
-
Copy full SHA for c76a56c - Browse repository at this point
Copy the full SHA c76a56cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7aa1837 - Browse repository at this point
Copy the full SHA 7aa1837View commit details -
Configuration menu - View commit details
-
Copy full SHA for e1fdf91 - Browse repository at this point
Copy the full SHA e1fdf91View commit details -
Remove unnecessary
mockLink
Apollo Link testing utilityThis util was adding very little additional value over just using `ApolloLink` directly.
Configuration menu - View commit details
-
Copy full SHA for b74c3d3 - Browse repository at this point
Copy the full SHA b74c3d3View commit details -
Configuration menu - View commit details
-
Copy full SHA for c62bc1f - Browse repository at this point
Copy the full SHA c62bc1fView commit details -
Move link test utilities into single test using them
Also removes link test utilities from the public API.
Configuration menu - View commit details
-
Copy full SHA for be1fdae - Browse repository at this point
Copy the full SHA be1fdaeView commit details -
Split link utilities into separate files and limit re-exports
This should help make future refactoring a bit easier, and gets us away from re-exporting all link utility functions, when very few of them need to be made available outside of this project.
Configuration menu - View commit details
-
Copy full SHA for 5fe9e7f - Browse repository at this point
Copy the full SHA 5fe9e7fView commit details -
Split link code up into smaller files and adjust re-exports
Smaller, more focused files should make it easier to refactor AC's link support further. Link based re-exports from Apollo Client have been adjusted at the same time, to make sure we're only exporting items that are trully needed by 3rd party links (and by the `apollo-link` repo).
Configuration menu - View commit details
-
Copy full SHA for 87bb72f - Browse repository at this point
Copy the full SHA 87bb72fView commit details -
Re-arrange core link code to better reflect the implementation
I'm not sure what the historical reason was for exposing link utility functions like `concat`, `empty`, `from`, `split` and `execute` both as static functions on `ApolloLink` and as separate importable functions. Since it might be a bit jarring for people if we remove one of these options, for now lets move all `ApolloLink` functionality back into the `ApolloLink` class, and instead re-export that functionality as separate utility functions. Using the utility functions through `ApolloLink` seems to be the most popular approach, and by aligning this in the code we'll make future maintenance a bit easier.
Configuration menu - View commit details
-
Copy full SHA for 944d007 - Browse repository at this point
Copy the full SHA 944d007View commit details -
Configuration menu - View commit details
-
Copy full SHA for 77d1235 - Browse repository at this point
Copy the full SHA 77d1235View commit details -
Configuration menu - View commit details
-
Copy full SHA for 705fc73 - Browse repository at this point
Copy the full SHA 705fc73View commit details -
Configuration menu - View commit details
-
Copy full SHA for 62f9350 - Browse repository at this point
Copy the full SHA 62f9350View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6d574df - Browse repository at this point
Copy the full SHA 6d574dfView commit details -
Configuration menu - View commit details
-
Copy full SHA for b87afc1 - Browse repository at this point
Copy the full SHA b87afc1View commit details -
Configuration menu - View commit details
-
Copy full SHA for f8b04d5 - Browse repository at this point
Copy the full SHA f8b04d5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 07463bc - Browse repository at this point
Copy the full SHA 07463bcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 74dbbf7 - Browse repository at this point
Copy the full SHA 74dbbf7View commit details -
Configuration menu - View commit details
-
Copy full SHA for fc5c068 - Browse repository at this point
Copy the full SHA fc5c068View commit details -
Configuration menu - View commit details
-
Copy full SHA for ff9d1fb - Browse repository at this point
Copy the full SHA ff9d1fbView commit details
Commits on Oct 6, 2019
-
Replace Observable sub-class with module augmentation
Sub-classing then re-exporting `Observable` leads to the `@types/zen-observable` types not being available, when `Observable` is exported from `@apollo/client`. This is because the `@types/zen-observable` class declaration (`declare class Observable<T>`) is replaced during TS compilation with the `class Observable extends LinkObservable` declaration, which doesn't expose any of original `Observable` methods. This means projects like Apollo Link that are using the re-exported `Observable` from `@apollo/client`, don't see any of the `Observable` methods when using Typescript. Instead of creating an `Observable` sub-class with the additional RxJS interop functionality, this commit uses TS global module augmentation to essentially add to the `@types/zen-observable` `Observable` type. It then adds the needed interop function to `Observable` directly. This allows external projects like Apollo Link to find all `@types/zen-observable` types, and keeps RxJS interop functionality in place. And just to add - method creation using `$$observable` was removed as `zen-observable` already does this: https://github.com/zenparsing/zen-observable/blob/f63849a8c60af5d514efc8e9d6138d8273c49ad6/src/Observable.js#L396
Configuration menu - View commit details
-
Copy full SHA for 2a9445f - Browse repository at this point
Copy the full SHA 2a9445fView commit details -
Hide
Observable
implementation detailsMake sure all parts of Apollo Client import `Observable` from a local module, instead of from `zen-observable` directly. This decoupling will make things easier as we investigate letting people use their own observables implementation.
Configuration menu - View commit details
-
Copy full SHA for b1cd004 - Browse repository at this point
Copy the full SHA b1cd004View commit details -
Configuration menu - View commit details
-
Copy full SHA for 17fa3d8 - Browse repository at this point
Copy the full SHA 17fa3d8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 34730a7 - Browse repository at this point
Copy the full SHA 34730a7View commit details