Skip to content

Conversation

@codebender828
Copy link
Contributor

@codebender828 codebender828 commented Apr 11, 2020

  • Implements component context with MDXProvider component
  • Creates defaults for wrapper and inlineCode component
  • Added createElement function to vue package

Example: https://mdx-vue.now.sh/

Sadly I wasn't able get the tests to run for the vue-loader package.

@vercel
Copy link

vercel bot commented Apr 11, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/mdx/mdx/gees4z27n
✅ Preview: https://mdx-git-fork-codebender828-dev-vue.mdx.now.sh

@vercel vercel bot temporarily deployed to Preview April 11, 2020 12:02 Inactive
@vercel vercel bot temporarily deployed to Preview April 11, 2020 12:10 Inactive
@vercel vercel bot temporarily deployed to Preview April 11, 2020 12:36 Inactive
@codebender828 codebender828 changed the title feat(vue): implemented context for vue @mdx-js/vue: context, createElement and mdx-js/vue-loader Apr 11, 2020
const module = stats.toJson().modules.find(m => m.name === fileName)
.source
resolve(module)
if (stats.hasErrors()) reject(new Error(stats.toJson().errors))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I ended up not running this because it was a little confusing to get webpack to obey me. I kept getting some fs.join errors that were beyond my current ability to quickly debug. so I skipped the test assertion below.

Well it wasn't running before so... 😅 Happy to get contributions toward this!

@@ -1,105 +0,0 @@
function toVueJSX(node, parentNode = {}, options = {}) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I deleted these files because they weren't being utilized. 🙏🏽 Please let me know if you think I should keep them. I figured we could recover them with git.

@@ -0,0 +1,57 @@
const components = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the a test utility file being consumed by the mdx-provider.test.js file

Copy link
Member

@ChristopherBiscardi ChristopherBiscardi left a comment

Choose a reason for hiding this comment

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

Awesome! Thanks so much for moving this forward!

I still have to take this and run it locally. From a cursory overview it seems reasonable though. We should try to get those tests running that aren't currently. I have some webpack experience so I can take a look at the join issue.

const webpack = require('webpack')
const MemoryFs = require('memory-fs')
const {VueJSXCompiler} = require('@mdx-js/vue')
const {createFsFromVolume, Volume} = require('memfs')

Choose a reason for hiding this comment

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

ah nice, I missed that memory-fs was deprecated.

@codebender828
Copy link
Contributor Author

Thanks for the review. I'll also look into getting @vue/test-utils to run

@johno johno added 🦋 type/enhancement This is great to have 🧒 semver/minor This is backwards-compatible change labels Apr 23, 2020
@vercel vercel bot temporarily deployed to Preview April 23, 2020 21:59 Inactive
@ChristopherBiscardi
Copy link
Member

instead of force-pushing over this PR, I made some necessary changes to test infra, etc and continued the work in #1029

@codebender828
Copy link
Contributor Author

Noted 👍

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

Labels

🧒 semver/minor This is backwards-compatible change 🦋 type/enhancement This is great to have

Development

Successfully merging this pull request may close these issues.

3 participants