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

Already on GitHub? Sign in to your account

Updating rxjs to v6 on the sharing-dialog package to enable tree-shaking #590

Closed
paschalidi opened this issue Apr 9, 2020 · 3 comments
Closed

Comments

@paschalidi
Copy link

paschalidi commented Apr 9, 2020

hello y'all 👋

I am coming in with a friendly suggestion.

I would like to update rxjs to version 6 in the sharing-dialog package. This way when we include the sharing-dialog to other projects it will come with a smaller bundle. The bundle is not that big at the moment but the rxjs dependency can be go down from ~140kbs to ~40kbs in my experience with tree-shaking. This might seem as a very small optimisation but since we most of the times operate in low resources areas this is still a win in my opinion.

This is the bundle that we have at the moment in one of our apps from sharing-dialog.
image

If you look closely you will see that now rxjs imports all the operators they are having. However we are using only a small portion of those and we therefore we dont need to import all of those. :)

Let me know your thoughts! I will be happy to work on this, I have done the migration in the past and it is not that big of a problem. 🕊️

@paschalidi paschalidi changed the title Updating rxjs to v6 to enable trees-haking Updating rxjs to v6 on the sharing-dialog package to enable trees-haking Apr 9, 2020
@paschalidi paschalidi changed the title Updating rxjs to v6 on the sharing-dialog package to enable trees-haking Updating rxjs to v6 on the sharing-dialog package to enable tree-shaking Apr 9, 2020
@amcgee
Copy link
Member

amcgee commented Apr 16, 2020

Hi @paschalidi ! That would definitely be a nice improvement :-). Question though - would this be intended for 2.35 or to backport to earlier versions? And which app(s) have you seen this affect? We'd need to make sure the apps don't have incompatible rxjs versions anyway, otherwise we'll end up with duplication

If we want to backport this and it is a low-effort change (I think it should be, there's very little use of rxjs in this package) then I say go for it! Either upgrade rxjs or (perhaps better?) remove the tiny amount of rxjs we use here and get rid of the dependency altogether -

If this is targeted for 2.35 we will be rewriting this component using @cooper-joe's new designs and ui-core (removing rxjs), so it might be worth working on that effort instead? - I will be starting this shortly, would be very happy to work with you on it if you want to help out!

@amcgee
Copy link
Member

amcgee commented Apr 16, 2020

See dhis2/ui#24

@paschalidi
Copy link
Author

As you said @amcgee, it makes more sense to finish the widget than updating this one. I didnt take into account that the release circle. Will pick something from the list you mentioned. Thanks for including me in this!!

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

No branches or pull requests

2 participants