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

Rename Apollo Redux actions to be namespaced #210

Closed
stubailo opened this issue May 12, 2016 · 16 comments
Closed

Rename Apollo Redux actions to be namespaced #210

stubailo opened this issue May 12, 2016 · 16 comments
Assignees

Comments

@stubailo
Copy link
Contributor

Right now our actions are called stuff like QUERY_RESULT, etc. That might result in a collision with actions someone might already have in their app. We might want to namespace our actions with a prefix that contains the name APOLLO, which will make collisions basically impossible.

@stubailo
Copy link
Contributor Author

We might want to loop this in with a different breaking change since it doesn't seem to be worth a minor version bump on its own.

@stubailo stubailo mentioned this issue May 12, 2016
2 tasks
@johnthepink
Copy link
Contributor

I totally agree. We should namespace.

@stubailo stubailo changed the title Should we namespace Apollo Redux actions? Rename Apollo Redux actions to be namespaced May 12, 2016
@abhiaiyer91
Copy link
Contributor

APOLLO_* sounds good?

@stubailo
Copy link
Contributor Author

Guess we're going with APOLLO_!

@abhiaiyer91
Copy link
Contributor

ALRIGHT, assign to me? I got you

@abhiaiyer91 abhiaiyer91 self-assigned this May 12, 2016
@MasterJames
Copy link

Is a global APOLLO with things like APOLLO.* worth consideration?
I thought if you import apollo it's done this way for you.
Sorry and disregard if junior question.

@abhiaiyer91
Copy link
Contributor

These action types aren't really for consumers. They're part of the internal api for the client.

@stubailo
Copy link
Contributor Author

@MasterJames this is about namespacing Redux action types, which are just strings, and don't have a standard namespacing schemes.

@stubailo
Copy link
Contributor Author

@abhiaiyer91 do you think we should consider this a breaking change? We didn't really document the action names before, so maybe it isn't? Hard to say.

@abhiaiyer91
Copy link
Contributor

Its not breaking to any users. Unless people are relying on these action types in their apps? @jbaxleyiii do you guys?

@stubailo
Copy link
Contributor Author

Yeah if they don't then it's probably fine

@jbaxleyiii
Copy link
Contributor

@stubailo @abhiaiyer91 we don't!

@stubailo
Copy link
Contributor Author

Alright abhi go for it!

@MasterJames
Copy link

Food for thought but probably not related enough to reconsider dotting at least.
reduxjs/redux#786
Call me old fashioned but I would just use a dictionary in an apollo global namespace for action strings if not the vales themselves directly. Maybe if it was a subscription the server could provide the variation desired and discussed in the thread. Object merge overwriting raw js is also is a kind of hotcode logic I've been exploring lately but I guess it's not directly related here either.
Thanks for listening between the lines and thinking beyond the limits of convention.

@abhiaiyer91 abhiaiyer91 mentioned this issue May 16, 2016
4 tasks
@abhiaiyer91
Copy link
Contributor

Done!

@stubailo
Copy link
Contributor Author

Thanks @abhiaiyer91! Great work.

jbaxleyiii pushed a commit that referenced this issue Oct 18, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants