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

Fix macro hygine issues #2585

Merged
merged 3 commits into from
Apr 6, 2022
Merged

Fix macro hygine issues #2585

merged 3 commits into from
Apr 6, 2022

Conversation

ranile
Copy link
Member

@ranile ranile commented Apr 6, 2022

Description

This PR:

  • Adds #![no_implicit_prelude] in macro tests. This ensures that:
    • We don't use anything we are not supposed to use
    • Traits are called unambiguously
  • Adds #[automatically_derived] and #[doc(hidden)] where missing
  • Replace Span::call_site() with Span::mixed_site()

Fixes #1633

Checklist

  • I have run cargo make pr-flow
  • I have reviewed my own code
  • I have added tests

@ranile ranile added the A-yew-macro Area: The yew-macro crate label Apr 6, 2022
@ranile ranile added this to the v0.20 milestone Apr 6, 2022
@github-actions
Copy link

github-actions bot commented Apr 6, 2022

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

https://yew-rs-api--pr2585-update-macro-tests-3q1yr7my.web.app

(expires Wed, 13 Apr 2022 19:22:00 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@github-actions
Copy link

github-actions bot commented Apr 6, 2022

Size Comparison

examples master (KB) pull request (KB) diff
boids 311.480 311.480 0
contexts 232.229 232.229 0
counter 164.662 164.662 0
dyn_create_destroy_apps 172.883 172.883 0
file_upload 195.104 195.104 0
function_memory_game 349.479 349.479 0
function_router 406.710 406.710 0
function_todomvc 325.426 325.426 0
futures 362.470 362.470 0
game_of_life 207.341 207.341 0
inner_html 156.523 156.523 0
js_callback 172.027 172.027 0
keyed_list 329.191 329.191 0
mount_point 163.830 163.830 0
nested_list 225.504 225.504 0
node_refs 170.931 170.931 0
password_strength 1851.892 1851.892 0
portals 184.419 184.419 0
router 588.177 588.177 0
simple_ssr 577.595 577.595 0
ssr_router 497.569 497.569 0
suspense 221.866 221.866 0
timer 170.516 170.516 0
todomvc 270.867 270.867 0
two_apps 166.136 166.136 0
webgl 170.942 170.942 0

Copy link
Member

@WorldSEnder WorldSEnder left a comment

Choose a reason for hiding this comment

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

Not sure why mixed_site is needed on Token!s, but it can't hurt :)

@ranile
Copy link
Member Author

ranile commented Apr 6, 2022

Not sure why mixed_site is needed on Token!s, but it can't hurt :)

I did a find and replace for call_site()), which should've covered most (if not all cases). It doesn't really matter though

I'm going to merge this. If it causes any problems, we can always revert it

@ranile ranile merged commit 2f3b90c into yewstack:master Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-yew-macro Area: The yew-macro crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve macro hygiene
2 participants