-
-
Notifications
You must be signed in to change notification settings - Fork 212
feat: parseAsTuple #1036
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
base: next
Are you sure you want to change the base?
feat: parseAsTuple #1036
Conversation
@I-3B is attempting to deploy a commit to the 47ng Team on Vercel. A member of the Team first needs to authorize it. |
@franky47 can you please check the interface design? if it looks good I'll proceed with tests. |
The overall design looks good, but we're blowing up the size limit budget. I need to do some shrinking of the bundle size before we can add any more features in the package (ideally I'd like to keep it under 5kB but that might be tricky to maintain). |
I see |
Hey, coming back to this PR, I'm considering adding support in the nuqs docs for the shadcn CLI, to install custom parsers with a one-line command. Would you mind if we moved this parser to the community section, and have it installable this way? I'd like to keep the core bundle size small, and this could be one way. |
of course, would you like me to assist with that? |
That would be great, thanks! I haven't looked too deep into the CLI docs yet, but I saw Shadcn released a v3 that includes namespaces. From what I understand it could give us nice install commands like: $ npx shadcn add @nuqs/parsers/parseAsTuple
# or even shorter (at the risk of feature mixup):
$ npx shadcn add @nuqs/parseAsTuple However it would require declaring that namespace and point it to our registry in the components.json config, so that's an extra step. We could go for plain URLs too: $ npx shadcn add https://nuqs.47ng.com/parsers/parseAsTuple What do you think? |
the first command looks nicer for sure, but i don't think there's a real UX difference, as users will most likely copy-paste it from docs either ways so i think it just depends on how much of a pain it's to maintain the registry (which i'm not knowledgeable enough about) |
Yeah I'd expect a single copy-paste to be enough to get started, but if you need to declare the registry first, that's an extra step that might defeat the purpose of using this CLI. TBC. |
okay, but how would it work, let's say user executes this: npx shadcn add https://nuqs.47ng.com/parsers/parseAsTuple would this add a components/nuqs/parseAsTuple.ts file that people can import into their project directly? |
We can now have trusted namespaced registries, see #1118. This is one of the reasons I migrated to nuqs.dev this weekend, so we can have a nice URL as a base. |
I think this PR will be on hold till the registry is setup and merged? as this will need:
|
closes #1022