Use native DOMParser and XMLSerializer #26
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After #25, I've made a further progress in the direction of removing
xml-js
, migrating from a xml library that provides their original interface, to Web standard DOMParser and XMLSerializer.With this change the package size with required dependencies will be reduced by ~128KB.
While DOMParser and XMLSerializer are supported since Chrome 4, for environments that don't support DOMParser and/or XMLSerializer, there are polyfills like
xmldom
andjsdom
.xmldom
is a lightweight (30KB) pure JS implementation of DOMParser and XMLSerializer with no dependencies on Node.js standard modules, so I use it in the updated tests to verify that our vast/vmap parsers will work well withxmldom
.