Skip to content

Commit 6d1e64d

Browse files
committedOct 24, 2023
Refactor some more
1 parent a9f0c04 commit 6d1e64d

File tree

13 files changed

+89
-126
lines changed

13 files changed

+89
-126
lines changed
 

Diff for: ‎docs/blog/v2.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,13 @@ We’re grateful for these contributions and all those individual insights,
232232
but over the years it did result in some inconsistencies and duplicated content.
233233

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

238238
We also made a new website.
239239
It’s built on MDX of course, [unified][] itself, and [React Server Components
240240
(RSC)][rsc].
241-
While we have to dogfood the former two as they’re projects we maintain, and the
241+
While we dogfood the former two as they’re projects we maintain, and the
242242
latter is extremely experimental, we think compiling things ahead of time and
243243
betting on hybrid models, compared to completely server-side sites or completely
244244
client-side apps, is the smart choice for us and the web’s future.

Diff for: ‎docs/community/sponsor.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This article explains how to contribute financially to MDX.
1616
It’s possible to support us financially by becoming a backer or sponsor of
1717
unified through either [Open Collective][oc] or [GitHub Sponsors][gh].
1818
With this support, we can pay for project leadership, finance non-coding work,
19-
or to do fun things for the community like getting stickers for contributors.
19+
or for fun things for the community like getting stickers for contributors.
2020
You’ll be helping unified’s maintainers manage and improve existing projects,
2121
and additionally support our work to develop new and exciting projects, such
2222
as [micromark][].

Diff for: ‎docs/community/support.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Here are some tips:
3737
* Don’t fall for the [XY problem][xy]
3838
* Search to find out if a similar question has been asked
3939
* Try to define what you need help with:
40-
* Is there something in particular you want to do?
40+
* Is there something in particular you want?
4141
* What problem are you encountering and what steps have you taken to try
4242
and fix it?
4343
* Is there a concept you don’t understand?

Diff for: ‎docs/docs/getting-started.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Now you’ve set up an integration or `@mdx-js/mdx` itself,
9292
it’s time to configure your JSX runtime.
9393

9494
* if you use **React**,
95-
you don’t need to do anything;
95+
that’s the default;
9696
optionally install and configure [`@mdx-js/react`][mdx-react]
9797
* if you use **Preact**,
9898
set [`jsxImportSource` in `ProcessorOptions`][api-processor-options] to

Diff for: ‎docs/docs/troubleshooting-mdx.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ one short-term solution is to use a bundler to make a CJS version.
9797

9898
## Problems using MDX
9999

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

216216
## Problems writing MDX
217217

218-
Problems that occur when writing MDX typically have to do with how to combine
218+
Problems that occur when writing MDX typically have relate to how to combine
219219
JS(X) and markdown.
220220
It’s an odd mix of two languages: markdown is **whitespace sensitive** and
221221
**forgiving** (what you type may not exactly work but it won’t crash) whereas

Diff for: ‎docs/index.mdx

+3-8
Original file line numberDiff line numberDiff line change
@@ -137,16 +137,11 @@ You’re using React, Preact, or Vue.
137137
during the build stage
138138
</div>
139139

140-
{/* To do: quotes. */}
141-
142-
> It’s extremely useful for using design system components to render markdown
143-
> and weaving interactive components in with existing markdown.
140+
> lol mdx is so good
144141
>
145-
> [**@chrisbiscardi**][quote]
146-
147-
{/* [v3]: /blog/v3/ */}
142+
> [**@dan\_abramov**][quote]
148143
149-
[quote]: https://twitter.com/chrisbiscardi/status/1022304288326864896
144+
[quote]: https://twitter.com/dan_abramov/status/1286411354996449281
150145

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

Diff for: ‎docs/migrating/v2.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ We turned off GFM features in MDX by default.
607607
GFM extends CommonMark to add autolink literals, footnotes, strikethrough,
608608
tables, and task lists.
609609
If you do want these features, you can use a plugin.
610-
How to do so is described in [our guide on GFM][guide-gfm].
610+
See [our guide on GFM][guide-gfm].
611611

612612
## Update MDX content
613613

Diff for: ‎package-lock.json

+55-88
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: ‎packages/loader/lib/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export function loader(value, callback) {
6161
/* c8 ignore next -- some loaders set `undefined` (see `TypeStrong/ts-loader`). */
6262
const compiler = this._compiler || marker
6363

64-
// To do: next major (MDX 4?): remove.
64+
// To do: next major: remove.
6565
if ('renderer' in config) {
6666
callback(
6767
new Error(

Diff for: ‎packages/mdx/lib/core.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@
6262
* in most cases `'program'` should be used, it results in a whole program;
6363
* internally `evaluate` uses `'function-body'` to compile to
6464
* code that can be passed to `run`;
65-
* in some cases, you might want to do what `evaluate` does in separate steps
66-
* yourself, such as when compiling on the server and running on the client.
65+
* in some cases, you might want what `evaluate` does in separate steps, such
66+
* as when compiling on the server and running on the client.
6767
* @property {string | null | undefined} [pragma='React.createElement']
6868
* Pragma for JSX, used in the classic runtime as an identifier for function
6969
* calls: `<x />` to `React.createElement('x')` (default:

Diff for: ‎packages/mdx/lib/plugin/recma-document.js

+2
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,8 @@ export function recmaDocument(options) {
390390
return
391391
}
392392

393+
// To do: add support for `import.meta.resolve`.
394+
393395
if (
394396
node.type === 'MemberExpression' &&
395397
'object' in node &&

Diff for: ‎packages/mdx/readme.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -743,8 +743,8 @@ Configuration for `createProcessor` (TypeScript type).
743743
in most cases `'program'` should be used, it results in a whole program;
744744
internally [`evaluate`][api-evaluate] uses `'function-body'` to compile to
745745
code that can be passed to [`run`][api-run];
746-
in some cases, you might want to do what `evaluate` does in separate steps
747-
yourself, such as when compiling on the server and running on the client.
746+
in some cases, you might want what `evaluate` does in separate steps, such
747+
as when compiling on the server and running on the client.
748748

749749
<details><summary>Expand example</summary>
750750

@@ -1114,7 +1114,7 @@ respectively.
11141114
After markdown, we go to [hast][] (HTML).
11151115
This transformation is done by
11161116
[`syntax-tree/mdast-util-to-hast`][mdast-util-to-hast].
1117-
Wait, why, what does HTML have to do with it?
1117+
Wait, why, what is HTML needed?
11181118
Part of the reason is that we care about HTML semantics: we want to know that
11191119
something is an `<a>`, not whether it’s a link with a resource (`[text](url)`)
11201120
or a reference to a defined link definition (`[text][id]\n\n[id]: url`).

Diff for: ‎packages/remark-mdx/license

+15-16
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,20 @@
22

33
Copyright (c) 2020 Titus Wormer <tituswormer@gmail.com>
44

5-
Permission is hereby granted, free of charge, to any person obtaining
6-
a copy of this software and associated documentation files (the
7-
'Software'), to deal in the Software without restriction, including
8-
without limitation the rights to use, copy, modify, merge, publish,
9-
distribute, sublicense, and/or sell copies of the Software, and to
10-
permit persons to whom the Software is furnished to do so, subject to
11-
the following conditions:
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
1211

13-
The above copyright notice and this permission notice shall be
14-
included in all copies or substantial portions of the Software.
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
1514

16-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

1 commit comments

Comments
 (1)

vercel[bot] commented on Oct 24, 2023

@vercel[bot]

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.