Bot releases are hidden (Show)
Fixes typing for the MdxRemote.Components
type, and fixes a couple dependencies. Thanks to @MatthewCaseres for filing the typescript issue!
Published by BRKalow almost 4 years ago
This release adds support for wrapping the MDX content with custom providers! You can now pass a provider to both renderToString
and hydrate
:
renderToString(source, { provider: { component: MyProvider, props: { my: 'prop' } } });
hydrate(mdxSource, { provider: { component: MyProvider, props: { my: 'prop' } } });
Check out the README section on using providers for more information.
Big thanks to all who contributed to this release, either through direct contributions or testing:
And a thanks to everyone who participated in the discussion, we appreciate all of your contributions! 🙏
This release adds native types for typescript. If you are using existing third party or manually written types, it may cause an issue which is why this is a major release. Otherwise this should be a clean upgrade. This release also adds compatibility with IE11. There are a lot of thanks to give for work and reviews that went into this one:
Massive thanks to everyone who was involved, it wouldn't have been the same without you 👏🏼
Mostly readme and dependency updates, the one potentially significant change here is that the server-rendered output is now wrapped in a <div>
rather than a <span>
- see https://github.com/hashicorp/next-mdx-remote/pull/34 for details.
This was not released as breaking as it should have no impact actual appearance when using hydrate, but it could potentially cause rendering differences if you are not hydrating your content.
⚠️ This is a BREAKING RELEASE and is guaranteed to require manual changes ⚠️
The big change is in the API. Previously, the two main functions were invoked as such:
renderToString(content, components, mdxOptions, scope)
hydrate(source, components)
Now, their signature has changed to move all arguments other than the first into an object, like this:
renderToString(content, { components, mdxOptions, scope })
hydrate(source, { components })
Additional small changes - react and react-dom were moved to peerDependencies
where they belong - this shouldn't be an issue as they are also peer dependencies to nextjs, documentation was improved, and all dependencies in general were updated.
This release fixes a bug in which rehydration was not occurring on client-side page transitions
Bugfix - the bug was caused by not passing in a scope
object to renderToString
, which would produce an error. Scope is optional and this should not have been the case.
This release adds a couple wonderful new features:
scope
argument to renderToString
components
argumentrequestIdleCallback
life SafariHuge thanks to @rafaelalmeidatk and @bogdansoare for helping!
Options can now be passed to mdx via renderToString
This release adds tests and stabilizes the library significantly. This should be ready for initial use!