Replies: 5 comments 7 replies
-
Hey @karlhorky! 👋 A few themes I'm hearing from you (correct me if I repeat these back inaccurately)
A few themes I'll share from my perspective before responding more in depth
Hindsight being 20/20 this feels like it could/should have been made an absolute path instead of a relative path so it would resolve the same anywhere?
Not judging, just observing. More documentation won't help people that don't read documentation in the first place. 😅
As you move from the higher level abstraction to lower level ones for more advanced use cases it does get more complex.
Could you expand what you mean by this?
Unified has a large API surface. If you need help typing your own custom plugins, we have recipes at https://unifiedjs.com/learn/ which offer some best practices for working with the typings, which maintain strong type guarantees.
If you have concrete suggestions on common use cases you see beyond content ideas are welcome!
We have this! https://unifiedjs.com/learn/
I land pretty strongly against example folders like this, they aren't maintained and tested the way they should be, and that can cause more confusion that it can help (see Incorrect documentation is worse than no documentation above)
This is great in theory but doesn't happen in practice (see MDX is Stadium project above) Even when contributions trickle through, they don't necessarily follow the best practices of the project.
This is a good example of why this is challenging.
I interpret this as meaning canary testing.
I still don't know what interop problems you are referring to.
We don't have a marketing team to go SEO chasing.
There is some linking between sites already.
I don't understand this comment.
Unified and all the umbrella projects have a large API surface, just versions doesn't communicate necessarily have enough information to communicate if they are compatible or not. For that finer grained reporting we have TypeScript typings, which report when and where things mismatch.
That is what https://github.com/mdx-js/mdx-analyzer is here for, and it grows in capabilities regularly. (as you are aware regularly contributing issues)
This would be a great thing to raise with the Next team who manage the Next integrations
Contributions to get intelligent search working again are welcome #1776 I don't think the team has the budget or interest in running a full LLM chat bot for the MDX docs (with July 2024 LLM cost and capabilities anyway). |
Beta Was this translation helpful? Give feedback.
-
Thanks for sharing your thoughts! Here are some responses to different parts. There’s a lot. Sometimes duplicated. So I haven’t responsed to everything. Let me know if there’s something I’m missing.
Given that the That MDX 2 release was big. I don’t see MDX change much ever again.
I think this fundamental: MDX is not HTML. It isn’t markdown + HTML. If you want that, use markdown itself Making websites is complex; compilers are complex.
What’s that joke? PEBCAK 😅
Right, reiterating what I said above: how to use Coming back to your earlier “User would like to import the .mdx file in another location. "abc.mp4" cannot be resolved anymore.” Answer that first. You don’t need all these plugins. Write it: import myVideoSource from './some-video.mp4'
<video src={myVideoSource} controls />
I don’t fully understand, can you explain?
I don’t think these use cases are that simple or that they have that much to do with MDX.
This is incredibly hard to keep up to date. I’m betting it costs Vercel tons, millions, to maintain that.
Please raise these issues when you encounter them? I don’t know them.
unifiedjs.com has all the readmes. Still, it’s more than 500 readmes.
I think this makes more sense as a separate issue where you explain what is going on for you.
This sounds like something on top of MDX: I think there’s lots of room above MDX for more site builder like tools.
I’m going to move this to a discussion. There’s lots of room for issues, but issues can be closed at some point. |
Beta Was this translation helpful? Give feedback.
-
Prefix 1: A voice for those without oneI should prefix my responses here with the fact that I'm working since years closely with beginners and mid-level engineers - teaching them how to break into tech and creating material for them (my material also started out terser and more intimidating, which I'm also trying to constantly improve). So my perspectives are based on what I observe as behaviors, tendencies, habits - what will work for new people to an ecosystem, and what will not. Of course, any project can decide that they cannot lower the barriers for any reason, including effort and investment. My motivation is to use my privilege and experience as an experienced engineer to at least try to pave the cowpaths and make things easier for those who don't have a voice - those are not even opening issues because they don't get to that point. Prefix 2: Easy to lose connection to beginners experienceI think in the position of experience, it's all too easy (I would argue, even natural) to lose a connection with the experience of those new to the scene.
I think it's reductive to put it on users and say "you need to just read"/PEBCAK. While I do agree with the general underlying rule, and I also almost daily give similar feedback gently (eg. "did you try reading the error message?"), I think that projects can also do better than this, and make the experience for new generations entering the scene better and simpler than it was for older generations. It does not always need to be about reading, and even when it's about reading, there is nuance. If people aren't reading, then it's not always on the people - it's highly likely that it's unapproachable for some reason - docs are either buried, unclear, too jargony, too simplified, or too long. In interacting with the MDX/remark/rehype/Unified docs, the "buried", "jargony" and "too simplified" points have come up a number of times for me personally, although I'm able to re-read, research, invest time and move past these problems. If they're coming up for me, then that means for beginners, it's unapproachable.
This is maybe an example of what I mean with suggesting things not aligned with the experience of beginners. Code as documentation is a very high barrier, and will not be an option for most. Even experienced mid or senior level developers will not look at the source code for a source for docs. I don't mean to say creating an approachable experience is easy. As I'm sure you're aware, creating consumable docs and software onboarding experiences is an extremely difficult balance: too much, and it's also unapproachable or unmaintainable. In my experience, I do however think that docs projects should tend towards over-explanation and explicitness instead of purity and simplicity. Prefix 3: Cannot invest much time without acceptanceI'm unfortunately constrained in my time to write these long essays, even in the name of improving their experience. Since I'm feeling that my proposals here are not being considered fully / partially accepted (first feeling I get is more like mostly explanation of status quo + declining of the proposal), I feel like making a change here is an uphill battle that I cannot win. Again, this is just my first feeling and the temperature that I get from this thread. So taking all of that into consideration, I'll keep my responses shorter after this, and let this post speak for the words I do not write. In total, I do hope that my thoughtful concerns from experience with beginners can come across and lead to some positive change, even with fewer words. Custom Solutions
I don't think a simple, short video is something that should be considered custom. This was actually the point that I had near the start of the original post above:
I think there are many of these which are being called "custom solutions" which are actually pretty simple use cases of MDX. Examples / Recipes
Ok, well if that's the opinion of the MDX project, then I think it's probably a main irreconcilable difference that will cause such beginner improvements as proposed to not go ahead. I strongly disagree with the "Incorrect docs are worse than no docs" too (probably a controversial opinion). This is having seen how examples - also unmaintained examples (incl. 1st-party, partially-1st-party-maintained examples and 3rd-party examples and blog posts) - can help out beginners in countless ways. All code and learning material that is published has a high likelihood of being broken at some point and should be taken with a grain of salt. New vs Migrating
A bit confused at this one - the point was not about me knowing that MDX v1 had a feature and upgrading/migrating. It was about me (with the "new user hat" on), trying to use a feature which it felt that MDX should have. Since it was mentioned in some buried issues with a workaround which no longer works, the experience was bumpy. I'm thinking about it from first principles: does a new MDX user think that, because it's possible to replace an MDX HTML element written like Irreducible Complexity / Infinite Solution Space
Right, I can't disagree with anything here - the pieces are complex and the whole picture is complex. Same with metaframeworks like Expo, Next.js or any other package that consumes many other packages. The point that I'm trying to make is that users shouldn't need to care about that at the beginning. Even when they are doing something that is a bit more custom than the simple first examples - they don't need to be met with the irreducible complexity of a parser/compiler ecosystem. It could be an easier experience - MDX could be more beginner friendly. There should be some examples of going beyond the simple examples and achieve a bit more.
Time/Money/Effort Required
An alternative if the investment / effort is too high would be to let the examples be only partially maintained. But maybe this is untenable, for example if doesn't fit the quality goals of the MDX project. But yeah, I'm assuming that is probably also a 2nd irreconcilable difference, if the time/money/effort is not there. Existing Initiatives
Amazing, thanks for letting me know about these! I'll look forward to any movement with these.
Also really great, those look like high quality, interesting pieces. I'll keep them bookmarked for myself. Not Specific Enough
There were a number of responses that I wasn't specific enough in my proposals or not illuminating in my examples. I tried to go into as much detail as I could in the amount of time it took me to write, edit and rewrite the essay above. I probably was unable to fully communicate the depth of my experience and what I believe to be a good beginner experience in a specific, detailed way. I'm sure that I will run into problems like this again in the MDX ecosystem, and maybe I will take the time to fully document them again. For now, I'll stick with making small suggestions when I see them, and maybe will come back to this thread in future. |
Beta Was this translation helpful? Give feedback.
-
A friendly reminder you are talking to two accredited university instructors.
Contributions are welcome!
There are high level packages like And as an instructor, you are likely familiar with the concept of competency pathways and skill progressions. Which is why unified has guides, recipes, and a handbook. Happy to discuss improving those docs to better build concepts and ways to better link to help newcomers build that foundational knowledge.
This particular implementation of the idea may be irreconcilable.
But! Don't miss the links to the ways the project is offering examples and recipes which are curated and maintained
Happy for these to continue to expand, and it feels like the commentary around the recipes helping new adopters understand them better aligns with your overall ideal.
It is controversial. When to backtrack, revisit assumptions, and ask questions is a great topic for a CS/Engineering course.
It's fine because beginners don't know how HTML, DOM, or React work so they aren't bothered by how Next/RSC break that model?
Happy to also explore other avenues if essay writing isn't feeling effective.
Nothing wrong with small suggestions either! 🙂 |
Beta Was this translation helpful? Give feedback.
-
I'd like it if we could avoid making this personal or heated here (which I perceive from the "high horse" comment). I'm sorry if my words came across as personally attacking. My intention and point (which I think, still stands):
I'm not trying to call my credentials into consideration here or say that I'm somehow immune to this - I'm trying to say that I may have something new and unconsidered to offer here. @ChristianMurphy If you personally have the feeling that I cannot offer a new perspective because I don't have any knowledge or experience beyond what is already here, then I don't need to pursue these points. Incorrect Docs Have ValueSo I'll expand a bit on this here:
So responding to this, I agree that outdated or broken code / docs can cause people going down wrong paths - and they should know this too, and be cautious and generally skeptical of code that they see (from the start). The value I see in "more code examples, even if it becomes outdated or broken" is that it does offer some perspective / illumination of what approaches have worked in the past (and which may still work today). These examples, blog posts and other material will happen to MDX in the wild anyway - the only difference that I'm proposing is to set up a space with some rules and some small moderation, to try to cultivate such examples in a structured way (probably even more high quality than the existing resources being produced in the wild). But in talking through it, it sounds like it would need a different approach to quality of materials than is acceptable to MDX. There's also no "unloading" here either - the teaching you're describing (or at least, our version of it, which I described in the sub-bullets above) needs to happen before students encounter such docs. Irreducible Complexity / Infinite Solution Space
I think this mostly goes in the direction of the "Irreducible Complexity / Infinite Solution Space" topic. I've tried to explain my perspective on this:
I see it like how users who are not computer scientists can also use a computer and achieve many amazing things with the built-in programs and tools. My point is that projects and libraries and the programming space in general should attempt to be like this experience more - smooth on-ramp, with many chunks and pieces that users can plug together. Going a bit beyond the basics shouldn't require compiler knowledge and the experience can be more helpful for beginners. Although I think there may also be disagreement with what is "custom" and not. I don't think that a Next.js + MDX + Going through these various use cases (even if it's mostly with community support) and documenting them and smoothing out the bumpy bits would be a great help for beginners. Compiler / Parser Material for Experienced UsersThere will always be more experienced users who are looking for compiler / parser knowledge and want to go deeper to https://unifiedjs.com/learn/ and https://github.com/unifiedjs/handbook - btw I think for these users, this ecosystem is very approachable. And from what I've seen, it's better than other compiler/parser ecosystems - more precise and correct and more simply explained. |
Beta Was this translation helpful? Give feedback.
-
Initial checklist
Problem
Let me start with saying MDX and the experience it enables (when properly set up + configured) is great! The simplicity and ease of Markdown with the power, flexibility and interop of React 😍
However, there are not-uncommon cases where users can fall off the happy path / miss the pit of success if going beyond the simple first examples - there's a long tail of complexity and high chance for breakage in moving beyond simple examples.
Let's take
<video>
support an MDX document in Next.js as an example:<video src="abc.mp4">
to an MDX document, knowing already that they can add HTML to MDX - it works! 👍.mdx
file in another location."abc.mp4"
cannot be resolved anymore.rehype-mdx-import-media
, using cmd-F, finds that it supportsvideo[src]
and tries configuring using the example config<video>
, user researches quickly and finds no issues or problems with the<video>
syntax. (at this point, knowledgeable, experienced MDX users would have found the bullets underUsage
, but during my user journey, I did not understand this on the first try). User instead tries out an image in Markdown syntax and it appears to be working.<video>
andrehype-mdx-import-media
, but since there are no issues directly related to this plugin, researches in related ecosystems rehype and MDX. User does not find something directly related to lack of<video>
support, but eventually finds that there may be behavior of MDX which causes it to treat HTML elements differently than Markdown elements.<video>
in MDX syntax and finds the![](abc.mp4)
syntax (which, to be fair, contains the caveat "Depending on your markdown processor,"). This doesn't work out of the box.![](abc.mp4)
syntax support and happens on to@chailotl/remark-videos
, which does help - the error message has now changed toModule parse failed: Unexpected character ''
(to be fair, this is entering Next.js + webpack territory now).mp4
files.Another example would be related to a user trying to include nested MDX content on part of a Next.js page (not a full page with
app/page.mdx
) - this could lead to A)next-mdx-remote
(not fully working with nested MDX), B)mdx-bundler
(working with nested MDX but complicated) and then C) back to@next/mdx
(which does work, but it is undocumented how to do it -await import(...)
).In my personal evaluation, after years on and off in the MDX ecosystem (having also invested more time and energy than I would say is average for a part-time user): this is not an uncommon experience when working with MDX - as soon as needs exceed the basics a bit, I've seen it be common to have a "rabbit hole"-type debugging experience, through complexity and incompatibilities on various levels.
In my personal evaluation, some of the first documentation problems I perceive relate to new user experience are:
A) Happy Path / Pit of Success
Lack of working, blessed, happy-path setup and integration suggestions for use cases beyond simple content
B) Transitive Dependency Web / Many Moving Parts
The complex web of transitive dependencies that extends from MDX to remark/rehype/recma to other unified packages like the
unist-*
packages makes it challenging for a senior engineer to understand, navigate and fix / work around incompatibilities - eg. type errors or runtime incompatibilities with remark/rehype/recma plugins and transitive dependenciesMany of these issues may be perceived by experienced developers or those working in the MDX and related ecosystems as "papercuts" or low-barrier issues, but for beginners, it can lead to hitting walls and even quitting. Even for me as an experienced developer, I often find myself spending a lot of time on something that appears to be a simple problem.
I don't intend this to be a condemnation or negative criticism of the ecosystem or packages or people involved - just trying to surface a report of the UX pitfalls for an (enthusiastic) user in the ecosystem.
Solution
A) Happy Path / Pit of Success
B) Transitive Dependency Web / Many Moving Parts
If this issue or or parts of this issue are accepted, then I'm ok with this becoming the parent "umbrella issue" to track multiple initiatives.
Alternatives
Create additional tooling to avoid the issue, such as:
mdx doctor
which will find common issues like mismatching or duplicated transitive dependencies and other setup problemsBut I think that these alternatives are complex and time-consuming to build and maintain, would not be able to effectively address all issues and would also require docs and outreach to make sure that users actually used them.
Beta Was this translation helpful? Give feedback.
All reactions