Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove legacy code #7183

Closed
wants to merge 11 commits into from
Closed

Conversation

demensky
Copy link
Contributor

@demensky demensky commented Feb 11, 2023

Main points:

  • Drop Internet Explorer support into a pit of flames! 馃敟 IE 馃敟 馃コ
  • Remove hacks when inheriting from native error classes. This makes no sense if ES2015+ is used.
  • Remove support for ES5.
  • Switch compilation to ES2022.

If you know any other places that are legacy and need to be deleted/refactor, welcome to the comments.

BREAKING CHANGE: EmptyError cannot be used if target is below ES2015
BREAKING CHANGE: NotFoundError cannot be used if target is below ES2015
BREAKING CHANGE: SequenceError cannot be used if target is below ES2015
BREAKING CHANGE: TimeoutError cannot be used if target is below ES2015
BREAKING CHANGE: ObjectUnsubscribedError cannot be used if target is below ES2015
BREAKING CHANGE: ArgumentOutOfRangeError cannot be used if target is below ES2015
BREAKING CHANGE: AjaxError cannot be used if target is below ES2015
BREAKING CHANGE: AjaxTimeoutError cannot be used if target is below ES2015
BREAKING CHANGE: UnsubscriptionError cannot be used if target is below ES2015
BREAKING CHANGE: ajax no longer supports IE

Related issue (if exists): #6367

BREAKING CHANGE: `EmptyError` cannot be used if `target` is below ES2015
BREAKING CHANGE: `NotFoundError` cannot be used if `target` is below ES2015
BREAKING CHANGE: `SequenceError` cannot be used if `target` is below ES2015
BREAKING CHANGE: `TimeoutError` cannot be used if `target` is below ES2015
BREAKING CHANGE: `ObjectUnsubscribedError` cannot be used if `target` is below ES2015
BREAKING CHANGE: `ArgumentOutOfRangeError` cannot be used if `target` is below ES2015
BREAKING CHANGE: `AjaxError` cannot be used if `target` is below ES2015
BREAKING CHANGE: `AjaxTimeoutError` cannot be used if `target` is below ES2015
Since the type specifies that `errors` is an array and the only place where
this class is used is wrapped in `if (errors) {` I removed the meaningless
ternary operator.

BREAKING CHANGE: `UnsubscriptionError` cannot be used if `target` is below ES2015
BREAKING CHANGE: `ajax` no longer supports IE
@demensky demensky closed this Feb 12, 2023
@demensky demensky deleted the unlegacyfy branch March 1, 2023 22:56
@brodo
Copy link

brodo commented Mar 7, 2023

Hi, can you tell my why you closed this PR? I stumbled across the createErrorClass function recently and it has more problems besides being 'hacky':

  • It does not create 'native' errors and thus rxjs error instances can not be identified with Node.js's util.types.isNativeError() function.
  • It does instantiate the stack trace eagerly. This means that error creation is about 10 times slower compared to a normal error (in my micro benchmark).
  • All stack traces contain createErrorClass, which is not pretty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants