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

Merge Apollo Link common + HTTP functionality into core #5412

Merged
merged 30 commits into from
Oct 6, 2019

Commits on Oct 4, 2019

  1. Add fetch-mock dep for link testing

    And remove the unused isomorphic fetch dep.
    hwillson committed Oct 4, 2019
    Configuration menu
    Copy the full SHA
    de18694 View commit details
    Browse the repository at this point in the history
  2. 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.
    hwillson committed Oct 4, 2019
    Configuration menu
    Copy the full SHA
    3edfd4b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8861959 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7f045f8 View commit details
    Browse the repository at this point in the history
  5. 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.
    hwillson committed Oct 4, 2019
    Configuration menu
    Copy the full SHA
    7b35832 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    3cf1efa View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    6be12f3 View commit details
    Browse the repository at this point in the history
  8. 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.
    hwillson committed Oct 4, 2019
    Configuration menu
    Copy the full SHA
    c76a56c View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    7aa1837 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    e1fdf91 View commit details
    Browse the repository at this point in the history
  11. Remove unnecessary mockLink Apollo Link testing utility

    This util was adding very little additional value over just using
    `ApolloLink` directly.
    hwillson committed Oct 4, 2019
    Configuration menu
    Copy the full SHA
    b74c3d3 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    c62bc1f View commit details
    Browse the repository at this point in the history
  13. Move link test utilities into single test using them

    Also removes link test utilities from the public API.
    hwillson committed Oct 4, 2019
    Configuration menu
    Copy the full SHA
    be1fdae View commit details
    Browse the repository at this point in the history
  14. 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.
    hwillson committed Oct 4, 2019
    Configuration menu
    Copy the full SHA
    5fe9e7f View commit details
    Browse the repository at this point in the history
  15. 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).
    hwillson committed Oct 4, 2019
    Configuration menu
    Copy the full SHA
    87bb72f View commit details
    Browse the repository at this point in the history
  16. 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.
    hwillson committed Oct 4, 2019
    Configuration menu
    Copy the full SHA
    944d007 View commit details
    Browse the repository at this point in the history
  17. Export UriFunction type

    hwillson committed Oct 4, 2019
    Configuration menu
    Copy the full SHA
    77d1235 View commit details
    Browse the repository at this point in the history
  18. Increase bundlesize

    hwillson committed Oct 4, 2019
    Configuration menu
    Copy the full SHA
    705fc73 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    62f9350 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    6d574df View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    b87afc1 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    f8b04d5 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    07463bc View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    74dbbf7 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    fc5c068 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    ff9d1fb View commit details
    Browse the repository at this point in the history

Commits on Oct 6, 2019

  1. 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
    hwillson committed Oct 6, 2019
    Configuration menu
    Copy the full SHA
    2a9445f View commit details
    Browse the repository at this point in the history
  2. Hide Observable implementation details

    Make 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.
    hwillson committed Oct 6, 2019
    Configuration menu
    Copy the full SHA
    b1cd004 View commit details
    Browse the repository at this point in the history
  3. Changelog update

    hwillson committed Oct 6, 2019
    Configuration menu
    Copy the full SHA
    17fa3d8 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    34730a7 View commit details
    Browse the repository at this point in the history