-
Notifications
You must be signed in to change notification settings - Fork 27.3k
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
docs(examples): refresh cms-prismic
example
#40121
docs(examples): refresh cms-prismic
example
#40121
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Could we turn this example into TypeScript? This is preferred as pointed out in our contributing document: https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples
@balazsorban44 Certainly! Out of curiosity, do you have any insight on how non-TypeScript developers use these examples projects? Does using TypeScript in examples pose a challenge to these developers? |
@angeloashmore we believe that everyone should start off with TypeScript. Not only it gives a better developer experience but will catch many bugs before going to production. Types can be stripped away, and it would still be valid TypeScript, as it is just a superset of JavaScript, so developers who do not want TypeScript can just do so after cloning the example. |
## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples) **Note**: `pnpm lint` fails on code unrelated to the changes in this PR. This PR updates the [Prismic](https://prismic.io/) CMS example (`examples/cms-prismic`) to use the latest Prismic libraries, tools, and conventions. - Uses `npx @slicemachine/init` to bootstrap new Prismic accounts and content repositories. - Uses [Slice Machine](https://prismic.io/docs/technologies/slice-machine) to model content. - Uses [Slices](https://prismic.io/docs/technologies/slice) to write post content. - Uses the latest versions of the following packages: - `@prismicio/client` - `@prismicio/helpers` - `@prismicio/react` - `@prismicio/next` - Adds generated TypeScript types for Prismic content. The example remains as a JavaScript codebase (i.e. not TypeScript), but makes use of the types via JSDoc. Co-authored-by: Balázs Orbán <[email protected]>
## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples) **Note**: `pnpm lint` fails on code unrelated to the changes in this PR. This PR updates the [Prismic](https://prismic.io/) CMS example (`examples/cms-prismic`) to use the latest Prismic libraries, tools, and conventions. - Uses `npx @slicemachine/init` to bootstrap new Prismic accounts and content repositories. - Uses [Slice Machine](https://prismic.io/docs/technologies/slice-machine) to model content. - Uses [Slices](https://prismic.io/docs/technologies/slice) to write post content. - Uses the latest versions of the following packages: - `@prismicio/client` - `@prismicio/helpers` - `@prismicio/react` - `@prismicio/next` - Adds generated TypeScript types for Prismic content. The example remains as a JavaScript codebase (i.e. not TypeScript), but makes use of the types via JSDoc. Co-authored-by: Balázs Orbán <[email protected]>
Documentation / Examples
pnpm lint
Note:
pnpm lint
fails on code unrelated to the changes in this PR.This PR updates the Prismic CMS example (
examples/cms-prismic
) to use the latest Prismic libraries, tools, and conventions.Uses
npx @slicemachine/init
to bootstrap new Prismic accounts and content repositories.Uses Slice Machine to model content.
Uses Slices to write post content.
Uses the latest versions of the following packages:
@prismicio/client
@prismicio/helpers
@prismicio/react
@prismicio/next
Adds generated TypeScript types for Prismic content. The example remains as a JavaScript codebase (i.e. not TypeScript), but makes use of the types via JSDoc.