-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Modifications for Rocket integration #20
Comments
For HTML/XML, I was thinking about using html5ever, but not much optimisations can be performed on those formats unfortunately. For JSON, it'd require a whole new parser (nothing impossible to do but still needs to be done). |
I'm currently writing the JSON minifier with READ implementation. Should be done tomorrow. I'm not sure how I will give you an example tomorrow with the JSON parser. It is a bit more difficult but offers a huge performance bonus as it is not iterating multiple times over the whole data |
Oh cool!
Not sure yet but since it's used by
In my current implementation, I'm not iterating multiple times over whole data. Or did I miss your point? :) |
re.replace_all(&source, " ").into_owned() re.replace_all(source, |caps: &Captures| {
type_reg.replace_all(&caps[0], "").into_owned()
}).into_owned() for useless_tag in &useless_tags {
res = res.replace(useless_tag, "");
} What is your way of calling this :D (no offence) |
That's the HTML part. This part is clearly not ready and shouldn't be used. That's why I want to rewrite it using html5ever. I should have been more clear on that point, my bad. :) |
Ah I see. Well in that case it might make sense. Remember however that html and xml is not the same. I guess that xml cannot be minified by |
XML is simpler, indeed. Don't know if it's really worth it to write a XML minifier though. |
@GuillaumeGomez Any updates on this? Would be nice to know whether |
HTML minification is tricky, because you never really know where spaces are important or not. For XML I haven't look at all. Also, I still need to add the |
Does your "html" checkpoint include javascript (in a script tag or in its own file)? I think that's the most minifiable of them all, and probably with the most existing libs to do it. |
I'm adding this Issue to track progress for the integration into #684
My suggestion is:
What do you think? I'm of course happy to help if you point me to the right direction. Maybe some of the stuff from my crate might be helpful as well
The text was updated successfully, but these errors were encountered: