ember-fastboot / simple-dom

208 stars 33 forks source link

Add Options for trimming whitespace and stripping comments to serializer #78

Closed SinS3i closed 5 years ago

SinS3i commented 5 years ago

Why: Because minifying html after serialization is very expensive, especially when not all types of minifications are desired. Having the ability to do simple whitespace and comment stripping during serialization stage simplifies this, and default false options means the change is backwards compatible

How: Add an optional opts arg to the Serializer constructor and check it in methods that output text

Also: Cleaned up toLowerCase method.

Sidenote: I was unclear why name.toLowerCase() wouldn't work for all use-cases, so if someone could elaborate, that'd be helpful. I changed it to the way it is now under the assumption it was important to make that distinction, though.

SinS3i commented 5 years ago

closing due to concerns w/ surface area and better approaches. This is simple-dom, not complicated-dom 🤣