Upcoming changes to oxvg #10241
Replies: 2 comments
-
Nice work. This has been a key part of lightningcss's performance as well. I think ideally HTML would be parsed similarly as well, but that would be a significant amount of work. Are the Node/Attribute types extensible? What happens to unknown nodes/attributes? If those are represented with some less optimal but generic structure perhaps that could work for HTML for now. The HTML optimization pass is really simple (e.g. removing whitespace) and happens in a single pass so I'm not too worried about performance. Happy to go with a translation layer as well. What do you think is easiest? |
Beta Was this translation helpful? Give feedback.
-
I think we can progressively add HTML types as needed, we don't necessarily need to add the entire spec in one go.
They're not extensible like they were as traits. I suppose one could add wrapper types if needed.
Unknown attributes and elements are represented with a more generic structure.
Probably a translation layer is easier regarding development effort for both of us. I think that's a good approach to start with and we can look into a more extensive method some time in the future. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been doing a fairly large refactor with OXVG to improve it's performance and APIs, however it'll come with some breaking changes that I'd like to figure out with your project before I release it. The main issue being that there will no longer be a
NodeandElementtrait -- with these being replaced by types instead.The reasoning behind this change is included in this pull request (noahbald/oxvg#176).
I'm happy to do the work to get things compatible with
parcel-html, and I'm thinking we could do one of the followingcrate::arena::Nodeandoxvg_ast::node::Nodecrate::arena::Nodewith Parcelcrate::arena::Nodewithoxvg_ast::node::Nodeoxvg_astto include html parsingcrate::arena::Nodewith Parceloptimize.rsmethod by matching against attribute value types rather than attribute namesLook forward to hearing your thoughts -- I really appreciate you choosing to use oxvg as a dependency!
You can also join the discord or email me depending on your comm preference.
Beta Was this translation helpful? Give feedback.
All reactions