markdown-component-loader icon indicating copy to clipboard operation
markdown-component-loader copied to clipboard

Maybe extract mdx-to-jsx compiler into separate module?

Open davidtheclark opened this issue 8 years ago • 6 comments

👋 Thanks for publishing this module!

I think the core functionality here of compiling Markdown-with-JSX to pure JSX has a broader range of uses than just this Webpack loader. I have a few other experiments I'd like to try it in. Do you have any interest in extracting that logic to another module?

(If so, I'd be interested in helping out!)

davidtheclark avatar Jun 11 '17 17:06 davidtheclark

Hi David,

I think that totally makes sense! If I were to do this again I think I’d break it up a bit more.

I’d be interested in breaking it up! I’m not sure what the best way to do so would be. Possibly two PRs, one which cuts this down to the processing logic and gets published to this repo (which is then moved!), and another which gets published to a new repo under this name which wraps the other as a Markdown loader.

That said, I know I still need to land #8, and splitting this up seems like it’ll wreak havoc when it comes to merging that. I might have another look at what’s left to fix on that soon.

If you wanted to take a look at one or both of those new PRs, I can help orchestrate the move! :)

ticky avatar Jun 11 '17 18:06 ticky

I'd love to help with both creating a new repo/package and updating this one to use it. Your 2 PR plan sounds right to me.

Regarding #8 ... we could merge it first or just port those changes to the new repo, whatever you prefer. I'll take a look at it and chime in over there.

davidtheclark avatar Jun 11 '17 18:06 davidtheclark

@tricky: To get a headstart on understanding the issues I started https://github.com/davidtheclark/md-jsx-transform. I found that as long as I kept delimiters around all expressions, the code could stay very simple. (Even {{|}} seemed to work smoothly, with the help of balanced-match.)

If you have the time and interest, would you mind looking at that implementation and seeing if you think it's missing anything vital that you've discovered in working this module? I understand the delimiter requirement might bug you, but I wonder if the simplicity of the code makes up for that? Curious what you think 🤔

davidtheclark avatar Jun 12 '17 01:06 davidtheclark

@davidtheclark hi, I don’t seem to be able to see anything at that URL? Is it private?

ticky avatar Jun 23 '17 22:06 ticky

@tricky: I gave the project a more stupid name for kicks and moved it into my company's org https://github.com/mapbox/jsxtreme-markdown. Also a Webpack loader and a Babel plugin that utilize it. Been working on it for immediate workplace needs 😬

davidtheclark avatar Jun 23 '17 22:06 davidtheclark

I’ve made some progress on this in #8, the processing functionality is its own separate file from the Webpack interop. I plan to split it up altogether eventually.

ticky avatar Sep 21 '17 22:09 ticky