Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why tslib as dependency? #5968

Closed
atassis opened this issue Jan 21, 2021 · 2 comments
Closed

Why tslib as dependency? #5968

atassis opened this issue Jan 21, 2021 · 2 comments

Comments

@atassis
Copy link

atassis commented Jan 21, 2021

You shouldn't rely on tslib at all, it is a typescript compilation level helper, as documented on its side. I saw that by checking dependencies on my server code. We don't use importHelpers flag, it is totally unnecessary in any kind of environment, but still its the single dependency you have

RxJS version:
6.x and higher

Expected behavior:
tslib not being listed as dependency at all

Actual behavior:
tslib as dependency

Additional information:
https://github.com/Microsoft/tslib

@kwonoj
Copy link
Member

kwonoj commented Jan 21, 2021

rxjs itself currently uses importhelpers

"importHelpers": true,
and try to dedupe runtime code generated by tsc per each files. There are some internal discussion around if we should get away from it or not after re-do size benchmark.

It was introduced due to benefit of tslib

this can avoid duplicate declarations of things like __extends, __assign, etc., this means delivering users smaller files on average, as well as less runtime overhead. For optimized bundles with TypeScript, you should absolutely consider using tslib and --importHelpers.

in lib itself.

it is a typescript compilation level helper

I'm curios to hear more about this - tslib pkg itself says it's This is a runtime library for tsc builds and we use it for those purpose.

@kwonoj
Copy link
Member

kwonoj commented Jan 21, 2021

And I'm moving this into discussions as issues are for core team's backlog for bug tracking.

@kwonoj kwonoj closed this as completed Jan 21, 2021
@ReactiveX ReactiveX locked and limited conversation to collaborators Jan 21, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants