loopback-next icon indicating copy to clipboard operation
loopback-next copied to clipboard

Remove assert dependency from library #8126

Open wdunn001 opened this issue 2 years ago • 5 comments

Checklist

  • [x] DCO (Developer Certificate of Origin) signed in all commits
  • [x] npm test passes on your machine
  • [x] New tests added or existing tests modified to cover all changes
  • [x] Code conforms with the style guide
  • [x] API Documentation in code was updated
  • [x] Documentation in /docs/site was updated
  • [x] Affected artifact templates in packages/cli were updated
  • [x] Affected example projects in examples/* were updated

👉 Check out how to submit a PR 👈

wdunn001 avatar Dec 17 '21 16:12 wdunn001

The assert library throws an AssertionError with a specific configuration:

https://github.com/nodejs/node/blob/1aaa4eb8886fb77a0e1a25de28dbf13188df4fbf/lib/assert.js#L378-L402

Would we be able to keep that backwards compatibility?

achrinza avatar Dec 21 '21 12:12 achrinza

The assert library throws an AssertionError with a specific configuration:

https://github.com/nodejs/node/blob/1aaa4eb8886fb77a0e1a25de28dbf13188df4fbf/lib/assert.js#L378-L402

Would we be able to keep that backwards compatibility?

done

wdunn001 avatar Jan 07 '22 18:01 wdunn001

@agnes512 @achrinza any update on this?

wdunn001 avatar Jan 26 '22 19:01 wdunn001

What's the motivation to remove assert? For front-end compatibility?

raymondfeng avatar Jun 07 '22 23:06 raymondfeng

What's the motivation to remove assert? For front-end compatibility?

Yes, that's mainly why. We were using this with angular before the recent webpack update that throws an error because assert is a node-only library and would require polyfills. But assert is barely used in this library and serves no real purpose. Currently, we created an internal version of this library without the assert dependency and use it to pass filters to the backend.

wdunn001 avatar Jun 08 '22 03:06 wdunn001