Consider removing the default implementation of the Worker trait's 'name_of_resource' function #3224
thepackett
started this conversation in
Ideas
Replies: 1 comment
-
This will be removed after #2773 which will migrate to the newer gloo-worker API. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Very simple feature request, the title largely says it all.
The current default implementation of the Worker trait's 'name_of_resource' function simply returns 'main.js'.
Since it is extremely unlikely that a worker's required resource file happens to be called main.js, and since there is no other sensible default, I would propose to remove the default implementation and thus require the function to be implemented manually.
This has the benefit of bringing it to a user's attention when implementing the Worker trait as something that requires attention, rather than sweeping it under the rug and almost guaranteeing and bug down the line.
I would expect this to change to make the api a bit more clear, especially for people learning to use yew like myself.
I also doubt that many projects use the current default implementation, but I may be mistaken.
Beta Was this translation helpful? Give feedback.
All reactions