-
Notifications
You must be signed in to change notification settings - Fork 110
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
RFC: Lazily fetch id and classes #101
RFC: Lazily fetch id and classes #101
Conversation
Of course, this could be changed as well, i.e. we could provide a getter for |
This is a good idea. Before merging we need to discuss about the breaking changes though. This could be included in the next major release. cc @teymour-aldridge |
I would also like to note that I think the behaviour changes ( |
I rebased this and changed it so that the ID is stored lazily as well and hence the semantics are completely unchanged compared to the master branch. Just the storage resp. extraction is handled differently. |
…e to use a simpler collection type.
Since there are no breaking changes, we can merge this right now. @adamreichold do you want to add something else? |
Note that these are semantically equivalent but still technically breaking as both
No I don't plan to add anything else. |
Yeah, I meant that there are no substantial changes in usage. Obviously a version bump will be necessary. (0.16.0) |
I think this might be a useful addition to #91 by avoiding the upfront costs for all elements and only materializing the set of classes when they are actually used.
This does come with an API change (no more public fields
id
andclasses
) and also a behavioural change, i.e. namespaced attributesid
andclasses
would not be considered after this change.(Honestly speaking, I am not sure whether there is a sensible namespace for these?
html
? So maybe a second lookup forQualName::new(None, ns!(html), "id")
would suffice?)((I added
once_cell
as a direct dependency but it already was part of the dependency closure.))