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

Actually require that action.type must be a string #4543

Closed
markerikson opened this issue May 8, 2023 · 1 comment · Fixed by #4544
Closed

Actually require that action.type must be a string #4543

markerikson opened this issue May 8, 2023 · 1 comment · Fixed by #4544
Milestone

Comments

@markerikson
Copy link
Contributor

Per #4129 (comment) :

we've always said they should be serializable, and ought to be strings.

Someone over on Twitter said they'd once tried to use Symbols to make them truly unique, but tbh slice namespacing gives you like 95% uniqueness anyway, so I don't see that as a reason to continue to allow them. As mentioned above, TS enums can have number values, but again why would you do that? We want them to be readable in the DevTools.

So, given that we've always effectively said they should be strings, we might as well enforce it.

@markerikson markerikson added this to the 5.0 milestone May 8, 2023
@markerikson
Copy link
Contributor Author

We should handle this similar to the "oops, you dispatched something that wasn't a plain object" error, and include the actual value in the error message so that there's an indication of what it was. In fact, let's reuse the miniKindOf logic to give the type and include the actual value if at all possible.

@EskiMojo14 EskiMojo14 linked a pull request May 9, 2023 that will close this issue
6 tasks
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 a pull request may close this issue.

2 participants