Closed johnpmayer closed 4 years ago
The nightly feature can be removed from wasm-bindgen, but it seems that use of the proc_macro_hygiene feature in virtual-dom-rs still required nightly
I suppose nightly is still required until https://github.com/rust-lang/rust/issues/54727
https://github.com/chinedufn/percy/compare/master...johnpmayer:master
Proof concept that the code can be built on stable when the macro is taken out. It seems that there are two bits where the macro is used in virtual-dom-rs:
The test code could be moved, but I wouldn't seriously propose conditionally excluding stuff from the prelude on the stable branch.
Would you be open to a PR that decomposed this codebase into a virtual-dom-algo which pulled out the diff and patch algorithms and tested them without use of the procedural macro?
Thanks so much for looking into this!
There are of course multiple ways to go about this ... but I do like splitting out a crate for the virtual dom algorithm since over time we want people to be able to easily grab just that piece to go off and do whatever they please (i.e. in the future the algorithm takes in trait objects instead of VirtualNode
.)
So this sounds great - but heads up that a few chapters in the Internal Design
chapter of the book reference the code so might need to change a couple of links.
A quick grep or whatever for virtual-dom-rs
in the book/src
directory should do the trick.
--
Excited for better stable support!
Out of curiosity - what prompted you to notice and want this? Just so that myself and anyone reading this issue gains a better understanding of how the libraries are being used / considered!
Regarding my motivations:
At this moment I'm actually looking at https://github.com/fitzgen/dodrio
Meta point - I am not aware of a centralized review of all of the existing virtual dom implementations (there are a handful) and the trade-offs between them. In addition to Percy, the Yew and Squark frameworks also have their own virtual dom implementations. I have not done any deep investigation to see whether any particular implementation merits more attention than others. I can imagine that there are a handful mutually-incompatible of technical choices between the various implementations which would make one library more fit for purpose than another for different workloads; though in the absence of such differences it may be economical to all use a common implementation.
Here's another use case: I'd like to move https://github.com/threema-ch/compose-area over to stable. I think all dependencies are compatible with stable, but virtual-node
(through virtual-dom-rs
) enables the nightly
feature on wasm-bindgen
.
@dbrgn virtual-dom-rs = "0.6.12"
should work on stable - let me know if there are any issues!
https://github.com/chinedufn/percy/commit/1b5d8aa70defdda58a135fe2b5f99a8d99f55b56
This is despite https://github.com/rustwasm/wasm-bindgen/issues/1283
I think that the requirement can be removed from https://github.com/chinedufn/percy/blob/master/crates/virtual-node/Cargo.toml
I'll give this a shot locally and open a PR if it's working