Skip to content

Commit

Permalink
Refactor some more
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Oct 24, 2023
1 parent a9f0c04 commit 6d1e64d
Show file tree
Hide file tree
Showing 13 changed files with 89 additions and 126 deletions.
4 changes: 2 additions & 2 deletions docs/blog/v2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,13 @@ We’re grateful for these contributions and all those individual insights,
but over the years it did result in some inconsistencies and duplicated content.

For version 2, we rewrote our docs from beginning to end to tell a consistent
story for new users, folks wanting to do complex AST and compiler stuff, and
story for new users, folks that do complex AST and compiler stuff, and
anyone in between.

We also made a new website.
Its built on MDX of course, [unified][] itself, and [React Server Components
(RSC)][rsc].
While we have to dogfood the former two as theyre projects we maintain, and the
While we dogfood the former two as theyre projects we maintain, and the
latter is extremely experimental, we think compiling things ahead of time and
betting on hybrid models, compared to completely server-side sites or completely
client-side apps, is the smart choice for us and the webs future.
Expand Down
2 changes: 1 addition & 1 deletion docs/community/sponsor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This article explains how to contribute financially to MDX.
It’s possible to support us financially by becoming a backer or sponsor of
unified through either [Open Collective][oc] or [GitHub Sponsors][gh].
With this support, we can pay for project leadership, finance non-coding work,
or to do fun things for the community like getting stickers for contributors.
or for fun things for the community like getting stickers for contributors.
You’ll be helping unified’s maintainers manage and improve existing projects,
and additionally support our work to develop new and exciting projects, such
as [micromark][].
Expand Down
2 changes: 1 addition & 1 deletion docs/community/support.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Here are some tips:
* Don’t fall for the [XY problem][xy]
* Search to find out if a similar question has been asked
* Try to define what you need help with:
* Is there something in particular you want to do?
* Is there something in particular you want?
* What problem are you encountering and what steps have you taken to try
and fix it?
* Is there a concept you don’t understand?
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Now you’ve set up an integration or `@mdx-js/mdx` itself,
it’s time to configure your JSX runtime.

* if you use **React**,
you don’t need to do anything;
that’s the default;
optionally install and configure [`@mdx-js/react`][mdx-react]
* if you use **Preact**,
set [`jsxImportSource` in `ProcessorOptions`][api-processor-options] to
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/troubleshooting-mdx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ one short-term solution is to use a bundler to make a CJS version.

## Problems using MDX

Problems that occur when using MDX typically have to do with the APIs of
Problems that occur when using MDX typically relate to the APIs of
[our packages](/packages/) and how to use them.
Please see the documentation of the packages, functions, and options you are
using for more info and examples.
Expand Down Expand Up @@ -215,7 +215,7 @@ Likely set to `import.meta.url` (or `window.location.href`).

## Problems writing MDX

Problems that occur when writing MDX typically have to do with how to combine
Problems that occur when writing MDX typically have relate to how to combine
JS(X) and markdown.
It’s an odd mix of two languages: markdown is **whitespace sensitive** and
**forgiving** (what you type may not exactly work but it won’t crash) whereas
Expand Down
11 changes: 3 additions & 8 deletions docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,11 @@ You’re using React, Preact, or Vue.
during the build stage
</div>

{/* To do: quotes. */}

> It’s extremely useful for using design system components to render markdown
> and weaving interactive components in with existing markdown.
> lol mdx is so good
>
> [**@chrisbiscardi**][quote]
{/* [v3]: /blog/v3/ */}
> [**@dan\_abramov**][quote]
[quote]: https://twitter.com/chrisbiscardi/status/1022304288326864896
[quote]: https://twitter.com/dan_abramov/status/1286411354996449281

[what]: /docs/what-is-mdx/

Expand Down
2 changes: 1 addition & 1 deletion docs/migrating/v2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ We turned off GFM features in MDX by default.
GFM extends CommonMark to add autolink literals, footnotes, strikethrough,
tables, and task lists.
If you do want these features, you can use a plugin.
How to do so is described in [our guide on GFM][guide-gfm].
See [our guide on GFM][guide-gfm].

## Update MDX content

Expand Down
143 changes: 55 additions & 88 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/loader/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function loader(value, callback) {
/* c8 ignore next -- some loaders set `undefined` (see `TypeStrong/ts-loader`). */
const compiler = this._compiler || marker

// To do: next major (MDX 4?): remove.
// To do: next major: remove.
if ('renderer' in config) {
callback(
new Error(
Expand Down
4 changes: 2 additions & 2 deletions packages/mdx/lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
* in most cases `'program'` should be used, it results in a whole program;
* internally `evaluate` uses `'function-body'` to compile to
* code that can be passed to `run`;
* in some cases, you might want to do what `evaluate` does in separate steps
* yourself, such as when compiling on the server and running on the client.
* in some cases, you might want what `evaluate` does in separate steps, such
* as when compiling on the server and running on the client.
* @property {string | null | undefined} [pragma='React.createElement']
* Pragma for JSX, used in the classic runtime as an identifier for function
* calls: `<x />` to `React.createElement('x')` (default:
Expand Down
2 changes: 2 additions & 0 deletions packages/mdx/lib/plugin/recma-document.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,8 @@ export function recmaDocument(options) {
return
}

// To do: add support for `import.meta.resolve`.

if (
node.type === 'MemberExpression' &&
'object' in node &&
Expand Down
Loading

1 comment on commit 6d1e64d

@vercel
Copy link

@vercel vercel bot commented on 6d1e64d Oct 24, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

mdx – ./

v2.mdxjs.com
mdx-git-main-mdx.vercel.app
mdx-mdx.vercel.app
mdxjs.com

Please sign in to comment.