Skip to content

Integrate changes from the v2 branch#3982

Merged
DmitrySharabin merged 22 commits intosimplifyfrom
v2-to-simplify
Jul 11, 2025
Merged

Integrate changes from the v2 branch#3982
DmitrySharabin merged 22 commits intosimplifyfrom
v2-to-simplify

Conversation

@DmitrySharabin
Copy link
Member

No description provided.

DmitrySharabin and others added 22 commits May 8, 2025 16:40
* Exclude plugins' `demo.js` files from type checking

* Fix path to the core entry point in `components.json`
- Move themes to the `src` folder and remove the `prism-` prefix
- Adjust the build process accordingly
- Adjust themes' metadata:
    - Remove broken links
    - Add/update authors' full names
    - Update GitHub handles
    - Use Markdown-style links
    - In `components.json`, fix theme ids and add Lea Verou as the owner to the prism, dark, and funky themes
So that they follow the structure (we can parse and use on the website):

```
/**
 * <title>
 *
 * <description>
 *
 * @author <name> (<GitHub_username>)
 */
```

Between the data chunks, there should be at least one empty line.
Move to separate modules:
- `highlightAll()`
- `highlightElement()`
- `highlight()`
- `stringify()`
Was fixed in #3949 (in the `simplify` branch). Move it here to make testing easier.
- Move `tokenize()`, `_matchGrammar()` (and related code), and `resolve()` to separate modules.
- Ditch the `tokenize` symbol in favor of the `$tokenize` special property. Since symbols are excluded from the `for…in` loop, and `$tokenize` is not a symbol, to preserve the previous behavior, we need to handle it in `_matchGrammar` explicitly.
- Switch from `[tokenize]` to `$tokenize` in languages.

---
Co-authored-by: Dmitry Sharabin <dmitrysharabin@gmail.com>
Now, the user can include Prism the way they used to (except v2 now uses the Autoloader plugin under the hood, so more languages can be highlighted right out of the box):

```html
<link rel="stylesheet" href="themes/prism.css" />
<script src="prism.js"></script>
```

Besides, they have access to the Prism instance via `globalThis`.
… global bundle

Co-Authored-By: Dmitry Sharabin <dmitrysharabin@gmail.com>
@github-actions
Copy link

No JS Changes

Generated by 🚫 dangerJS against a701d55

@DmitrySharabin DmitrySharabin merged commit d8246d5 into simplify Jul 11, 2025
2 checks passed
@DmitrySharabin DmitrySharabin deleted the v2-to-simplify branch July 11, 2025 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants