Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
629a534
[FIX] broken link (#2883)
houtan-rocky Mar 27, 2024
90125ef
Update plugin-proposal-optional-chaining-assign.md (#2884)
SharakPL Mar 29, 2024
6678bf7
Add docs for bugfix-firefox-class-in-computed-class-key (#2885)
nicolo-ribaudo Apr 3, 2024
85c50cc
Fix typo in preset-typescript.md (#2886)
askoufis Apr 10, 2024
f151f34
Update Babel types docs (#2887)
babel-bot Apr 29, 2024
d75348f
Docs updates for `transform-runtime` cleanup (#2872)
nicolo-ribaudo Apr 29, 2024
014d07f
Bump Babel 8 node.js requirements (#2888)
JLHwung Apr 30, 2024
c375585
Update plugin-transform-typescript.md (#2889)
Dunqing May 11, 2024
b013f24
docs: update Babel/estree ast difference (#2892)
sxzz Jun 1, 2024
9018180
[Babel 8] Migration guide for `extra.shorthand` (#2891)
liuxingbaoyu Jun 3, 2024
13c9277
fix transform-dynamic-import 404 (#2894)
JLHwung Jun 4, 2024
873907a
fix dynamic-import proposal link (#2896)
JLHwung Jun 4, 2024
806e689
docs: typo in plugin-proposal-decorators (#2900)
fi3ework Jun 19, 2024
d8df2be
Document that regexp plugins only handle regexp literals (#2901)
nicolo-ribaudo Jun 20, 2024
449f038
fix(docsearch): better text contrast for active hit (#2905)
Den-dp Jul 6, 2024
4caa527
docs(options.md): clarify `--source-maps` CLI option (#2898)
jedwards1211 Jul 9, 2024
7242463
docs(assumptions): Remove references to `noObjectSuper` & `noUndeclar…
rschristian Jul 9, 2024
cf9d765
Update plugins-list.md (#2909)
JLHwung Jul 9, 2024
2852ab6
Bump ws from 7.5.9 to 7.5.10 (#2910)
dependabot[bot] Jul 9, 2024
f172a96
Bump webpack-dev-middleware from 5.3.3 to 5.3.4 (#2911)
dependabot[bot] Jul 9, 2024
ba5ca18
Bump braces from 3.0.2 to 3.0.3 (#2912)
dependabot[bot] Jul 9, 2024
22b7ea1
Bump ua-parser-js from 0.7.32 to 0.7.38 (#2913)
dependabot[bot] Jul 9, 2024
4f109ed
Bump follow-redirects from 1.15.3 to 1.15.6 (#2914)
dependabot[bot] Jul 9, 2024
3f0e414
Bump tar from 6.1.13 to 6.2.1 (#2917)
dependabot[bot] Jul 9, 2024
c5d1741
Bump semver from 5.7.1 to 5.7.2 (#2916)
dependabot[bot] Jul 9, 2024
8b91f98
Bump express from 4.18.2 to 4.19.2 (#2915)
dependabot[bot] Jul 9, 2024
97be67f
Add migration docs for removing methods starting with `_` (#2918)
liuxingbaoyu Jul 10, 2024
eab1cea
Fix REPL CORS error (#2920)
liuxingbaoyu Jul 15, 2024
90481ce
[Babel 8] Doc for removing some `NodePath` methods (#2924)
liuxingbaoyu Jul 26, 2024
6ea5704
Add duplicate-named-capturing-groups to ES2025 (#2893)
JLHwung Jul 26, 2024
3dd2641
Add docs for plugin-bugfix-safari-class-field-initializer-scope (#2921)
davidtaylorhq Jul 26, 2024
5c02185
Add docs for `uncheckedRequire` option (#2928)
nicolo-ribaudo Jul 26, 2024
05b6483
Add release post for 7.25.0 (#2927)
nicolo-ribaudo Jul 26, 2024
7d5e624
Remove tag from 7.25.0 blog post
nicolo-ribaudo Jul 26, 2024
7ff59f9
The Safari bug is _before_ 16
nicolo-ribaudo Jul 26, 2024
06d451b
add 7.25.0 to past versions (#2929)
JLHwung Jul 26, 2024
86dee74
Update 2024-07-26-7.25.0.md
nicolo-ribaudo Jul 27, 2024
3d3732c
fix(options): fix nested directives usage (#2908)
Armanio Jul 29, 2024
f9eeddd
fix(options): fix plugin / present entries anchors (#2930)
davidlj95 Jul 31, 2024
287e0ad
improve Babel generator docs (#2931)
JLHwung Aug 1, 2024
b3f6ea3
Updated Broken Link Broken Link #2934 (#2936)
Dwij1704 Aug 11, 2024
eccff2f
Add Route4Me sponsor logo (#2938)
nicolo-ribaudo Aug 19, 2024
4cfea29
Migration: min Node.js version for Babel 8 (#2947)
nicolo-ribaudo Sep 4, 2024
9423c66
Add Igalia as a base support sponsor (#2946)
nicolo-ribaudo Sep 4, 2024
4bad02b
[babel 8] Docs for babel/node args order (#2950)
nicolo-ribaudo Sep 6, 2024
b5d8f96
[Babel 8] doc: Remove `decimal` from parser (#2945)
liuxingbaoyu Sep 6, 2024
1c62dd8
[Babel 8] doc: Split `typeParameter` of `TSMappedType` (#2939)
liuxingbaoyu Sep 6, 2024
e159676
Fix codeblock titles (#2960)
JLHwung Sep 12, 2024
7369e6e
Bump webpack from 5.89.0 to 5.94.0 (#2962)
dependabot[bot] Sep 12, 2024
20e7a27
add diff to additionalLanguages (#2963)
JLHwung Sep 13, 2024
61d93d1
Docs for `importAssertions` and `importReflection` removal (#2948)
nicolo-ribaudo Sep 16, 2024
9291421
bump Babel 8 to 8.0.0-alpha.12 (#2961)
JLHwung Sep 17, 2024
ec30c0a
Bump Docusaurus to 3.5 (#2966)
JLHwung Sep 18, 2024
7ac5548
Update parser.md (#2968)
skyclouds2001 Sep 24, 2024
936f390
Fix `annexB` option name (#2972)
JLHwung Oct 2, 2024
c8052c2
Update Babel types docs (#2973)
babel-bot Oct 2, 2024
e9829a4
Add 7.25.0 to features timeline
nicolo-ribaudo Oct 2, 2024
3390b4f
update shipped proposals docs (#2958)
JLHwung Oct 8, 2024
ecb084b
update import assertions compat data (#2979)
JLHwung Oct 9, 2024
61218dc
fix: REPL with `preset-env` in Babel 8 (#2970)
liuxingbaoyu Oct 16, 2024
86a4395
Update Babel types docs (#2992)
babel-bot Oct 22, 2024
acb33cd
Add docs for generator's `experimental_preserveFormat` option (#2994)
nicolo-ribaudo Oct 25, 2024
c542714
docs: @babel/parser `startIndex` option (#2971)
DylanPiercey Oct 25, 2024
ded31aa
Rename proposal-modifiers (#2977)
JLHwung Oct 25, 2024
70cff98
docs: `import attributes` enabled by default (#2974)
nicolo-ribaudo Oct 25, 2024
c4e5e39
Add migration docs for flow `enums` option (#2965)
nicolo-ribaudo Oct 25, 2024
c5371ff
[babel 8] Add docs for minimal/smart pipeline modes removal (#2964)
nicolo-ribaudo Oct 25, 2024
9b8ed03
Rename `proposal-json-modules` to `transform` (#2998)
nicolo-ribaudo Oct 25, 2024
d9635e0
Docs for `@babel/highlight` and `code-frame` merge (#2995)
nicolo-ribaudo Oct 25, 2024
861cf9f
Update Babel types docs (#2999)
babel-bot Oct 25, 2024
c46a852
Add 7.26.0 blog post (#2993)
nicolo-ribaudo Oct 25, 2024
c6373d4
Bump http-proxy-middleware from 2.0.6 to 2.0.7 (#3001)
dependabot[bot] Oct 29, 2024
9f6bf35
update past versions (#3002)
JLHwung Oct 29, 2024
1fa7393
Update plugins link (#3004)
JLHwung Nov 1, 2024
bd8ae6f
Update typo in parser.md (#3007)
orta Nov 6, 2024
0e31de8
chore: upgrade Docusaurus, enable Faster Rspack/SWC/LightningCSS (#2997)
slorber Nov 8, 2024
2e87c3a
update landing page examples (#2750)
JLHwung Nov 8, 2024
8fabeac
Fix unused markdown directives warning (#3013)
JLHwung Nov 12, 2024
febfa5b
Migrate `react-instantsearch-dom` v6 to `react-instantsearch` v7 (#3017)
JLHwung Nov 21, 2024
b570d64
add compat-data docs (#3015)
JLHwung Nov 22, 2024
eb08a49
Using unpkg instead of googleapis (#3019)
liuxingbaoyu Nov 29, 2024
ff32d27
Use CodeMirror 6 in REPL (#3014)
JLHwung Nov 29, 2024
f1e8d8d
[babel 8] Docs for the new preset-react' `development` default (#3020)
nicolo-ribaudo Dec 6, 2024
2205b95
add TSTypeReference migration note (#3023)
JLHwung Dec 6, 2024
b8406d7
Add docs for `superTypeParameters` -> `superTypeArguments` rename (#3…
nicolo-ribaudo Dec 7, 2024
1e6fbf4
docs: add implied babel-types breaking changes (#3024)
JLHwung Dec 7, 2024
a0fc47b
add migration note to TSTypeQuery typeArguments (#3027)
JLHwung Dec 9, 2024
feac4d6
[Babel 8] doc: Migration for `TSClassImplements` and `TSInterfaceHeri…
liuxingbaoyu Dec 10, 2024
ccd2c0c
Add migration docs (#3028)
JLHwung Dec 11, 2024
118e1fe
add migration note for `TSAbstract` AST change (#3029)
JLHwung Dec 12, 2024
650d34c
Updated Twitter URL to x.com and added Bluesky profile link in footer…
Shubhashish-Chakraborty Dec 13, 2024
ae1eafa
Note section for Symbol.metadata in the plugin-proposal-decorators do…
naman1608 Dec 16, 2024
8c10091
add docs for typeArguments renaming (#3032)
JLHwung Dec 26, 2024
c6144b1
Make v8 API migration more uniform (#3034)
nicolo-ribaudo Dec 28, 2024
e2f716c
igalia (#3035)
liuxingbaoyu Jan 1, 2025
e6ef677
add TSImportType AST change note (#3036)
JLHwung Jan 7, 2025
9d696a5
add migration notes for TSImportType AST changes (#3039)
JLHwung Jan 9, 2025
4b73ecc
docs: add TSEnumBody migration (#3018)
JLHwung Jan 9, 2025
5ca1475
docs: update babel types (#3040)
babel-bot Jan 10, 2025
a0e3df2
add TSTypeQuery exprName migration note (#3041)
JLHwung Jan 17, 2025
7cec0f2
add migration note for TSImportEquals (#3043)
JLHwung Jan 24, 2025
feb21a1
Add migration note for TSTemplateLiteralType (#3042)
JLHwung Jan 27, 2025
8923ffa
Update setup guide and make commands compatible with Windows (#3048)
Lehoczky Feb 3, 2025
6067c7d
Page speed improvements (#3049)
Lehoczky Feb 4, 2025
d03ec21
docs: update babel types (#3051)
babel-bot Feb 8, 2025
6d4f72d
Update Babel types docs (#3053)
babel-bot Feb 14, 2025
c71e234
docs: TSHeritageBase expression change (#3056)
JLHwung Feb 23, 2025
b96255b
Bump docusaurus to 3.7.0 (#3059)
JLHwung Feb 25, 2025
5a5c2a4
add a note for the rewriteImportExtensions option (#3052)
JLHwung Mar 7, 2025
bdbf4b8
Expand docs about `MatchPattern` (#3066)
mbtools Mar 15, 2025
9606149
Fix style (#3067)
fisker Mar 15, 2025
b26fd2c
Make ReplOptions wider (#3068)
fisker Mar 15, 2025
5d9b9d4
Update preset env docs (#3069)
JLHwung Mar 20, 2025
1ca2024
Add `allowYieldOutsideFunction` (#3070)
liuxingbaoyu Mar 21, 2025
4f0f02b
Improve generator docs and use named export (#3050)
vovkasm Mar 21, 2025
76805da
missing right paren in TSExpressionWithTypeArguments change note (#3037)
JLHwung Mar 21, 2025
efef47c
docs: update babel types (#3072)
babel-bot Mar 24, 2025
e7b4ae1
Babel 7.27.0 blog post (#3062)
nicolo-ribaudo Mar 24, 2025
b069874
update Babel 8 node requirements (#3073)
JLHwung Mar 27, 2025
7c0703d
Add variable declarator validation changelog (#3075)
JLHwung Apr 3, 2025
a531fee
Fix lint hang (#3078)
liuxingbaoyu Apr 13, 2025
1398192
chore: Some updates and improvements (#3079)
liuxingbaoyu Apr 14, 2025
e9186cf
add R&T discontinue note (#3080)
JLHwung Apr 17, 2025
e518045
Docs for Babel parser ESM migration (#3081)
JLHwung Apr 25, 2025
f1b2ba5
docs: update babel types (#3083)
babel-bot Apr 30, 2025
97fd006
doc: Remove some `Scope` methods for Babel 8 (#2935)
liuxingbaoyu Apr 30, 2025
c2c6ddb
Add migration for TSModuleDeclaration AST change (#3021)
nicolo-ribaudo May 1, 2025
8c45218
Add migration docs for compat-data JSON (#3084)
nicolo-ribaudo May 5, 2025
bcaa3aa
Add migration docs for the global `regeneratorRuntime` transform (#3086)
nicolo-ribaudo May 14, 2025
0a571d4
Another pass through v8 migration docs (#3087)
nicolo-ribaudo May 14, 2025
cf8f5fd
Update Babel 8 API migration guide intro, and add to sidebar (#3088)
nicolo-ribaudo May 14, 2025
4a7b950
Add docs for generator result (#3091)
JLHwung May 27, 2025
5d3ece9
Add docs for Scope references/uids set (#3094)
nicolo-ribaudo May 30, 2025
5b0aff7
Add v8 migration summary for steps to take during Babel 7 (#3092)
nicolo-ribaudo May 30, 2025
7f3d82a
Add Babel 8 beta blog post (#3089)
nicolo-ribaudo May 30, 2025
c28519f
Update banner
nicolo-ribaudo May 30, 2025
bf4cad6
Remove tag
nicolo-ribaudo May 30, 2025
8e588b6
rename proposal-explicit-resource-management to transform-* (#3093)
JLHwung Jun 3, 2025
9e2657f
feat: Use monaco editor (#3076)
liuxingbaoyu Jun 4, 2025
f675f80
update landing page REPL examples (#3096)
JLHwung Jun 4, 2025
667acb3
REPL cleanup (#3097)
JLHwung Jun 5, 2025
f4d9639
Fix REPL bugs (#3099)
liuxingbaoyu Jun 5, 2025
3380e0c
Fix scrollbar issues for REPL (#3101)
liuxingbaoyu Jun 7, 2025
82126bb
Fix REPL PR preview (#3102)
liuxingbaoyu Jun 8, 2025
994adf2
docs: LVal coverage update (#3103)
JLHwung Jun 18, 2025
1abc644
Improve REPL build process (#3105)
liuxingbaoyu Jun 25, 2025
ac773ef
docs(en): merging all conflicts
docschina-bot Jun 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .browserslistrc

This file was deleted.

3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

56 changes: 0 additions & 56 deletions .eslintrc

This file was deleted.

893 changes: 0 additions & 893 deletions .yarn/releases/yarn-4.0.1.cjs

This file was deleted.

934 changes: 934 additions & 0 deletions .yarn/releases/yarn-4.6.0.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ enableGlobalCache: true

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.0.1.cjs
yarnPath: .yarn/releases/yarn-4.6.0.cjs
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@

### 设置

<<<<<<< HEAD
Node: 检查 Node 是否安装了 10.19.0 及以上版本。你可以通过 node -v 检查。
=======
Node: Check that Node is installed with version 20.5.0 and up. You can check this with `node -v`.
>>>>>>> 1abc64479431900a894d069bbac82a2abb2571b2

Yarn: 确保已经安装 Yarn 1 并且版本号 >= 1.19.0。

```shell title="Shell"
$ git clone [email protected]:babel/website.git
$ cd website
$ yarn && yarn bootstrap
```

Expand Down
46 changes: 30 additions & 16 deletions _redirects
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,30 @@ https://babel.netlify.com/* https://babeljs.io/:splat 301!
/docs/plugins/minify-* /docs/babel-plugin-minify-:splat
/docs/plugins/external-helpers/ /docs/babel-plugin-external-helpers

# Removed packages
/docs/babel-highlight /docs/babel-code-frame#migrating-from-babelhighlight

# Plugins renamed from -proposal- to -transform-
/docs/babel-plugin-proposal-class-static-block /docs/babel-plugin-transform-class-static-block
/docs/babel-plugin-proposal-private-property-in-object /docs/babel-plugin-transform-private-property-in-object
/docs/babel-plugin-proposal-class-properties /docs/babel-plugin-transform-class-properties
/docs/babel-plugin-proposal-private-methods /docs/babel-plugin-transform-private-methods
/docs/babel-plugin-proposal-numeric-separator /docs/babel-plugin-transform-numeric-separator
/docs/babel-plugin-proposal-logical-assignment-operators /docs/babel-plugin-transform-logical-assignment-operators
/docs/babel-plugin-proposal-nullish-coalescing-operator /docs/babel-plugin-transform-nullish-coalescing-operator
/docs/babel-plugin-proposal-optional-chaining /docs/babel-plugin-transform-optional-chaining
/docs/babel-plugin-proposal-json-strings /docs/babel-plugin-transform-json-strings
/docs/babel-plugin-proposal-optional-catch-binding /docs/babel-plugin-transform-optional-catch-binding
/docs/babel-plugin-proposal-async-generator-functions /docs/babel-plugin-transform-async-generator-functions
/docs/babel-plugin-proposal-object-rest-spread /docs/babel-plugin-transform-object-rest-spread
/docs/babel-plugin-proposal-unicode-property-regex /docs/babel-plugin-transform-unicode-property-regex
/docs/babel-plugin-proposal-unicode-sets-regex /docs/babel-plugin-transform-unicode-sets-regex
/docs/babel-plugin-proposal-export-namespace-from /docs/babel-plugin-transform-export-namespace-from
/docs/babel-plugin-proposal-class-static-block /docs/babel-plugin-transform-class-static-block
/docs/babel-plugin-proposal-private-property-in-object /docs/babel-plugin-transform-private-property-in-object
/docs/babel-plugin-proposal-class-properties /docs/babel-plugin-transform-class-properties
/docs/babel-plugin-proposal-private-methods /docs/babel-plugin-transform-private-methods
/docs/babel-plugin-proposal-numeric-separator /docs/babel-plugin-transform-numeric-separator
/docs/babel-plugin-proposal-dynamic-import /docs/babel-plugin-transform-dynamic-import
/docs/babel-plugin-proposal-logical-assignment-operators /docs/babel-plugin-transform-logical-assignment-operators
/docs/babel-plugin-proposal-nullish-coalescing-operator /docs/babel-plugin-transform-nullish-coalescing-operator
/docs/babel-plugin-proposal-optional-chaining /docs/babel-plugin-transform-optional-chaining
/docs/babel-plugin-proposal-json-strings /docs/babel-plugin-transform-json-strings
/docs/babel-plugin-proposal-optional-catch-binding /docs/babel-plugin-transform-optional-catch-binding
/docs/babel-plugin-proposal-async-generator-functions /docs/babel-plugin-transform-async-generator-functions
/docs/babel-plugin-proposal-object-rest-spread /docs/babel-plugin-transform-object-rest-spread
/docs/babel-plugin-proposal-unicode-property-regex /docs/babel-plugin-transform-unicode-property-regex
/docs/babel-plugin-proposal-unicode-sets-regex /docs/babel-plugin-transform-unicode-sets-regex
/docs/babel-plugin-proposal-export-namespace-from /docs/babel-plugin-transform-export-namespace-from
/docs/babel-plugin-proposal-duplicate-named-capturing-groups-regex /docs/babel-plugin-transform-duplicate-named-capturing-groups-regex
/docs/babel-plugin-proposal-regexp-modifiers /docs/babel-plugin-transform-regexp-modifiers
/docs/babel-plugin-proposal-json-modules /docs/babel-plugin-transform-json-modules
/docs/babel-plugin-proposal-explicit-resource-management /docs/babel-plugin-transform-explicit-resource-management

# Legacy redirects
/docs/en/babel-plugin-transform-decorators /docs/babel-plugin-proposal-decorators
Expand All @@ -92,8 +100,11 @@ https://babel.netlify.com/* https://babeljs.io/:splat 301!
/docs/en/next/tools/* /setup

# Blog rewrites
/7.27.0 /blog/2025/03/24/7.27.0
/7.26.0 /blog/2024/10/25/7.26.0
/7.25.0 /blog/2024/07/26/7.25.0
/7.24.0 /blog/2024/02/28/7.24.0
/7.23.0 /blog/2023/09/25/7.22.0
/7.23.0 /blog/2023/09/25/7.23.0
/7.22.0 /blog/2023/05/26/7.22.0
/7.21.0 /blog/2023/02/20/7.21.0
/7.20.0 /blog/2022/10/27/7.20.0
Expand Down Expand Up @@ -139,3 +150,6 @@ https://babel.netlify.com/* https://babeljs.io/:splat 301!
# Docusaurus v1 compat

/docs/en/* /docs/:splat

# CircleCI CORS
/circleci/api/* https://circleci.com/api/v1.1/project/github/babel/babel/:splat 200
42 changes: 0 additions & 42 deletions babel.config.js

This file was deleted.

2 changes: 0 additions & 2 deletions docs/assumptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,6 @@ class Child extends Parent {
"mutableTemplateObject": true,
"noClassCalls": true,
"noDocumentAll": true,
"noObjectSuper": true,
"noUndeclaredVariablesCheck": true,
"objectRestNoSymbols": true,
"privateFieldsAsProperties": true,
"pureGetters": true,
Expand Down
90 changes: 84 additions & 6 deletions docs/code-frame.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ npm install --save-dev @babel/code-frame

## Usage

### `codeFrameColumns`

The `codeFrameColumns` function allows you to decorate a code snipped with line numbers and with a marker pointing to a specific location.

It will also optionally highlight your code, defaulting to what is supported by the output terminal.

```js title="JavaScript"
import { codeFrameColumns } from "@babel/code-frame";

Expand Down Expand Up @@ -68,33 +74,33 @@ console.log(result);
5 | };
```

## Options
#### Options

### `highlightCode`
##### `highlightCode`

`boolean`, defaults to `false`.

Toggles syntax highlighting the code as JavaScript for terminals.

### `linesAbove`
##### `linesAbove`

`number`, defaults to `2`.

Adjust the number of lines to show above the error.

### `linesBelow`
##### `linesBelow`

`number`, defaults to `3`.

Adjust the number of lines to show below the error.

### `forceColor`
##### `forceColor`

`boolean`, defaults to `false`.

Enable this to forcibly syntax highlight the code as JavaScript (for non-terminals); overrides `highlightCode`.

### `message`
##### `message`

`string`, otherwise nothing

Expand All @@ -109,6 +115,76 @@ the code frame.
3 | };
```

### `highlight`

The `highlight` function adds syntax highlighting to a code snipped, to be displayed in a terminal.

```js title="JavaScript"
import { highlight } from "@babel/code-frame";

const code = `class Foo {
constructor()
}`;

const result = highlight(code);

console.log(result);
```

```js title="JavaScript"
class Foo {
constructor()
}
```

## Migrating from `@babel/highlight`

The `highlight` functionality was originally split in its own package, `@babel/highlight`.

You can migrate as follows:
<table>
<thead>
<tr>
<th>Using <code>@babel/highlight</code></th>
<th>Using <code>@babel/code-frame</code></th>
</tr>
</thead>
<tbody><tr><td>

```js title="JavaScript"
import highlight from "@babel/highlight";

highlight(text, { forceColor: true });
```

</td><td>

```js title="JavaScript"
import { highlight } from "@babel/code-frame";

highlight(text);
```

</td></tr><tr><td>

```js title="JavaScript"
import highlight from "@babel/highlight";

highlight(text);
```

</td><td>

```js title="JavaScript"
import { highlight } from "@babel/code-frame";

process.stdout.hasColors() ? highlight(text) : text;
```

</td></tr></tbody></table>

:::babel7

## Upgrading from prior versions

Prior to version 7, the only API exposed by this module was for a single line and optional column pointer. The old API will now log a deprecation warning.
Expand Down Expand Up @@ -151,3 +227,5 @@ const result = codeFrameColumns(rawLines, location, {

console.log(result);
```

:::
Loading
Loading