-
Notifications
You must be signed in to change notification settings - Fork 34
This library is unmaintained #103
Comments
Hi @jescalan, Would it be possible to document a migration path from this library to next-mdx-remote? I know that this package has often been referenced in the context of writing blogs, so it didn't draw the deepest of nextjs experts... |
The readme for |
The facts that data flows need to be restructured and that there is no "single" path are the very reasons why I believe a migration document would be so valuable. It would provide next-js laymen with an opinionated method to hopefully end up with a supported situation that is just as easy as this library was. If you ask me the |
If you'd be willing we could work on this together and publish it in the readme of both repos. I could ask the dumb questions that I think many people have and we could fill them in together to at least get a document that give people mental models of what belongs where when moving. |
@Luttik sure happy to answer any questions you have through the process - thanks for volunteering to help with this! |
I have opened the draft pull request #104 to discuss this topic. |
I faced webpack errors as mentioned above. And currently there is no workaround except disabling webpack 5. But the only thing that makes me from migrating to |
@thunder-coding This sounds like it's expected based on the initial comment in the issue. I'm sorry that you are having this problem though. Contributions are welcome to either library! |
@thunder-coding could you clarify what you are missing in terms of |
I will be migrating to https://github.com/kentcdodds/mdx-bundler . This seems to be a perfect replacement for my use case. And about the things that I am missing without
|
Just to clarify, creating shared layouts for pages is possible with |
I just wanted to say thanks for creating I was using I'll do some more research before adopting |
@ericclemmons That was/is something that really want too. It seems to fit in the theme at we saw with comparing |
@Luttik - I will tell you that there are a LOT of problems with the pattern that That being said, if it works for your current needs, you are welcome to keep using it. The reason we are not maintaining it anymore at HashiCorp is because its a tool of very limited use, since it does not fit the needs of any remotely large or complex website or app. If your goal is to grow your website at all, you are shooting yourself in the foot by adopting this library, since you will eventually outgrow its capabilities, and you will pay a performance cost along the entire path to that. We are 100% open to contribution on this library, and also open to suggestions for API changes in |
@jescalan I understand, sorry if I was too frank. I'm still exploring the options and try to communicate my thoughts fully in this thread. As I eluded to before Im one of those that don't have the time to follow the frontend trends deeply. Since you stated that the patterns of mdx-enhanced were the issue (I guess that is instead of having the implementation being the issue) do you see the same issues with mdx-bundler? |
@Luttik no, but The main difference is that The only reason IMO to pick up Ultimately though, you should just use what you like, as long as the project you're working for is your own project and not on behalf of a company, and as long as the size and scope of your project is small. If this is the case, the stats don't matter that much, and what really matters if you experimenting with different tools, and learning. |
@jescalan I think that is really valuable info for those who are migrating! Thanks |
@jescalan I have some time again to work on the migration guide. I wonder why the technique for heavy components is only suggested for heavy components. Is it a bad idea to use that approach for áll components (given no namespace issues)? Or is that totally fine? |
Yes, that would be a bad idea - dynamically loaded components are not server rendered and cause slower page performance because of this. I would only resort to this approach if you are having performance or bundle size issues. |
@jescalan Maybe the wrong place for this question (and maybe a dumb question altogether...). But wouldn't bundle-size and runtime performance be unaffected if you apply the trick within import dynamic from 'next/dynamic'
import Test from '../components/test'
const SomeHeavyComponent = dynamic(() => import('SomeHeavyComponent'))
const defaultComponents = {Test}
export function SomePage({mdxSource, components}) {
return <MDXRemote {...mdxSource} components={components} />
}
export async function getStaticProps() {
const source = `---
title: Conditional custom components
---
Some **mdx** text, with a default component <Test name={title}/> and a Heavy component <SomeHeavyComponent />
`
const {content, data} = matter(source)
const componentNames = [
/<SomeHeavyComponent/.test(content) ? 'SomeHeavyComponent' : null,
].filter(Boolean)
const mdxSource = await serialize(content)
const components = {
...defaultComponents,
SomeHeavyComponent: componentNames.includes('SomeHeavyComponent')
? SomeHeavyComponent
: null,
}
return {
props: {
mdxSource,
components,
},
}
} |
Give it a shot and find out! I think you will likely have issues with the dynamic import within |
This might be of interest to those migrating away from I've written a library called next-mdx-builder that is similar to |
Hi friends. I regret to inform you all that this library is no longer actively maintained. We have moved on to using
next-mdx-remote
, which is much faster, fits more use cases, and is more configurable.If anyone would like to volunteer to step up and maintain this library, please respond here. Otherwise, use this at your own risk. It is specifically not compatible with webpack 5, and as soon as next.js defaults to webpack 5 as its native dependency, this library will not work with that version of next.js at all.
The text was updated successfully, but these errors were encountered: