File naming conventions in `convex` directory
Am I correct in believing that files in the
convex
directory must be camel-cased? If so, it would be nice if they didn't have to be.9 Replies
they shouldn't have to be! What are you seeing here, eg an issue with dashes?
Hmm, yeah I was (or thought I was), but if you don't think they need to be let me look into it a bit more to verify that that's the problem (or that there is a problem)!
Does this look familiar at all?
thank you for checking! Yes that looks familiar, I fixed the client-side version of this but the server-side part
@RJ did this path autocomplete? I'd expect it to instead be
mutations/internal/insert_inventory_update
We want these to be valid JavaScript identifiers because we it gives us more options for future API changes, like say const data = mutations.insert_inventory_update.useQuery()
insert-inventory-update
did autocomplete! And the file is kebab-cased, not snake-cased.
I tried insert_inventory_update
instead with useMutation
and it wasn't recognized.
FWIW, I care more about the filename casing than the function (or string argument to useX
function) casing. Also I could imagine that being configurable in convex.json
?
So I guess my takeaway here is that I can't actually use kebab-casing for Convex functions at the moment? Does that sound correct?
I see this is happening for a file in my Convex directory that just contains a single type, as well:
I guess that's not surprising, given what you explained to me earlier today about how Convex bundling works.FWIW, I care more about the filename casing than the function (or string argument to useX function) casing. Also I could imagine that being configurable in convex.json?Could you say more, "care more" as in you'd like to be allowed to use kebab case but don't mind if we modify it in the strings? That's the intended behavior, sounds like we have a bug here.
So I guess my takeaway here is that I can't actually use kebab-casing for Convex functions at the moment? Does that sound correct?That sounds right, we need to fix this.
Right yes, that's exactly what I mean!
I guess I meant "I care more about having the power to determine the filename casing vs the function etc. casing"
Ok, gotcha! I've just reverted the changes I had made to kebab-case my
convex
dir and everything is working fine again, so I'm not blocked (just slightly aesthetically saddened)
Thanks again for your help!we've got you, @lee likes dashes in filenames too
dashes are good
This would still be nice to have!
š
I tested this again recently and see that Convex filenames still can't be kebab-cased, but FWIW I'd still ā¤ļø it if they were! The error message is nice and descriptive now, though.