-
Notifications
You must be signed in to change notification settings - Fork 435
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
feat: Lite - significantly reduce the size of tedious #1156
base: master
Are you sure you want to change the base?
Conversation
Thanks for this PR! We'll take a look at this as soon as possible |
This is a great idea! Not loading dependencies that are not always required will help application startup times a lot, and is definitely something worth improving. I do think we'll want to take a slightly different approach, namely making use of dynamic This should be a straightforward change. @IanChokS is this something you want to work on? |
Thanks, @arthurschreiber! I just re-read what I wrote, I'm sure I meant that including tedious takes the size from 60kb to 1,900kb, not from 600kb to 1,900kb. Anyways, we actually employ bundling (currently using browserify) to remove a lot of cruft in node_modules and do an overall minification. The 1,900kb number is also the minified size. Doing dynamic imports tend to trip that up. I think that's why I went with the alternate entry point. |
@kristoffer-zliide You're right - dynamic imports might not actually solve much for the use case you have. I'll think about this a bit more. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1156 +/- ##
==========================================
+ Coverage 79.19% 79.33% +0.14%
==========================================
Files 93 88 -5
Lines 4860 4477 -383
Branches 933 823 -110
==========================================
- Hits 3849 3552 -297
+ Misses 707 658 -49
+ Partials 304 267 -37 ☔ View full report in Codecov by Sentry. |
7acfb98
to
fd4e386
Compare
@arthurschreiber: did you think about it a bit more? |
fd4e386
to
8153535
Compare
Yeah, I also experimented with removing joda |
I find myself continuously rechecking this issue for updates. In one of my applications at work, the mssql dependency and its dependencies makes up 71% of the size of the entire app including all dependencies. |
I was thinking a bit more about this. One thing is the shear size of the (minified) code, another is really the number of dependencies, which in increases the need for frequently updating packages and increases the number of issues reported by npm audit (which used to be a lot, but maybe not as much recently). What if we took the @arthurschreiber, @IanChokS: what do you think? |
@kristoffer-zliide That sounds good 👍 But it will require some re-architecting of library repo - I'd like us to keep all the code for the different packages in one repo. I guess npm workspaces could help with that? But I've never used that. |
@kristoffer-zliide , Sorry that that I closed this earlier by mistake, and Thank you for putting the effort and thoughts on this idea. |
391ab26
to
d812ab6
Compare
in order to preserve git history.
ed7cda1
to
0fd4864
Compare
Reduces a minified code size from ~1.4MB to ~850kb.
Reduces a minified code size from ~850kb to ~580kb.
0fd4864
to
fdd3bdb
Compare
We are building a modern serverless architecture on a Microsoft cloud platform but struggling a bit with cold starts. We have experienced and read about others who have experienced a correlation between code size and startup times, when we realized that tedious has increased in size quite significantly since around version 4. Specifically, we see an increase in minified size of an app that does (almost) nothing except from issuing a SQL query from around 60kb to 1,900kb.
This pull request introduces a "tedious lite" alternative entry point that includes a lot less code that users who do not need "extra" things like exotic code pages and federated authentication can use to reduce their code size. This is done as a non-breaking change. Switching from normal tedious to tedious lite takes the minimal app size from around 1,900kb to around 530kb.
Future improvements could include handling date/time without joda, which would take the code size down even further to around 340kb.
Feedback welcome.