Skip to content

Conversation

@mohe2015
Copy link
Contributor

Description

In rust-analyzer it was not possible to get autocompletion suggestions inside of expression in the html! macro. This change should fix that. The first part is removing usage of the vec! macro as that seemed to hinder autocompletion and the second part is allowing to parse invalid expressions so rust-analyzer gets some output from the macro.

Checklist

  • I have reviewed my own code
  • I have added tests. No, I think this is not testable

@github-actions
Copy link

Size Comparison

Details
examples master (KB) pull request (KB) diff (KB) diff (%)

✅ None of the examples has changed their size significantly.

@github-actions
Copy link

Visit the preview URL for this PR (updated for commit b4185b5):

https://yew-rs-api--pr3829-improve-html-macro-r-kd57veoz.web.app

(expires Sun, 30 Mar 2025 12:31:24 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@github-actions
Copy link

Benchmark - SSR

Yew Master

Details
Benchmark Round Min (ms) Max (ms) Mean (ms) Standard Deviation
Baseline 10 310.534 312.089 310.958 0.573
Hello World 10 517.917 530.502 520.950 3.846
Function Router 10 1613.039 1647.988 1622.170 9.668
Concurrent Task 10 1005.853 1007.201 1006.554 0.397
Many Providers 10 1075.049 1104.422 1088.400 10.447

Pull Request

Details
Benchmark Round Min (ms) Max (ms) Mean (ms) Standard Deviation
Baseline 10 291.024 293.614 291.339 0.800
Hello World 10 489.334 554.961 512.441 20.939
Function Router 10 1605.408 1675.083 1620.642 20.122
Concurrent Task 10 1004.884 1007.057 1006.329 0.709
Many Providers 10 1139.608 1210.778 1167.338 28.674

@Madoshakalaka
Copy link
Member

@its-the-shrimp does this make sense?

@its-the-shrimp
Copy link
Contributor

@its-the-shrimp does this make sense?

Sure does, parsing Rust code for no apparent reason doesn't make too much sense, both from a performance & a DX standpoint, so this is a great change

Copy link
Member

@Madoshakalaka Madoshakalaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTS, thanks for contributing

@Madoshakalaka Madoshakalaka merged commit e5b2cf3 into yewstack:master Mar 25, 2025
24 checks passed
@mohe2015 mohe2015 deleted the improve-html-macro-rust-analyzer-autocompletion branch May 14, 2025 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants