170 karma · joined September 7, 2021
It is also more convenient for your own private libraries, but makes not so much of a difference for one-off scripts you maintain alone (unless you are also the type that forgets what you were even doing in that script a few months from now, in which case you could benefit like me). It's about lowering cognitive overhead and chance of development errors in the long run if everything is nicely abstracted.
; ahk v1 code
CapsLock::
KeyWait, CapsLock
If (A_PriorKey="CapsLock")
SetCapsLockState, % GetKeyState("CapsLock","T") ? "Off" : "On"
Return
#If, GetKeyState("CapsLock", "P")
u:: ; convert selection to code in markdown by pressing CapsLock+u
SendRaw, ````
SendInput {Left}
Return
; ...
#If
I also find myself with way too many obscure Mouse button {1|2}, Ctrl, Alt, Capslock, F{1|12}, etc. incantations I never remember and end up opening the script to search them. I thought about adding pie menus based on context but never got to it. Would you mind sharing a minimal example of your right click menu? Sounds much simpler and accessible. The keyboard hook à la vscode chords also seems pretty useful, will definitely implement thatUsing the ORM means I'm tied to this mess of an abstraction, migrations and scripts that require so many workarounds and experimentation to make it worthwhile when your app is not a simple CRUD or you want performance optimizations without ending up writing your own queries yet again. The generated TS API is the only pleasant feature, but doing things the Prisma way I noticed my app is now tied to this ecosystem and its quirks and I dread it. Being unable to check generated queries' SQL beforehand is also a huge issue that is not getting solved any time soon from what I've gathered on their github.
You could also use Prisma as a SQL client and leverage their data proxy, without needing to use the ORM and execute SQL migrations and queries directly, which is what I intend to do from now on. Please do let me know if there are any other generic alternatives database-wise (for "the edge"), I miss raw [Postgre]SQL. Supabase's client is the closest I can think of and it also generates types from your db, but it's obviously not a generic solution.
Lastly, one particular thing that disgusts me (I believe it's not on Prisma but due to how the edge works) is that you cannot use a local database for development. Perhaps ngrok will work, but then you'd need to constantly update your data proxy project settings manually - I need to experiment more on that.
The more time I spent with it the more disappointed I became. The reason why you are forced to write Java and write your own generator alongside the rest of the project is unclear to me. Extending the mustache templates is a pain (and handlebars experimental). Every little change you want to make requires you to change the library itself. Most generators I looked at (TS clients, Go clients and servers, Python clients) generated dubious code and project structures for actual usage.
My current approach to deal with all of this e.g. in Go server generation is to output to some temp directory and have (long) post generation scripts parse the current and generated AST to (1) restructure to my liking, (2) merge changes where appropriate (the generator would overwrite your code otherwise) and (3) generate helper files with Go templates, which are actually pleasant to use. (2) is necessary if you don't want to have generated maps all over the place to access the handler for this route, the middleware for this other one, etc. You won't have to edit generated files, but good luck figuring out what's going on. As long as you clearly state what methods can be edited and which ones are always replaced with the generator output you should be fine with (2).
You may be thinking:
> why do all of this instead of writing your own generator?
to which I answer: Touché.