diff --git a/docs/guide/regex-engines.md b/docs/guide/regex-engines.md index d1ff0345..31f7a7d0 100644 --- a/docs/guide/regex-engines.md +++ b/docs/guide/regex-engines.md @@ -37,11 +37,7 @@ const shiki = await createShiki({ }) ``` -## JavaScript RegExp Engine (Experimental) - -::: warning Experimental -This feature is experimental and may change without following semver. -::: +## JavaScript RegExp Engine This engine uses JavaScript's native RegExp. As regular expressions used by TextMate grammars are written for Oniguruma, they might contain syntax that is not supported by JavaScript's RegExp, or expect different behavior for the same syntax. So we use [Oniguruma-To-ES](https://github.com/slevithan/oniguruma-to-es) to transpile Oniguruma patterns to native JavaScript RegExp. diff --git a/docs/guide/sync-usage.md b/docs/guide/sync-usage.md index f05ba846..635c918e 100644 --- a/docs/guide/sync-usage.md +++ b/docs/guide/sync-usage.md @@ -19,7 +19,7 @@ const shiki = createHighlighterCoreSync({ const html = shiki.highlight('console.log(1)', { lang: 'js', theme: 'nord' }) ``` -When doing so, it requires all `themes` and `langs` to be provide as plain objects. Also an explicit `engine` is required to be provided. With the new [experimental JavaScript RegExp engine](/guide/regex-engines#javascript-regexp-engine-experimental) you are able to create an engine instance synchronously as well. +When doing so, it requires all `themes` and `langs` to be provide as plain objects. Also an explicit `engine` is required to be provided. With the new [JavaScript RegExp engine](/guide/regex-engines#javascript-regexp-engine) you are able to create an engine instance synchronously as well. The [Oniguruma Engine](/guide/regex-engines#oniguruma-engine) can only be created asynchronously, so you need to resolve the engine promise before creating the sync highlighter. diff --git a/docs/references/engine-js-compat.md b/docs/references/engine-js-compat.md index d498abc9..f1b29548 100644 --- a/docs/references/engine-js-compat.md +++ b/docs/references/engine-js-compat.md @@ -1,6 +1,6 @@ # JavaScript RegExp Engine Compatibility References -Compatibility reference of all built-in grammars with the [JavaScript RegExp engine](/guide/regex-engines#javascript-regexp-engine-experimental). +Compatibility reference of all built-in grammars with the [JavaScript RegExp engine](/guide/regex-engines#javascript-regexp-engine). > Generated on Thursday, December 19, 2024 > diff --git a/packages/engine-javascript/README.md b/packages/engine-javascript/README.md index 12f4eb64..141aa0a4 100644 --- a/packages/engine-javascript/README.md +++ b/packages/engine-javascript/README.md @@ -1,6 +1,6 @@ # @shikijs/engine-javascript -Engine for Shiki using JavaScript's native RegExp (experimental). Uses [Oniguruma-To-ES](https://github.com/slevithan/oniguruma-to-es) to transpile regex syntax and behavior. +Engine for Shiki using JavaScript's native RegExp. Uses [Oniguruma-To-ES](https://github.com/slevithan/oniguruma-to-es) to transpile regex syntax and behavior. [Documentation](https://shiki.style/guide/regex-engines) diff --git a/packages/engine-javascript/src/index.ts b/packages/engine-javascript/src/index.ts index 9fe21b29..4a3d6429 100644 --- a/packages/engine-javascript/src/index.ts +++ b/packages/engine-javascript/src/index.ts @@ -184,8 +184,6 @@ export class JavaScriptScanner implements PatternScanner { * patterns are not supported. Errors will be thrown when parsing TextMate grammars with * unsupported patterns, and when the grammar includes patterns that use invalid Oniguruma syntax. * Set `forgiving` to `true` to ignore these errors and skip any unsupported or invalid patterns. - * - * @experimental */ export function createJavaScriptRegexEngine(options: JavaScriptRegexEngineOptions = {}): RegexEngine { const _options = { diff --git a/scripts/report-engine-js-compat.ts b/scripts/report-engine-js-compat.ts index 19144ec2..d05eeb5b 100644 --- a/scripts/report-engine-js-compat.ts +++ b/scripts/report-engine-js-compat.ts @@ -202,7 +202,7 @@ async function run() { let markdown = [ '# JavaScript RegExp Engine Compatibility References', '', - 'Compatibility reference of all built-in grammars with the [JavaScript RegExp engine](/guide/regex-engines#javascript-regexp-engine-experimental).', + 'Compatibility reference of all built-in grammars with the [JavaScript RegExp engine](/guide/regex-engines#javascript-regexp-engine).', '', `> Generated on ${new Date().toLocaleDateString('en-US', { dateStyle: 'full' })} `, '>',