It is possible to drop winston dependency in production? #49
-
Beta Was this translation helpful? Give feedback.
Replies: 13 comments 1 reply
-
But if you don't like it, just remove it then. I don't know how to remove a package from build for a particular stage/env. I don't know how big Winston is (74kb, that much? Or is it 18.84kb?), I'll try to take a look at it at some point. |
Beta Was this translation helpful? Give feedback.
-
I find it too expensive to spend such resources for simply logging in production. Now I’m just preparing myself an assembly for the start of the project, and I have borrowed your approaches regarding the organization of internationalization + multiversal-app-bootstrap, but it seems to me a very bad indicator that now these red numbers show when I have not written any business logic and the pages are almost completely empty! |
Beta Was this translation helpful? Give feedback.
-
I agree with you, I wasn't aware it was so heavy. Here is the production build: Rewriting the logger will be a perf improvement. I wasn't so happy with it, but if it's that heavy then it's even worse than I thought. I'll try to find for a proper alternative, thanks for the heads-up! |
Beta Was this translation helpful? Give feedback.
-
I'm considering https://github.com/klaussinani/signale as a replacement, much lighter (x10). I'll give it a try. |
Beta Was this translation helpful? Give feedback.
-
signale didn't work out (as well as many others), eventually I tried ulog and made a PR #50 but it's not usable yet. It's crazy how hard it is to do something so simple... |
Beta Was this translation helpful? Give feedback.
-
Yeah I've noticed that same issue, it would be great to find out a better alternative. |
Beta Was this translation helpful? Give feedback.
-
If you know any, I'm interested, I've looked over ~6-10 of them so far. ulog and debug were my favorites so far. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Status of this: I've attempted to use ulog, but couldn't make it work and didn't hear back from the author Download/ulog#29 I don't have time to dig deeper, I agree that we could find a lighter alternative to Winston. (FYI I use https://bundlephobia.com/[email protected] to compare them before doing any work on them) Feel free to propose a better alternative with its implementation. I'll leave the issue open until then. |
Beta Was this translation helpful? Give feedback.
-
Gonna attempt with http://getpino.io/#/ Edit: Tried, didn't work. pinojs/pino#840 |
Beta Was this translation helpful? Give feedback.
-
Considering after various attempts I didn't find anything that fits, what do you think about building a small internal utility for this? The needs are:
Does those specs make sense? Anyone would like to give it a try? I don't have the time 😕 |
Beta Was this translation helpful? Give feedback.
-
I finally wrote the above-mentioned utility and have started working on replacing the @unly/utils-simple-logger by a new @unly/simple-logger package. The The new package is <1Kb on the browser. PR: #314 |
Beta Was this translation helpful? Give feedback.
I finally wrote the above-mentioned utility and have started working on replacing the @unly/utils-simple-logger by a new @unly/simple-logger package.
The
winston
dependency has been removed, and been replaced bychalk
(8kb gzipped) which is only being imported on the server.The new package is <1Kb on the browser.
PR: #314