[ReactReduxSpa] no completion for action type string literals? #1184

Closed
opened 2025-08-09 17:19:11 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @grantbowering on 12/13/2016

The redux-typed approach was taken out in 9b048c5, and I'm trying to switch our in-development code base over to the "new" suggested way of doing things...

At first look, the spreading around of the magic-valueish type strings knee-jerks me against it somewhat, and one can't (currently, at least, and there are some technical challenges in adding it that might mean never, certainly not priority) use an imported const string as a string literal type to take that pain away... but using KnownActions, one does get compiler-enforcement that you type correct values, so I could certainly shake that off and get used to it...

The problem is that there's no auto-completion suggestions for these values in the IDE (not VSCode, nor VS2015u3, nor VS2017RC).
Which surprises me, since it knows exactly what the only acceptable values are and highlights any other value immediately as an error, listing the (at least, first several before trailing off) values you could provide... but you still have to type them all the way out yourself, which seems odd, and kind of a drag:

2016-12-13 11_25_40-aspnetcoresample - microsoft visual studio administrator
2016-12-13 11_26_08-aspnetcoresample - microsoft visual studio administrator

I'm going to open a ticket with typescript for this as well, since it seems like a ts intellisense oversight, but I'm wondering, is this the way the generator will probably stay for a while, or are there other thoughts (based on TS2.1 features maybe) that it might shift to in the near future?

*Originally created by @grantbowering on 12/13/2016* The redux-typed approach was taken out in 9b048c5, and I'm trying to switch our in-development code base over to the "new" suggested way of doing things... At first look, the spreading around of the magic-valueish type strings knee-jerks me against it somewhat, and one can't (currently, at least, and there are some technical challenges in adding it that might mean never, certainly not priority) use an imported const string as a string literal type to take that pain away... but using KnownActions, one does get compiler-enforcement that you type correct values, so I could certainly shake that off and get used to it... The problem is that there's no auto-completion suggestions for these values in the IDE (not VSCode, nor VS2015u3, nor VS2017RC). Which surprises me, since it knows exactly what the only acceptable values are and highlights any other value immediately as an error, listing the (at least, first several before trailing off) values you could provide... but you still have to type them all the way out yourself, which seems odd, and kind of a drag: ![2016-12-13 11_25_40-aspnetcoresample - microsoft visual studio administrator](https://cloud.githubusercontent.com/assets/2152220/21154359/6153d334-c12b-11e6-821a-d8dc7ee0d076.png) ![2016-12-13 11_26_08-aspnetcoresample - microsoft visual studio administrator](https://cloud.githubusercontent.com/assets/2152220/21154367/649f5b12-c12b-11e6-996b-5d5625f6eaa0.png) I'm going to open a ticket with typescript for this as well, since it seems like a ts intellisense oversight, but I'm wondering, is this the way the generator will probably stay for a while, or are there other thoughts (based on TS2.1 features maybe) that it might shift to in the near future?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#1184
No description provided.