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 generic props structs #2746

Merged
merged 3 commits into from Jun 23, 2022
Merged

Conversation

WorldSEnder
Copy link
Member

Description

Fixup of #2729 for generic property structs. I mistakenly converted the checks guarded by if false to a const _: () check, which makes generic arguments from the context invisible, leading to the problem

This also for some reason changes the order in which errors are reported with trybuild.

Checklist

  • I have reviewed my own code
  • I have added tests

github-actions[bot]
github-actions bot previously approved these changes Jun 22, 2022
@github-actions
Copy link

github-actions bot commented Jun 22, 2022

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

https://yew-rs-api--pr2746-prop-inheritance-zq5xlke7.web.app

(expires Wed, 29 Jun 2022 20:30:53 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@WorldSEnder
Copy link
Member Author

WorldSEnder commented Jun 22, 2022

@maurerdietmar if you have time to check, I think this fixes your issue.

@hamza1311 aha! the issue with time updating its msrv to 1.57 actually also means wasm-bindgen-cli doesn't build on 1.56. I suppose bumping is a work-around, otherwise we could also install that always built with the stable version.

@github-actions
Copy link

github-actions bot commented Jun 22, 2022

Size Comparison

examples master (KB) pull request (KB) diff (KB) diff (%)
boids 172.581 172.581 0 0.000%
contexts 109.618 109.618 0 0.000%
counter 86.551 86.551 0 0.000%
counter_functional 87.200 87.200 0 0.000%
dyn_create_destroy_apps 89.692 89.692 0 0.000%
file_upload 102.623 102.623 0 0.000%
function_memory_game 166.885 166.885 0 0.000%
function_router 351.672 351.672 0 0.000%
function_todomvc 161.559 161.559 0 0.000%
futures 226.233 226.233 0 0.000%
game_of_life 107.214 107.214 0 0.000%
inner_html 83.617 83.617 0 0.000%
js_callback 112.844 112.844 0 0.000%
keyed_list 195.104 195.104 0 0.000%
mount_point 86.181 86.181 0 0.000%
nested_list 115.691 115.691 0 0.000%
node_refs 93.596 93.596 0 0.000%
password_strength 1538.154 1538.154 0 0.000%
portals 97.225 97.225 0 0.000%
router 320.455 320.455 0 0.000%
simple_ssr 154.493 154.493 0 0.000%
ssr_router 398.015 398.015 0 0.000%
suspense 110.486 110.486 0 0.000%
timer 89.258 89.258 0 0.000%
todomvc 142.615 142.615 0 0.000%
two_apps 87.157 87.157 0 0.000%
web_worker_fib 153.404 153.404 0 0.000%
webgl 87.439 87.439 0 0.000%

✅ None of the examples has changed their size significantly.

Copy link
Member

@hamza1311 hamza1311 left a comment

Choose a reason for hiding this comment

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

Looks good

The comments are unrelated to this PR but should be resolved (in a future PR). I must've missed the output spans while reviewing the previous one

--> tests/html_macro/component-fail.rs:94:10
|
94 | <Child ..ChildProperties { string: "hello".to_owned(), int: 5 }>
| ^^^^^ unknown field
Copy link
Member

Choose a reason for hiding this comment

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

This is a bad span. Can we do better?

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree in principle, but don't want to block this PR with this. The errors were like this before, even before #2729 . This PR only affects the order in which errors are reported, since they emit from a non-const context again. Don't ask me why that changes the order of error reporting though, idk :)

Note that this bad span is only for field children. Not sure what's a better span here.

Comment on lines +27 to +28
27 | html! { <Comp<MissingTypeBounds> /> };
| ^^^^ the trait `yew::BaseComponent` is not implemented for `Comp<MissingTypeBounds>`
Copy link
Member

Choose a reason for hiding this comment

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

Span should reference MissingTypeBounds here

@maurerdietmar
Copy link
Contributor

@maurerdietmar if you have time to check, I think this fixes your issue.

Yes, this fixes my issue.

@WorldSEnder WorldSEnder merged commit cda74c4 into yewstack:master Jun 23, 2022
@WorldSEnder WorldSEnder deleted the prop-inheritance branch June 23, 2022 09:21
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.

None yet

3 participants