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

Loader renderer option #725

Merged
merged 3 commits into from
Aug 13, 2019
Merged

Loader renderer option #725

merged 3 commits into from
Aug 13, 2019

Conversation

axdg
Copy link
Contributor

@axdg axdg commented Aug 9, 2019

This fixes #711

  • adds the prepend to the Webpack loader's options.
  • it removes the inline pragma /* @jsx mdx */ - this is not needed since mdx itself adds this during compilation.
  • add to README to reflect changes.

All changes are completely backwards compatible... this would just allow for other frameworks to be used with the loader.

@vercel
Copy link

vercel bot commented Aug 9, 2019

This pull request is automatically deployed with Now.
To access deployments, click Details below or on the icon next to each push.

Latest deployment for this branch: https://mdx-git-fork-axdg-loader-prepend.mdx.now.sh

Copy link
Member

@johno johno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! This looks good to me, just a couple nits.

Also, I'm going to think a bit on whether there's a clearer name than prepend for a bit.

  • pragma
  • renderer
  • ... 🤔

cc/ @wooorm (you're always good at naming things 😄)

packages/loader/index.js Outdated Show resolved Hide resolved
packages/loader/readme.md Outdated Show resolved Hide resolved
@axdg
Copy link
Contributor Author

axdg commented Aug 9, 2019

@johno, I've made the suggested changes.

I agree that prepend is not a great name for the options... renderer is better, but go with whatever you think works.

@axdg
Copy link
Contributor Author

axdg commented Aug 9, 2019

P.S. I don't like pragma, since this is a little ambiguous (as is the way that the word is used to refer to custom createElement wrappers in the documentation / blog).

From wikipedia:

In computer programming, a directive or pragma (from "pragmatic") is a language construct that specifies how a compiler (or other translator) should process its input.

The pragma in this case would be the directive /* @jsx mdx */, not the actual import / implementation.

@johno
Copy link
Member

johno commented Aug 9, 2019

Yeah, I think I'm liking renderer the most. Let's go with that so it's slightly more specific/descriptive. 🙏

@axdg axdg changed the title Loader prepend Loader renderer option Aug 10, 2019
@axdg
Copy link
Contributor Author

axdg commented Aug 10, 2019

Updated that last commit and the docs (feel free to squash anyway) - renderer seems pretty intuitive to me.

@vercel vercel bot temporarily deployed to staging August 11, 2019 04:30 Inactive
@johno
Copy link
Member

johno commented Aug 13, 2019

Thanks!

@johno johno merged commit b77e294 into mdx-js:master Aug 13, 2019
@wooorm
Copy link
Member

wooorm commented Aug 14, 2019

@johno ah sorry I missed this ping! Render is good!

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

Successfully merging this pull request may close these issues.

None yet

3 participants