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: preprocess markdown transform at build time #763

Merged
merged 2 commits into from
Dec 31, 2024

Conversation

ACTCD
Copy link
Collaborator

@ACTCD ACTCD commented Dec 30, 2024

Use custom plugin to divest marked module and preprocess markdown transform

  • Use marked to process markdown files at build time instead of runtime

  • Facilitate proper tree-shaking to strip marked module in built package

  • The plugin is designed to be pluggable and does not affect the source code logic

Compare the build results before and after using the plugin:

xcode/App-Shared/Resources/dist/entry-app-webview.html                  0.56 kB │ gzip:  0.35 kB
xcode/App-Shared/Resources/dist/assets/icon-DCQT6rpB.png               24.31 kB
xcode/App-Shared/Resources/dist/assets/entry-app-webview-Cb_RvQZ2.css   8.94 kB │ gzip:  2.50 kB
xcode/App-Shared/Resources/dist/assets/messages-CmX-0hls.js             2.03 kB │ gzip:  1.68 kB
xcode/App-Shared/Resources/dist/assets/messages-Ckgw66Tb.js             3.93 kB │ gzip:  1.46 kB
xcode/App-Shared/Resources/dist/assets/entry-app-webview-CzCN9MuU.js   37.16 kB │ gzip: 14.97 kB
xcode/App-Shared/Resources/dist/assets/marked.esm-CVsleHkO.js          38.10 kB │ gzip: 11.67 kB
xcode/App-Shared/Resources/dist/entry-app-webview.html                  0.56 kB │ gzip:  0.35 kB
xcode/App-Shared/Resources/dist/assets/icon-DCQT6rpB.png               24.31 kB
xcode/App-Shared/Resources/dist/assets/entry-app-webview-Cb_RvQZ2.css   8.94 kB │ gzip:  2.50 kB
xcode/App-Shared/Resources/dist/assets/messages-B7gXSZyi.js             2.31 kB │ gzip:  1.68 kB
xcode/App-Shared/Resources/dist/assets/messages-BqcmYoef.js             4.31 kB │ gzip:  1.49 kB
xcode/App-Shared/Resources/dist/assets/entry-app-webview-BZoFQhA-.js   36.97 kB │ gzip: 14.87 kB

@ACTCD ACTCD requested a review from quoid December 30, 2024 10:55
Base automatically changed from feat/native-logger-and-better-oobe to main December 31, 2024 05:20
@ACTCD ACTCD merged commit 8db148f into main Dec 31, 2024
1 check passed
@ACTCD ACTCD deleted the perf/preprocess-markdown branch December 31, 2024 05:21
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