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
Huge increase in fullOptJS file size #40
Comments
Yeah, I fear that's probably the case. The problem is that in 2.0 it's heavily utilized for date formatting, which is obviously a standard feature of logging. I'd welcome a PR that removes the necessity for them or offers a more clever solution to this problem. |
This was deployed and fixed in 2.2.0 |
Perfect, thanks a lot for the fast reaction! |
@darkfrog26 |
@fdietze, unfortunately, for any date formatting it's required. If you have another suggestion of how to accomplish that without it, I'd be happy to consider it. |
I understand. One could use import java.util.Date
val d = new Date()
val year = d.getYear + 1900
val month = d.getMonth + 1
val day = d.getDate
val hour = d.getHours
val minute = d.getMinutes
val second = d.getSeconds
println(f"$year%04d-$month%02d-$day%02d $hour%02d:$minute%02d:$second%02d") I suspect that the increased file size prevents many scalajs-projects from using scribe. |
@fdietze while I agree, the simple use-case of date formatting would be solved with While I agree the size is annoying, I find it unlikely it's a big issue for most people as it's incredibly common for initial loading of sites to be several meg. However, I concur that the logging library shouldn't account for a large percentage of it. ;) |
I didn't know that you have already implemented So as I see it now, the only problem seems to be the usage of What is this line exaclty for? |
The Scala.js implementation of Locale doesn't properly set the default locale so if you don't set that line a NPE is thrown when you try to access anything. |
Hmm, interesting. What effect does the For us, the file size is really a problem, because we worked hard to avoid this dependency ourselves. It pulls in all locale strings of all languages into the minified/optimized javascript bundle - which really is unnecessary. I would really like to make this optional or remove it, if it possible in any way :) Furthermore: Can we safely assume a |
@cornerman and @fdietze, I would be happy to completely remove that functionality. It was intended as placeholder until we could get a better solution. If either or both of you are willing to work on a PR to perfolation or scribe I'd be happy to assist any way I can. I've re-opened this ticket as I agree this is an issue that should be solved if it can be. |
Cool! We will try to start working on this soonish :) |
@cornerman, awesome. Feel free to message me on Gitter if you need anything from me. |
@cornerman and @fdietze, any updates on this? |
@darkfrog26 nothing new for now. i currently do not have much time for taking care of this. so, maybe we should remove it from the milestone if it is a blocker? eventually, we will definitely revisit this issue, because the size issue matters for us - just does not hurt enough yet :) |
Though this was resolved in 2.7.2, it was drastically improved in 2.7.3 |
With version 2.0, we see a huge increase in the js file size. Before the update to
scribe
our bundled size in fullOptJS was1.4mb
, now with the new version of scribe it is2.8mb
.I suspect this is due to the usage of
scala-java-time
andlocales
. We had similar issue in our own app, which is why we have removed these two packages from our app. Now, those are pulled in by scribe. Can we make this optional?The text was updated successfully, but these errors were encountered: