Skip to content

Releases: ericdowell/resource-endpoint

TS Target Updated to ES6 & Update Dependencies

02 Jul 23:36
Compare
Choose a tag to compare

Details on target Change

When attempting the following:

import {
  ApiMixin,
  AxiosErrorMixin,
  UserEndpoint,
  HandleErrorMixin,
  SessionCsrfCookieMixin,
  FormMixin,
} from 'resource-endpoint'

class UserBase extends SessionCsrfCookieMixin(
  ApiMixin(FormMixin(UserEndpoint)),
) {}


class UserQuery extends AxiosErrorMixin(UserBase) {}

export class User extends HandleErrorMixin(UserBase) {
  /**
   *
   * @returns {UserQuery}
   */
  get reactQuery() {
    return new UserQuery()
  }
}

An error of Uncaught TypeError: Class constructor UserBase cannot be invoked without 'new' would occur in the browser.

Issue seems to be around classes transpiled to ES5. Mainly, that native ES6 classes cannot extend the the transpiled classes.

The problem is that the class extends native ES6 class and is transpiled to ES5 with Babel. Transpiled classes cannot extend native classes, at least without additional measures.

Source: https://stackoverflow.com/a/51860850

Revert Update Dependencies

02 Jul 23:01
Compare
Choose a tag to compare

Found the following error when using version 4.2.0:

Uncaught TypeError: Class constructor UserEndpoint cannot be invoked without 'new'

This requires some looking into to figure out what dependency version has changed the build output for ES5/commonjs. For now reverting updating dependencies.

  • Revert "Updating dependencies." This reverts commit a70bc04. 3135a03

Add AxiosErrorMixin & Update Dependencies

02 Jul 22:35
Compare
Choose a tag to compare
  • Add AxiosErrorMixin #29
  • Updating dependencies. a70bc04

Update Dependencies

05 May 04:54
Compare
Choose a tag to compare
  • Update package-lock.json to version 2. 7fc0acb
  • Update dependencies. 4aec4c6

Update Dependencies

09 Aug 01:35
Compare
Choose a tag to compare
  • Updating dependencies, including Webpack. 7d43097
  • Upgrading husky to v7. 4fcc0f7

Update Dependencies

24 Jul 02:24
Compare
Choose a tag to compare

Update Dependencies

31 May 04:21
Compare
Choose a tag to compare
  • Running npm audit fix. c902fe8
  • Updating dependencies. bc956cd
  • Updating code style with lint:fix script. 260dc45

Update Dependencies

06 May 00:53
Compare
Choose a tag to compare

Major Release

14 Feb 21:42
Compare
Choose a tag to compare
  • Added Node.js support, previously only worked with browser builds.
  • Removed static method Endpoint.safeResponseData. BREAKING
  • Removed static method Endpoint.handleRequestError. BREAKING
  • Renamed Endpoint endpoint property to resource. BREAKING
  • Renamed config to globalOptions, setConfig to setGlobalOptions and Config class to Options. BREAKING
  • Added localOptions property and setLocalOptions method to Endpoint.
  • Updated path usage throughout Mixins.
  • Updated Endpoint origin/path properties to pull from this.options. WARNING may be BREAKING depending on usage

Update Dependencies & Webpack Config

14 Feb 19:30
Compare
Choose a tag to compare