next-mdx-remote

Load MDX content from anywhere

MPL-2.0 License

Downloads
869.3K
Stars
2.7K
Committers
42

Bot releases are visible (Hide)

next-mdx-remote -

Published by jescalan over 3 years ago

Fixes type imports so they work when consumed (#99)

Huge thanks to @BRKalow for this fix!

next-mdx-remote -

Published by jescalan over 3 years ago

Fixes typings for remark plugins (#96)

next-mdx-remote -

Published by jescalan almost 4 years ago

Fixes typing for the MdxRemote.Components type, and fixes a couple dependencies. Thanks to @MatthewCaseres for filing the typescript issue!

Patches

  • Fix component typings: #95
  • Bump ini from 1.3.5 to 1.3.8: #92
  • Bump dot-prop from 4.2.0 to 4.2.1: #93
next-mdx-remote - 2.1.0

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:

  • @devrsi0n for getting the custom provider work started
  • @ynnoj for testing out the custom provider functionality in his project and identifying a bug in the initial implementation!
  • @marcofranssen for updating our react peer dependencies

And a thanks to everyone who participated in the discussion, we appreciate all of your contributions! 🙏

Minor Changes

  • Support custom Providers (#35)
  • Fix peer dependencies to include react 17.0.1 (#91)
next-mdx-remote -

Published by jescalan almost 4 years ago

Fixes typescript definition of the hydrate function by making the options argument optional - see 1404ff5010853999b53dafc78cf90a1ad1a59b91 for details

next-mdx-remote -

Published by jescalan almost 4 years ago

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:

  • @cknitt for adding IE11 compatibility for hydrate
  • @Southclaws for reviewing the types
  • @stevenschmatz for contributing some type defintions
  • @JunichiSugiura for going for a typescript rewrite long ago which prompted this originally
  • @zefexdeveloper for reviewing the typescript rewrite PR and answering some of my questions
  • @brianespinosa for also reviewing the typescript rewrite, submitting his own, and generally being very helpful in responding to issues 🙏🏼

Massive thanks to everyone who was involved, it wouldn't have been the same without you 👏🏼

Commit Log

  • Typescript Type Definitions: #70
  • Update deps: 0b1a71ebb761224878ea250cfcfcb4785d700fae
  • Convert hydrate.js to ES5 for IE11 compatibility (closes #77): 24a6772cda9ed2f8d34dca8bd8bb15d5d0d32311
next-mdx-remote -

Published by jescalan almost 4 years ago

This is a prerelease that adds types to this library. If you are using external types already this may be breaking.

next-mdx-remote -

Published by jescalan almost 4 years ago

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.

Commit Log

  • Update mdxOptions to match mdx-js options update: 96be0b736a73e2491e5eadd7b91a0a2ff1d7a8c5
  • Add blog example: 04122f41dc2cc17bc4c975fc1819371857eec757
  • Update package.json: b044dadd3b1965df239c3ffb92a3c5c9571f57d0
  • Update readme: dfbda447c0aa745e9b5083be0ff657d50f7865bb
  • Wrap rendered output in <div> instead of <span>: 92392591ead016bc65001c379a2aa4476598a22f
  • Bump bl from 4.0.2 to 4.0.3: f812c926b6e9dfacc76e55106ae75d5002289c51
  • Fix api in readme example: e96d89bf350aaf0b2d556ba6e66501dd4bef46cd
  • One more fix: 735fce41793390d8d61b877379a8ae68c92524c5
  • One more fix: 81ef6e226d1caaaace10ebc7adc0cf4f905249db
  • Update react peerDependency to support react v17: 22fc93f597f01d4e33730032b97d869cf6832c85
  • Remove usage of non-existent file: 8c838b5227afa0dfabb55285eceab6bb2dcde284
  • Wording clarity adjustment: 82216bfb24e5e0792a66380707d0707c92688486
  • Merge pull request #31 from ScottAgirs/master: bf8f4cbd432794294d00c03c72a12cdf7747c36f
  • Fix README for frontmatter: 7dc5860bf5c74e0130d21666506d3c648c71aa1b
  • Merge pull request #67 from pbteja1998/fix-readme-for-frontmatter: 258c37ea21b25d1c4d902193c893eb0b36404539
  • Elaborate on renderToString without hydration (fixes #61): 3f1dd186c81d56950dff32542340a4b12c8f6789
  • Merge pull request #69 from lostfictions/patch-1: 1e0711aed12013f2c7a69c37b39ccf087b0c64e4
next-mdx-remote -

Published by jescalan about 4 years ago

⚠️ 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.

Commit Log

  • Fix error in readme example: 16f2d73021ff1356d66015cd6af2be0ad097b88d
  • Add license file: c935c0672bea6cf5fd94139456ec79f653fc70aa
  • Improve function signatures: c9a6a55453913c632223419655ea063d71baaca0
  • Document scope param: 8484c737479e8f0264c3171b4542b3ea923a1bb7
  • Internal update source -> compiledSource: 32a1979015180a43f1bdd41ec2243f93b975cbab
  • Move react and react-dom to peer deps: 5e37821318d8f8a096bd23d897ed7f92481b3c3a
  • Update deps, add missing dep: 8ba807cff50e432bca16b1b52059af9d791954e3
  • Add security note to readme: 00fdcd965ccc776352253e8c3ba5949604d4b03b
next-mdx-remote -

Published by jescalan over 4 years ago

This release fixes a bug in which rehydration was not occurring on client-side page transitions

Minor Changes

  • Update deps, add more tests: a075662884491d1a7c50fd09f1242206600ccfd3
  • Fix bug in readme: c7e5232af3faf88ad0490f6ec8a993803b79fa07
  • Fix hydration not happening on client-side page transition: 37aa56077bef6009c3c96e2f7abbcd72fc159a3c
next-mdx-remote -

Published by jescalan over 4 years ago

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.

Commit Log

  • Fix bug with undefined scope variable: 2324dc6882854b8f2b3c6b7e95c5aa94d046ea2a
next-mdx-remote -

Published by jescalan over 4 years ago

This release adds a couple wonderful new features:

  • Custom data can now be passed into your mdx templates via the scope argument to renderToString
  • Standard html/markdown elements can now be customized via the components argument
  • This library now works in browsers that don't support requestIdleCallback life Safari

Minor Changes

  • Allow the customization of standard markdown elements: #11
  • Add ability to include scoped variables in the mdx: 75226ae5f0f8af210c4daa37e70110a6ee6d48d1
  • Merge pull request #8 from chewnoill/chewy/scoped-variables: 8d3eee44649819b0a20e4d2c07cf6c146881818c
  • Add requestIdleCallback shim: #12

Patches

  • Fix readme typo,: 76c52edd1e50613300a55476823045ca71ce63e1

Credits

Huge thanks to @rafaelalmeidatk and @bogdansoare for helping!

next-mdx-remote -

Published by jescalan over 4 years ago

Options can now be passed to mdx via renderToString

Commit Log

  • Update deps: d372be9d083975320b0adb74a75baa6c8c9feb7e
  • Add linting and remove build artifacts in tests: adf4f9fc84d4f2535ece8cd33e602e6f6f67e189
  • Add the ability to pass in mdx options: #5
  • Add release scripts: 6faf123285f1bf0fdf5384b3f83d160ec220cfad
next-mdx-remote -

Published by jescalan over 4 years ago

This plugin ignores all external babel config files when running its internal mdx transform -- this prevents issues where separate project babel configs interfere with mdx transformation and cause errors.

next-mdx-remote -

Published by jescalan over 4 years ago

This package now reports to webpack that it has no side effects properly so that it will be removed from client bundles if unused.

Patches

  • No side effects 💪: 0e6c00e34545766cdecf34f47ca744fb85c548a9
next-mdx-remote -

Published by jescalan over 4 years ago

This release adds tests and stabilizes the library significantly. This should be ready for initial use!

Commit Log

  • Add tests, fix bugs: 63d26c2b5756644daa6f571070b40e53a88bbd26
  • Add npmignore: c9c3ab90d4c9eaebe379733c0b066341a426dfa4
  • Update test component to normal react pattern: c46ffcdb1c2123f4ab50d01720261702c46a3d33
next-mdx-remote -

Published by jescalan over 4 years ago

Patches

  • Remove es6: 6383da0194d62b4398b3e8b590d1e0354e4b5fea
next-mdx-remote -

Published by jescalan over 4 years ago

Bugfix

next-mdx-remote -

Published by jescalan over 4 years ago

Initial release! This is still currently beta-quality so beware. Also the custom logging feature has not yet been implemented