-
Notifications
You must be signed in to change notification settings - Fork 33
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
update terser to latest version (5) #46
Comments
Not sure what you mean with this.
Which dependencies exactly do you mean? According to https://github.com/terser/terser/blob/master/CHANGELOG.md#v500-beta0 the minimum required Node version is This needs further clarification because webpack 4 supports Node 6+. |
@DanielRuf You can do major release, as we will do for |
I will wait for the feedback of @fabiosantoscode. I do not plan to maintain two major versions at the same time so the upgrade will not happen soon. Please keep in mind that dependents like the html-webpack-plugin would use the old version which I would not maintain then. https://www.npmjs.com/package/html-minifier-terser
I can not simply drop that because webpack 4 will still support Node 6 for a very long time. So this is not an option. Otherwise there will be issues like #22 and more which produces extra work and makes the upgrade and major version bump senseless for the near future. |
I'll wait until webpack 5 is released and webpack 4 deprecated. |
Okay, I will do fork and will use it in webpack packages. And you should not maintain two packages, you need keep support the latest version and keep it up to date What you are trying to do only creates difficulties and problems:
|
No need, it only creates problems, most of developers do not use node 6, almost loaders and plugins supports only node@10, you can look at |
Not sure why this is needed and I don't think this is helpful. This will likely break all webpack 4 setups. Still, what do you want to resolve by upgrading to terser 5 in this package here? |
Which package.json? I look at the package.json of webpack. And The html-webpack-plugin maintained by @jantimon. |
I see no problem by supporting minimum Node version. Please clarify which problems you mean. |
I update original answer #46 (comment) |
This is not what I mean, if we upgrade (which results in html-minifier-terser v6) we may still have to support v5 by maintaining a second branch (which is done by many big projects). |
Big projects |
This package uses in html-loader, so we need to upgrade terser to avoid future problems with minimizing |
Are you seriously? Node 6 does not receive security updates, it potentially contains vulnerabilities, no project will use this in production |
To clarify my opinion:
Which problems / difficulties does this cause? I see none.
I am still waiting for the feedback from @fabiosantoscode.
You did not show any relevant advisories or npm audit reports ;-)
This can be easily backported.
Well, tell that webpack and others ;-)
Well, tell that webpack and others ;-)
Citation needed, where are currently problems with minimizing? I see no relevant bugfixes at https://github.com/terser/terser/blob/master/CHANGELOG.md#v500 Please calm down and do not rush. At least producing pressure on me does not help at all. And I want to avoid issues like in the past due to breaking installs reported to @jantimon and others. |
Please read node docs about minimum usage, they recommend never to use EOL node version (it is insecurity), safety is always matter
terser does not bug port fixes in old version
Already, so we drop node@6 and node@8 support from all loaders and plugins, I tell you how core developers of webpack
What is it? It is fixes, so if somebody will use it in code, it will be problem.
Okay, as I said before time to fork this projects and maybe time to fork html-webpack-plugin, lately this creates only problems, my attempt to fix the process leads to nowhere, requests to fix and pay attention to very important things are ignored. I'm not putting pressure on you, I'm just trying to explain that such an approach currently creates problems, and will create even more in the future, I'm trying to prevent them at the start. I don't see any problem with dependency updates and don't use a old node. Supporting EOL node version is the worst idea. webpack@4 support node@6 due historical reasons. The new webpack version might even skip version 10 to avoid the same problem in future. All this I say as a developer who spends most of the time maintaining webpack and webpack ecosystem. |
And the most important thing - backporting is the last resort when there is no way to update at all, it is a very bad idea to use this as a standard approach |
Good luck with this. terser 5 is only 3 days old. I see no good reasons to rush this. |
And please tell me what this package has to do with the webpack? What if I use it in completely different places and ask to do update, because my code is broken due terser bugs? Still don't think this is a problem? i can create repository with issue or will that be ignored too? |
Hey there! I missed my mentions :) Terser 5 does drop older node support. Thanks for pointing out that package.json still says node 6 :) I'll change it when I have the time. I don't think there's any rush in moving to Terser 5 either! It's just been released. The real issue with updating is probably not going to be the node version (as most of your users are probably on node >=10), but the fact that the minify() function is now async (I'm very sorry but I have to update to the new source-map). This will warrant a major bump on this package as well. Error handling changed (errors are thrown instead of returned) but that shouldn't be a big issue IMO. |
Ok, it seems we may have to change a few things then and ensure that the code still works as expected. I'll plan some PR for September or October and a major release for the end of this year or next year when probably webpack 5 is released and I can discuss and coordinate this with the other package maintainers so they are aware of the planned roadmap and coming changes. |
You may not have noticed, but I am maintainer and I am asking you to do this asap, but you again ignore me |
But no need, fork is WIP and |
I am aware of that but I see no good reasons to rush here (only for webpack) =) Reopening as this is still relevant, not just for webpack. Nothing critical that has to be done now. |
There are any news here about update to Terser 5? Thanks in advance! |
No news here so far. |
@DanielRuf fortunately await and Promise.resolve() turn non-promise things into promises. PS I've migrated the terser org to travis-ci.com to fix an issue in PR builds over at the terser repo, hope you don't mind! |
I found out that my JS code inside my HTML was not minified at all because I was using the now widespread optional chaining operator It's been a while since Terser 5 release, maybe it's time to update Terser to the latest version so people can use this package with modern JS syntax 😉 |
PRs are very welcome. I have currently no time. |
Please be patient fellow humans. Updating to Terser 5 is not a matter of bumping a version in package.json. |
Hi. As the Docusaurus 2 maintainer, we would also benefit from the terser v5 upgrade. We have weird Yarn behavior (only affecting monorepos), where some users end up running this html-minifier-terser against Terser v5 instead of v4, which make the build fail. This seems to be the case when some other package of the monorepo depends on file-loader. (facebook/docusaurus#3515)
My workaround to ensure Terser V4 keep being used is to use nohoist:
We already have a few affected users by this problem. This issue is likely not the fault of this package, but was just curious if others are sharing the same motivations for this terser v5 upgrade, and maybe my workaround will be useful to others in the same situation? |
Even with yarn resolutions? |
As far as I remember, I tried yarn resolutions and it didn't work. Wasn't able to get it fixed without nohoist. If you are curious there are repros to try to fix :) |
I suspect this has to be fixed at the yarn level. Asking for a version of a package and not getting something outside that range is a very important, very critical task of any package manager. I suspect that if you have source-map installed then you have two incompatible versions of it installed? The latest one is async (which is why Terser is async) |
Yes I agree @fabiosantoscode , it's likely a Yarn issue (or maybe related to node resolution too). |
@DanielRuf do we need wait something webpack@5 was released a long time ago |
Feel free to create the fork (or provide a PR), I do not have much time at the moment and in the next weeks. |
@DanielRuf we need to change our API on async, do you agree? Don't wan to waste time |
I agree with this. |
Will be great to do it ASAP to avoid multiple dependencies, thanks for work on the package, plus update old deps too 😄 If you need I can help at the end of week
The text was updated successfully, but these errors were encountered: