Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: bundle wasm binary in chunk for shiki/wasm and @shikijs/core/wasm-inlined #624

Merged
merged 2 commits into from Mar 15, 2024

Conversation

antfu
Copy link
Member

@antfu antfu commented Mar 15, 2024

Related: pi0/nuxt-shiki#18

Performance improvements for reduce the request waterflow on requesting wasm binary.

Before this PR, @shikijs/core/wasm-inlined had an internal async chunk for lazy loading, but that take away the ability for users to have fine-grain control of when the chunk been loaded.

This PR makes the importing shiki/wasm and @shikijs/core/wasm-inlined directly import the binary within that chunk. So you can choice when and how to load the module.

More user-facing import { getWasmInlined } from 'shiki' renames unchanged

Copy link

netlify bot commented Mar 15, 2024

Deploy Preview for shiki-matsu ready!

Name Link
🔨 Latest commit 333ee7a
🔍 Latest deploy log https://app.netlify.com/sites/shiki-matsu/deploys/65f467c3049a6200082ab220
😎 Deploy Preview https://deploy-preview-624--shiki-matsu.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Mar 15, 2024

Deploy Preview for shiki-next ready!

Name Link
🔨 Latest commit 333ee7a
🔍 Latest deploy log https://app.netlify.com/sites/shiki-next/deploys/65f467c3cfad310008b0bdb4
😎 Deploy Preview https://deploy-preview-624--shiki-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Mar 15, 2024

Codecov Report

Attention: Patch coverage is 68.18182% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 96.14%. Comparing base (593a2ed) to head (333ee7a).
Report is 1 commits behind head on main.

Files Patch % Lines
packages/core/src/wasm-inlined.ts 0.00% 6 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #624      +/-   ##
==========================================
- Coverage   96.17%   96.14%   -0.03%     
==========================================
  Files          70       71       +1     
  Lines        5698     5709      +11     
  Branches      751      753       +2     
==========================================
+ Hits         5480     5489       +9     
- Misses        212      214       +2     
  Partials        6        6              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@antfu antfu merged commit 56d1a48 into main Mar 15, 2024
12 of 14 checks passed
@antfu antfu deleted the feat/wasm-sync branch March 15, 2024 15:26
diegohaz pushed a commit to ariakit/ariakit that referenced this pull request Mar 25, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [shiki](https://togithub.com/shikijs/shiki)
([source](https://togithub.com/shikijs/shiki/tree/HEAD/packages/shiki))
| [`1.1.7` ->
`1.2.0`](https://renovatebot.com/diffs/npm/shiki/1.1.7/1.2.0) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/shiki/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/shiki/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/shiki/1.1.7/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/shiki/1.1.7/1.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>shikijs/shiki (shiki)</summary>

### [`v1.2.0`](https://togithub.com/shikijs/shiki/releases/tag/v1.2.0)

[Compare
Source](https://togithub.com/shikijs/shiki/compare/v1.1.7...v1.2.0)

#####    🚀 Features

- Upgrade deps, new lang `Gleam`, new theme `Houston`  -  by
[@&#8203;antfu](https://togithub.com/antfu)
[<samp>(163d8)</samp>](https://togithub.com/shikijs/shiki/commit/163d83b6)

#####    🏎 Performance

- Bundle wasm binary in chunk for `shiki/wasm` and
`@shikijs/core/wasm-inlined`  -  by
[@&#8203;antfu](https://togithub.com/antfu) in
[shikijs/shiki#624
[<samp>(56d1a)</samp>](https://togithub.com/shikijs/shiki/commit/56d1a486)

#####     [View changes on
GitHub](https://togithub.com/shikijs/shiki/compare/v1.1.7...v1.2.0)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/ariakit/ariakit).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNDUuMCIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.

None yet

1 participant