Skip to content

Commit

Permalink
docs: typo
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Jan 20, 2025
1 parent a802e18 commit efce837
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions docs/blog/v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ In case you missed, there are quite some cool new features we have landed in min

Among all these new features, we also includes a lot of new languages support and new themes. Check out [languages](/languages) and [themes](/themes) list for the full list.

Meanwhile, huge thanks to [@slevithan](https://github.com/slevithan)'s great work on [`oniguruma-to-es`](https://github.com/slevithan/oniguruma-to-es) that make the [JavaScript engine supports 97.2% of all the languages](/references/engine-js-compat).
Meanwhile, huge thanks to [@slevithan](https://github.com/slevithan)'s great work on [`oniguruma-to-es`](https://github.com/slevithan/oniguruma-to-es) that make the JavaScript engine [supports 97.2% of all the languages](/references/engine-js-compat).

## Breaking Changes

There are **NO** hard breaking changes in v2.0.0. It serves as a stepping stone for the upcoming v3.0.0.

The only change in v2 is that Shiki will now **emit warnings when you are using APIs that are deprecated** and planned to be removed in v3. As this might affect the end users, we make a major version bump so you can opt-in to the warnings and prepare for the future removal.
The only change in v2 is that Shiki will now **emit warnings when you use deprecated APIs** that are planned to be removed in v3. Since this might affect end users, we have made a major version bump so you can opt-in to the warnings and prepare for the future removal.

- `v1.x`: Deprecated APIs are still supported, marked on type level only. With optional runtime warnings to opt-in.
- 👉 `v2.0`: No breaking changes, but enable runtime deprecated warnings by default.
Expand All @@ -43,15 +43,15 @@ Expect v3.0.0 to be released soon after v2.0.0.

## Deprecations

We highly recommend you to migrate them sooner.
We highly recommend you to migrate the depreactions as soon as possible, with the warning messages as a guide.

### `getHighlighter` -> `createHighlighter`

There is no functional changes, but more like correcting the naming to avoid confusion. It should be a straightforward find-and-replace.

### WASM Related APIs

Since the introduce of the [engine system](/guide/regex-engines) in v0.16, the WebAssembly related dependencies are no longer a hard requirement. To make tree-shaking easier and decoupled the engines with the core, two packages are extracted `@shikijs/engine-oniguruma` and `@shikijs/engine-javascript`. They are also re-exported from the main package's `shiki/engine/oniguruma` and `shiki/engine/javascript` respectively.
Since the introduction of the [engine system](/guide/regex-engines) in v0.16, WebAssembly-related dependencies are no longer a hard requirement. To facilitate tree-shaking and decouple the engines from the core, two packages have been extracted: `@shikijs/engine-oniguruma` and `@shikijs/engine-javascript`. These are also re-exported from the main package as `shiki/engine/oniguruma` and `shiki/engine/javascript`, respectively.

You might need to change your import path:

Expand Down Expand Up @@ -79,7 +79,7 @@ The `@shikijs/compat` package that built for compatibility with v0.14 is now dep

### Transformers Matching Algorithm

The `matchAlgorithm` option for transformers is introduced in v1.29.0 to allow users to choose the matching algorithm. The default value will be changed from `v1` to `v3` in v3.0.0. We recommend you to set the `matchAlgorithm` option explicitly to avoid breaking changes in the future.
The `matchAlgorithm` option for transformers was introduced in v1.29.0, allowing users to choose the matching algorithm. The default value will change from `v1` to `v3` in v3.0.0. We recommend explicitly setting the `matchAlgorithm` option to avoid future breaking changes.

[Learn more](/packages/transformers#matching-algorithm).

Expand All @@ -95,7 +95,7 @@ The `matchAlgorithm` option for transformers is introduced in v1.29.0 to allow u

## Tweaking Warnings

If you prepre hard errors instead of warnings, you can run the following code before using Shiki, the first argument decides if warnings should be enabled, the second argument decides if warnings should be thrown as errors:
If you prefer hard errors instead of warnings, you can run the following code before using Shiki, the first argument decides if warnings should be enabled, the second argument decides if warnings should be thrown as errors:

```ts
import { enableDeprecationWarnings } from 'shiki/core'
Expand All @@ -117,7 +117,7 @@ enableDeprecationWarnings(false)

## Try It as a User

If you are using Shiki indirectly via other packages, like [`vitepress`](https://vitepress.dev/) or [`@nuxt/content`](https://content.nuxt.com/), etc. Where you don't directly control the version of Shiki, you can try adding the following lines to you `package.json` to force the usage of Shiki v2.0.0, and to check if the frameworks/tools you are using are using deprecated APIs of Shiki - if they do, report to their repositories and bring them the awareness of the upcoming changes. Thanks!
If you are using Shiki indirectly via other packages, like [`vitepress`](https://vitepress.dev/) or [`@nuxt/content`](https://content.nuxt.com/), where you don't directly control the version of Shiki, you can try adding the following lines to your `package.json` to force the usage of Shiki v2.0.0. This will help you check if the frameworks/tools you are using rely on deprecated Shiki APIs. If they do, please report it to their repositories to raise awareness of the upcoming changes. Thanks!

```json
{
Expand Down

0 comments on commit efce837

Please sign in to comment.