1
0
Fork 0

wip(shared): Started working on jargon overhaul

See #6017
This commit is contained in:
joostdecock 2024-02-17 19:55:56 +01:00
parent 43c069719c
commit e87e889a87
12 changed files with 331 additions and 20 deletions

View file

@ -4,7 +4,7 @@ order: yyy
---
Jargon are terms that could throw off new users.
Rather than create a glossary on every page, we use a plugin to manage
Rather than create a glossary on every page, we use MDX to manage
jargon terms for us. This page shows you how to use it.
<Tip compact>Think of jargon as glossary terms</Tip>
@ -23,13 +23,13 @@ We are migrating from _cjs_ to _esm_ modules
## Adding jargon
To add a new jargon term, you need to add it to the jargon file for the
website you'd like to add it to:
To add a new jargon term, you first need to document it, than you can add it to
the jargon component for the website you'd like to add it to:
| Website | Jargon file | GitHub link |
| ------- | ----------- | ----------- |
| freesewing.dev | `sites/dev/jargon.mjs` | [jargon.mjs](https://github.com/freesewing/freesewing/blob/develop/sites/dev/jargon.mjs) |
| freesewing.org | `sites/org/jargon.mjs` | [jargon.mjs](https://github.com/freesewing/freesewing/blob/develop/sites/org/jargon.mjs) |
| freesewing.dev | `sites/dev/components/jargon.mjs` | [jargon.mjs](https://github.com/freesewing/freesewing/blob/develop/sites/dev/comonents/jargon.mjs) |
| freesewing.org | `sites/org/components/jargon.mjs` | [jargon.mjs](https://github.com/freesewing/freesewing/blob/develop/sites/org/components/jargon.mjs) |
The file consists of key/value pairs where:

View file

@ -0,0 +1,18 @@
---
title: cjs
---
**cjs** stands for **CommonJS**. It is a module system for JavaScript that was
popularized by NodeJS, and as such typically used in server-side JavaScript.
CommonJS uses the **require** keyword to import modules:
```js
const fs = require('fs')
```
In recent years, **cjs** is increasingly being replaced by **esm**, or ECMA
Script Modules which is the official module system of the JavaScript language,
and the future-proof choice.
Since version 3, FreeSewing is ESM-only.

View file

@ -0,0 +1,7 @@
---
title: Terminology
---
These are terms that we use on this website that may or may not be new to you:
<ReadMore />

View file

@ -0,0 +1,17 @@
---
title: esm
---
**esm** stands for **ECMAScript Modules** and is the official module system of
the JavaScript language, supported both in the browser, and on the server.
While ESM is the official standard, before it existed people would typically use CJS outside the browser, as it was popularized by NodeJS.
Some libraries still are not available in ESM, but FreeSewing has been ESM-only since version 3.
ESM uses the **import** keyword to import modules:
```js
import fs from 'fs'
```

View file

@ -0,0 +1,14 @@
---
title: Variadic
---
A **variadic** function is a function that accepts a variable number of arguments.
For example, JavaScript's `console.log` method is variadic:
```js
console.log('one')
console.log('one', 'two')
console.log('one', 'two', 'three')
console.log('It', 'word', 'regardless', 'of', 'how', 'many', 'arguments', 'you', 'pass')
```