servo / stylo

39 stars 11 forks source link

Question: Releases of components like selectors on crates.io #8

Closed adamreichold closed 4 months ago

adamreichold commented 4 months ago

Sorry for abusing the issue tracker to ask a question: I am using the scraper crate which basically packages Servo components like cssparser and selectors around a simplified DOM tree based on ego-tree. While cssparser seems to be development separately over at https://github.com/servo/rust-cssparser, this appears to be the new home of selectors if there is any. (Meaning the package on crates.io, not the upstream component of Gecko/Firefox.) Is that correct?

Will this project do future releases of its constituent components like selectors on crates.io? (I assume such release would track the crates.io release of standalone components like cssparser?) Is there anything I as a user of scraper but outsider to the Servo and/or Stylo projects can do to help with this?

nicoburns commented 4 months ago

While cssparser seems to be development separately over at https://github.com/servo/rust-cssparser, this appears to be the new home of selectors if there is any

Correct

Will this project do future releases of its constituent components like selectors on crates.io?

Yes, there are definitely plans for this. It may still be a few (say 3-6) months until it happens (but it may also be sooner), but once we have everything setup we are hoping to be able to do regular releases synced with the upstream Gecko/Firefox version on an ongoing basis.

around a simplified DOM tree based on ego-tree

Interesting. We have a similar tree implementation in the taffy crate, and will also be implementing a simple dom for Blitz. We could potentially collaborate there. Taffy's implementation uses slotmap which is nice a improvement over Vec as it allows nodes to be entirely dropped and deallocated. But we don't currently have prev_sibling and next_sibling fields which seems like an advantage of your implementation.

adamreichold commented 4 months ago

Yes, there are definitely plans for this. It may still be a few (say 3-6) months until it happens (but it may also be sooner), but once we have everything setup we are hoping to be able to do regular releases synced with the upstream Gecko/Firefox version on an ongoing basis.

That is great to hear! I still whether I can actually help with the process instead of just freeloading from the sidelines though. (Not to make it faster, just to generally make it less of a one way street.)

We could potentially collaborate there. Taffy's implementation uses slotmap which is nice a improvement over Vec as it allows nodes to be entirely dropped and deallocated. But we don't currently have prev_sibling and next_sibling fields which seems like an advantage of your implementation.

Note that I cannot take any credit for scraper of which I am just a rather recent user and doing some maintenance on. AFAIK, the original author (who is also the creator of ego-tree) is not involved in its development any more. The other people working on scraper appear to be a in similar position as I am.

Hence, collaborating on an alternative/modernized DOM implementation could certainly be useful. I think the design that has sustained scraper so far is that its mission is relatively straight-forward: Implement as much structure so that we can be a tree sink for html5ever and that selectors can work with the result, but no more. Does that description sound like a crate that both scraper and taffy could use? (My first impression is that you wouldn't need the html5ever integration at all?)