-
Notifications
You must be signed in to change notification settings - Fork 19
1.0 Roadmap #5
Comments
To simplify the documents setup you can maybe opt for something like nextra, It is a really simple setup, and it supports md, mdx out of the box. I tested it today for a new project, and had some documents setup in a matter of minutes. |
Hey, how's it going @ricokahler ? I was about to make a PR to improve types for SanityImage but didn't know the status of this release. |
@OllieJT feel free to PR improvements to the current version! this release is still in an alpha state and won't be production-ready until a month or so (though I am planning on releasing a beta in a few weeks) |
So an update on this, I got overconfident on the previous approach and near the last 20%, it didn't pan out 😅. TL;DR I'm rewriting the GROQ code generator from the ground up. See #149 |
Hi @ricokahler! Is that depending on the rest of the 1.0 work, or would it be as simple as rebuilding and releasing the package? Not super familiar with TS, but let me know if I can help out in any way ✌️ Btw, awesome project! 🙌 |
Installed storybook
Hi @ricokahler! There has been almost a year since last commit. I'm pondering over using this library for my company and would like to know if you still have the intention to continue building this library? |
I think most of the work is going in the renovating, so I wouldn't look at Another solution is sanity-typed-schema-builder, which uses a builder and derived types to accomplish the same thing that codegen is accomplishing here. Shameless plug. To be fair, I think with the new |
Hi @saiichihashimoto - thanks for the lead on a possible alternative! The lag on codegen supporting v3 has made us drag our heels on upgrading our projects.
Can you elaborate on this? What we want codegen for is not the studio itself, since V3 should have us covered there, it's copying the generated .d.ts file into the frontend apps that connect to sanity -- that is the true benefit of generating types. |
I was hoping I could use typescript itself to derive the document types from So:
|
Yes this seems to be an issue of weighing pros and cons, more than anything. It's up to us to decide which compromise we are willing to take. The ideal solution would be to have sanity.io treat TS document typing on the receiving end as a first class issue that should be resolved. With V3, I prefer to use the "sanity way" of defining schemas as I assume (or hope..) that sanity will have us covered there in the future, somehow. For the time being, I can use the old version of sanity-codegen just fine with a few tweaks here and there, and it is much, much better than nothing. Or much better than using another completely different approach to generate schemas first in order to achieve typed documents, I would really prefer to stay away from this, to keep the studio parts as vanilla as possible. Maybe we should start a petition to request first class ts support from sanity directly. ;-) Maybe the maintainer of this project knows more about the future of sanity's TS plans than we do, because it doesn't make sense to invest time in to a feature that will be dropped on us half a year later from sanity eventually. But also, maybe that's just my wishful thinking.. |
Edit May 9th, 2021: This issue now represents the 1.0 roadmap!
There has been a lot of development since the first release of this lib and the next version of this lib has a lot coming. The project will now be divided up into different sub-packages:
@sanity-codegen/schema-codegen
— code generation and extraction for sanity schemas@sanity-codegen/groq-codegen
— code generation and extraction or GROQ queries in code@sanity-codegen/client
— thin wrapper client that augments@sanity/client
for GROQ codegen@sanity-codegen/types
— a separate, no-deps package for shared types@sanity-codegen/cli
— a new CLI powered by oclif@sanity-codegen/jamstack-client
— a specialized client intended for use in jamstack apps. Will include preview mode logicEdit July 12th, 2021: See here 👉 #5 (comment)
✨ Features
Here are a list of features that are slotted for 1.0:
Schema Codegen:
T | null
GROQ Codegen:
Client wrapper:
@sanity/client
,picosanity
) that augment their APIs for use with GROQ codegenJamstack client:
Note: This client is the successor to the current client. You may not need this package if you plan on using sanity-codegen with just the client wrapper
CLI:
📅 Timelines
👋 Help Wanted
If you'd like to beta test the new version of this lib, please reach out to me at [email protected]. I'd love to get this new version in your hands and gather feedback. Right the docs for the new version aren't great so we'd need to connect to get you set up.
Warning the alpha is currently very rough!
The text was updated successfully, but these errors were encountered: