Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for custom pragma #9

Open
daniel-ac-martin opened this issue May 23, 2022 · 3 comments
Open

Support for custom pragma #9

daniel-ac-martin opened this issue May 23, 2022 · 3 comments

Comments

@daniel-ac-martin
Copy link

daniel-ac-martin commented May 23, 2022

I'm trying to migrate to this package and away from using mdx-loader (v1) with createDocsCompiler.

My repo uses a custom pragma for React so that JSX elements are compiled to h(Component, props) rather than React.createElement(Component, props). With the previous set-up this was fine as long as I used my babel loader after mds-loader.

However that is not the case with this package. The culprit seems to be the DEFAULT_RENDERER that is defined in loader.js.

I'd suggest that the loader take some new options to allow configuration of this. It should be possible to mirror mdx-loader. i.e:

  • options.pragma (default: React.createElement)
  • options.pragmaImportSource (default: react)

(Aside, does allowing the configuration of the source have any value?)

See: https://mdxjs.com/packages/mdx/#optionspragma

@daniel-ac-martin
Copy link
Author

@shilman: Any thoughts on this?

@shilman
Copy link
Member

shilman commented Jun 2, 2022

Sorry for the slow reply. That sounds likely a reasonable feature request. Any chance you can create a PR for this?

@daniel-ac-martin
Copy link
Author

@shilman: I've already raised #10.
(But it looks like you've seen that now. :-) )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants