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

Generate @apollo/client/invariantErrorCodes.js for each release. #6665

Merged
merged 3 commits into from
Jul 21, 2020

Commits on Jul 21, 2020

  1. Generate @apollo/client/invariantErrorCodes.js for each release.

    When an invariant fails in production, a cryptic numeric error of the form
    `Invariant Violation: 42` is thrown, with a reference to the error codes
    section of invariant-packages README.md: https://github.com/apollographql/invariant-packages#error-codes
    
    This vague guidance has not proven adequate in many cases, to say the
    least: see apollographql/invariant-packages#18,
    apollographql/invariant-packages#19, #6604,
    
    Using error codes instead of error strings remains important for
    production bundle sizes, but I think we can make it substantially easier
    to look up the error string corresponding to each error code, by
    generating a single file containing all the invariant error codes for each
    @apollo/client release.
    
    Starting with Apollo Client 3.1.0, this manifest file can be found in
    @apollo/client/invariantErrorCodes.js (using an npm/yarn-installed copy of
    @apollo/client, since this file is generated in the ./dist directory, not
    checked into the repository). The file contains an explanatory comment,
    the @apollo/client version, and a sequential map from error numbers to the
    { file, node } responsible for the error.
    
    I wish we could go back and republish old versions of @apollo/client to
    include this file, but at least things should be easier going forward.
    benjamn committed Jul 21, 2020
    Configuration menu
    Copy the full SHA
    4badf2f View commit details
    Browse the repository at this point in the history
  2. Mention PR #6665 in CHANGELOG.md.

    benjamn committed Jul 21, 2020
    Configuration menu
    Copy the full SHA
    aeb2237 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4f44fba View commit details
    Browse the repository at this point in the history