Skip to content
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

Merged
merged 20 commits into from Oct 1, 2022

Conversation

angeloashmore
Copy link
Contributor

Documentation / Examples

  • Make sure the linting passes by running pnpm lint
  • The examples guidelines are followed from our contributing doc

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.

@ijjk ijjk added the examples Issue/PR related to examples label Aug 31, 2022
Copy link
Member

@balazsorban44 balazsorban44 left a 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

@angeloashmore
Copy link
Contributor Author

@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?

@balazsorban44
Copy link
Member

@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.

@balazsorban44 balazsorban44 merged commit 3ede313 into vercel:canary Oct 1, 2022
BowlingX pushed a commit to BowlingX/next.js that referenced this pull request Oct 5, 2022
## 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 <info@balazsorban.com>
Kikobeats pushed a commit to Kikobeats/next.js that referenced this pull request Oct 24, 2022
## 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 <info@balazsorban.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
examples Issue/PR related to examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants