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

next-contentlayer: BREAKING Change withContentlayer API and introduce createContentlayerPlugin #140

Closed
schickling opened this issue Mar 9, 2022 · 1 comment

Comments

@schickling
Copy link
Collaborator

schickling commented Mar 9, 2022

Given many users are intuitively using the withContentlayer API "directly" as a Next.js plugin as opposed to "calling it" before using, I'm proposing to change the withContentlayer API to the following:

Before

import { withContentlayer } from 'next-contentlayer'

//                             ▼▼
export default withContentlayer()({
  // Your Next.js config...
})

After

import { withContentlayer } from 'next-contentlayer'

//                            ▼▼▼ no additional `()` needed
export default withContentlayer({
  // Your Next.js config...
})

Additionally there will also be a createContentlayerPlugin API which allows for providing some non-default Contentlayer configuration options:

import { createContentlayerPlugin } from 'next-contentlayer'

const withContentlayer = createContentlayerPlugin({
  // Additional Contentlayer config options
})

export default withContentlayer({
  // Your Next.js config...
})
@schickling schickling changed the title next-contentlayer: Deprecate withContentlayer in favour of createContentlayerPlugin next-contentlayer: Change withContentlayer API and introduce createContentlayerPlugin Mar 28, 2022
@schickling schickling changed the title next-contentlayer: Change withContentlayer API and introduce createContentlayerPlugin next-contentlayer: BREAKING Change withContentlayer API and introduce createContentlayerPlugin Mar 28, 2022
@schickling schickling added this to the 0.2.0 milestone Mar 28, 2022
schickling added a commit that referenced this issue Mar 28, 2022
@schickling
Copy link
Collaborator Author

This was just released as part of the new 0.2.1 version. 🚀

Feel free to comment in case you're running into any problems or open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant