0.7.0 • Published 7 months ago

@equinor/echo-base v0.7.0

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

logo

echo-base

Everything a Echo web need for enabling micro frontend development.

This library was generated with Nx.

How to develop and release EchoCore

Check the readme in the NX libraries folder.

Available NPM scripts

  • lint-base
  • build-base
  • test-base

What's new

v0.7.0:

  • Moved to Monorepo
  • Updated some Typescript Types: they caused build errors with the Monorepo setup

v0.6.0:

  • Fixed error reporting to application insights, it now properly reports all properties including innerErrorsProperties.
  • Fixed baseError, it now properly supports nested innerErrors. Exception/inner Error used to overwrite each others property if they had the same name.
  • BaseError now has errorTraceId, either from backEnd, or a unique frontEnd id
  • BaseError helper methods added for getting properties or propertyByName

It's recommended to create your own error types, extending BaseError, and decorate it with your own fields:

    export class PdfError extends BaseError {
        docNo: string;
        constructor(args: { message: string; docNo: string; innerError?: Error }) {
            super({ name: 'PdfError', message: args.message, innerError: args.innerError });
            this.docNo = args.docNo;
        }
    }

Breaking Changes

v0.6.0:

  • Renamed initializeError to initializeNetworkError and simplified it. It now only takes NetworkErrorArgs as argument.
  • BaseError now properly support nested (and nested-nested) errors with argument innerError.
    Earlier properties with the same name would overwrite each other.
    exception argument renamed to innerError, of type Record<string, unknown> | Error
  • BaseError doesn't add properties directly onto itself anymore, but uses nested errors with argument innerError.
  • Instead of BaseError.allProperties()["someCustomProperty"] use BaseError.findPropertyByName("someCustomProperty"). Since we now use innerError of type Error or Record<string, unknown>, the property has been moved from baseErrorproperty to baseError.innerErrorproperty.
  • Moved EchoEvents enum to EchoCore.
  • Changed types for EventHub event keys in all functions from string | EchoEvents to string only.

v0.5.0:

  • SubClasses of BaseError will not get the name of the class automatically anymore, but have to specify it. This to avoid name obfuscation/minify to a single letter in appInsight.

Example implementation:

export class CustomError extends BaseError {
    constructor(args: ErrorArgs) {
        super({ ...args, name: 'CustomError' });
    }
}
0.7.0

7 months ago

0.7.0-beta-0

7 months ago

0.6.22

1 year ago

0.6.22-alpha

1 year ago

0.6.21

2 years ago

0.6.13-rc1

2 years ago

0.6.13

2 years ago

0.6.9

2 years ago

0.6.10

2 years ago

0.6.12

2 years ago

0.6.11

2 years ago

0.6.7

2 years ago

0.6.6

2 years ago

0.6.8

2 years ago

0.6.5

2 years ago

0.6.3

2 years ago

0.6.2

2 years ago

0.6.4

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.5.1

2 years ago

0.3.4

3 years ago

0.3.3

3 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.108

3 years ago

0.2.107

3 years ago

0.2.104

3 years ago

0.2.100

3 years ago

0.2.63

3 years ago

0.2.62

3 years ago

0.2.61

3 years ago

0.2.96

3 years ago

0.2.95

3 years ago

0.2.94

3 years ago

0.2.93

3 years ago

0.2.92

3 years ago

0.2.91

3 years ago

0.2.97

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.2.7

3 years ago

0.2.6

3 years ago

0.2.9

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.1.3

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago