-
Notifications
You must be signed in to change notification settings - Fork 27
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
Reimplement mox
with syn_rsx
#228
Conversation
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! One nit and CI needs to be happy but otherwise I'm happy to merge this.
EDIT: outdated
Codecov Report
@@ Coverage Diff @@
## main #228 +/- ##
==========================================
- Coverage 27.78% 27.74% -0.05%
==========================================
Files 50 49 -1
Lines 11886 11967 +81
Branches 6634 6685 +51
==========================================
+ Hits 3303 3320 +17
- Misses 6391 6417 +26
- Partials 2192 2230 +38
Continue to review full report at Codecov.
|
c2c60cf
to
57664ea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really cool! A bunch of feedback and questions but I like this direction a lot.
e0a28eb
to
a4a70c7
Compare
This comment has been minimized.
This comment has been minimized.
Add rust-analyzer settings.
Some changes to the docs and comments Co-authored-by: Adam Perry <lol@anp.lol>
From the alternative suggestion
a4a70c7
to
2506640
Compare
Add TODO comments referencing issues
25a8f2c
to
e3ec196
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great! Can you apply this patch to update the changelog?
diff --git a/mox/CHANGELOG.md b/mox/CHANGELOG.md
index 99fc8a0..a380754 100644
--- a/mox/CHANGELOG.md
+++ b/mox/CHANGELOG.md
@@ -7,7 +7,26 @@
<!-- categories: Added, Removed, Changed, Deprecated, Fixed, Security -->
-## [0.10.0] - unreleased
+## [0.11.0] - 2021-01-10
+
+### Added
+
+- "Attribute init shorthand" allows pulling an attribute from an identically-named binding in the
+ local scope:
+ ```rust
+ let onclick = |_| { ... };
+ mox!(<button onclick>"click me?"</button>)
+ ```
+- Module-nested tag names: `mox!(<krate::module::tag>"foo"</krate::module::tag>)`.
+- Attributes support single-expression values without braces: `<button disabled=true/>`.
+- XML comments: `mox!(<div> <!-- COMMENT HERE --> </div>)`.
+
+### Changed
+
+- `mox!` invocations are now lexed by the [syn-rsx](https://docs.rs/syn-rsx) crate.
+- Non-tag children have `.into_child()` appended to them.
+
+## [0.10.0] - 2020-07-06
### Removed
Co-authored-by: Adam Perry <lol@anp.lol>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! CI should be happy still, will land once its green.
Current implementation of the
mox
macro usessnax
withproc_macro_hack
crate. This causes rust-analyzer lining errors. For the reason ofsnax
not being regularly supported i recommend to switch to thesyn_rsx
crate, which solves these problems and adds linting for the tags and attributes.mox
crate