Skip to content
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

Allow unquoted text in view macro #833

Closed
wxyer opened this issue Apr 8, 2023 · 5 comments
Closed

Allow unquoted text in view macro #833

wxyer opened this issue Apr 8, 2023 · 5 comments
Labels
enhancement New feature or request future

Comments

@wxyer
Copy link

wxyer commented Apr 8, 2023

i think the feature is very convenient,is this nightly rust give or the framework give

@gbj gbj added the enhancement New feature or request label Apr 8, 2023
@gbj
Copy link
Collaborator

gbj commented Apr 8, 2023

Here’s a tracking issue for unquoted text in syn-rsx, which is the underlying library we use for parsing the view macro.

I’ll say that while there are benefits there are also drawbacks to unquoted text in JSX-like syntaxes:

  • would probably break rust-analyzer syntax highlighting
  • can be unpredictable exactly what white space will end up being used
  • would bifurcate the ecosystem unless we require nightly, which I don’t plan to do

@gbj gbj changed the title nightly rust does not require quotes around text nodes like percy Allow unquoted text in view macro Apr 8, 2023
@wxyer
Copy link
Author

wxyer commented Apr 11, 2023

thank you ,i expect it very much

@brahimABD98
Copy link

brahimABD98 commented Apr 13, 2023

quoted text can have benefits ,for me personally because of quoted text am able to write stuff in Arabic faster without the extra work that's usually needed , maybe if it's possible to keep both

@gbj
Copy link
Collaborator

gbj commented May 11, 2023

Just adding an update to say that we may be able to bring this to Leptos sooner rather than later with the work being done on a fork of syn-rsx.

@gbj
Copy link
Collaborator

gbj commented May 22, 2023

This was added in #1054. Quoted text is still supported as usual, but unquoted text is also supported. Extra whitespace is trimmed, so you may find that you still need quoted text in situations where you need to ensure whitespace is included, and you can still use quoted text in any case.

This is available on both nightly and stable.

@gbj gbj closed this as completed May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request future
Projects
None yet
Development

No branches or pull requests

3 participants