Skip to content

Releases: thorgate/tg-resources

Version 2.0.0-alpha.7

05 Jun 20:33
5719911
Compare
Choose a tag to compare
Version 2.0.0-alpha.7 Pre-release
Pre-release
Version 2.0 alpha 7

2.0.0-alpha.6

31 Aug 16:18
Compare
Choose a tag to compare
2.0.0-alpha.6 Pre-release
Pre-release

TBD

2.0.0-alpha.5

30 Aug 16:45
Compare
Choose a tag to compare
2.0.0-alpha.5 Pre-release
Pre-release

TBD

2.0.0-alpha.4

30 Aug 16:15
Compare
Choose a tag to compare
2.0.0-alpha.4 Pre-release
Pre-release

TBD

2.0.0-alpha.3

30 Aug 15:51
Compare
Choose a tag to compare
2.0.0-alpha.3 Pre-release
Pre-release

TBD

2.0.0-alpha.2

27 Jul 16:49
Compare
Choose a tag to compare
2.0.0-alpha.2 Pre-release
Pre-release

TBD

2.0.0-alpha.1

29 Aug 08:39
Compare
Choose a tag to compare
2.0.0-alpha.1 Pre-release
Pre-release
  • ❗ Removed deprecated ValidationError.getFieldError
  • ❗ Renamed internal .options (per resource/router) to .config (see #10)
  • parseErrors now gets parent config not parent instance as it's second argument
  • prepareErrors now gets parent config not parent instance as it's second argument
  • ❗ Removed defaultHeaders - use headers or defaultAcceptHeader
  • ❗ Setting Accept header to undefined/null does not cause the response to be parsed
    as text anymore. When migrating, just set Accept to text/html.
  • Added built-in for OPTIONS request: Resource.options (see #10)
  • Added new configuration parameter mutateError (see docs)
  • Added defaultAcceptHeader (see docs)
  • Removed separate tg-resources-react-native package. Users of older
    versions of it can safely update to tg-resources@2.0.0
  • Deterministic config merge (+ tests for it)
  • Use jsnext:main and module fields in package.json
  • Use react-native field in package.json
  • Update dev dependencies
  • Docs: Document extra arguments of mutateResponse
  • Docs: Add call signatures for parseErrors
  • Docs: Add call signatures for prepareError

Version 1.0.0

20 Jun 14:11
Compare
Choose a tag to compare
  • Support react native (see #2)
  • Error handling changes (see #3)
  • No global configuration anymore
  • Routers (see documentation)
  • more tests
  • Misc
    • Use babel 6 for building
    • Reduce dependency count
    • Use lodash.template instead of depending on full lodash

Migrating to 1.0.0

  1. Default export changed:

    old: import Resource from 'tg-resources';

    new: import { Resource } from 'tg-resources';

  2. Global configuration was removed

    Instead of using setConfig and getConfig one must set config per Resource1

    [1] To keep things DRY use Router for defining your configuration. Note: It's also possible to extend Resource which can be a better alternative in some cases.

  3. Configuration parameters have changed:

    • API_BASE is now apiRoot

    • getExtraHeaders is now headers

    • getCookies is now cookies

    • added:

      • mutateResponse
      • prepareError
      • parseErrors
      • statusSuccess
      • statusValidationError
      • defaultHeaders
    • removed:

      • onSourceError
      • ValidationErrorExtras

    see the Configuration for more info

  4. Resource constructor changed:

    old: new Resource(apiEndpoint, expectedStatus, mutateResponse, errorStatus)

    new: new Resource(apiEndpoint, config)