Skip to content

dataclass v2.0.0

Compare
Choose a tag to compare
@alexeyraspopov alexeyraspopov released this 12 Oct 22:56
· 29 commits to master since this release
  • Dataclass is now licensed under ISC License
    https://github.com/alexeyraspopov/dataclass/blob/master/LICENSE
  • Breaking: the utility class has been renamed from Record to Data
    • "Record" now means a lot of other things in the ecosystem
  • Breaking: use .create() static method instead of new operator
    • This fixes the issue with existing browser implementation of class properties
    • The use of new operator now throws a runtime error
  • Breaking: TypeScript classes no longer need to be generic
  • Breaking: an attempt to mutate properties now throws runtime errors
  • Breaking: use named import instead of default import { Data } from "dataclass"
    • This should fix possible CJS/ESM compatibility issues and allow future API extensions
  • Breaking: explicit toJSON() implementation has been removed, but the behavior is preserved
  • Breaking: library code is no longer transpiled to ES5
    • Unless you support evergreen browsers, you still need to transpile TypeScript or class
      properties so the build step is inevitable. Thus, make sure dataclass is transpiled if
      necessary
  • Fixed equals() algorithm to ensure proper custom values comparison
  • Fixed equals() algorithm to avoid runtime errors for nullable properties
  • Added sideEffects: false to package.json