mattermost-webapp icon indicating copy to clipboard operation
mattermost-webapp copied to clipboard

MM-22249 : Add automatic lazy loading of syntax highlighting libraries

Open sk409 opened this issue 1 year ago • 13 comments

Summary

Load language libraries of highlight.js on demands to reduce bundle size.

Ticket Link

Fixes https://github.com/mattermost/mattermost-server/issues/14029 Jira: https://mattermost.atlassian.net/browse/MM-22249

Related Pull Requests

No related PRs.

Screenshots

No UI changes.

Release Note

NONE

sk409 avatar Oct 07 '22 18:10 sk409

Hello @sk409,

Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here.

mattermod avatar Oct 07 '22 18:10 mattermod

E2E tests not automatically triggered, because PR has no approval yet. Please ask a developer to review and then try again to attach the QA label.

mattermod avatar Oct 07 '22 18:10 mattermod

Nice! Tested this out on the spinwick and can see the languages loading only once they are needed. Can also confirm the languages are split out into separate bundles.

language-bundles

neallred avatar Oct 11 '22 17:10 neallred

@hmhealey Thank you for your review! I fixed what you mentioned.

sk409 avatar Oct 14 '22 18:10 sk409

/update-branch

jgilliam17 avatar Oct 24 '22 12:10 jgilliam17

Error trying to update the PR. Please do it manually.

mattermod avatar Oct 24 '22 12:10 mattermod

/e2e-test

jgilliam17 avatar Oct 24 '22 12:10 jgilliam17

Successfully triggered e2e testing! https://git.internal.mattermost.com/qa/cypress-ui-automation/-/pipelines/254160

mattermod avatar Oct 24 '22 12:10 mattermod

@sk409 can you please update so I can trigger e2es. Thanks 🙂
last cycle failed to run.

jgilliam17 avatar Oct 24 '22 15:10 jgilliam17

@jgilliam17 I commented on another PR, but just in case, What does /update-branch do? Should I merge master into this branch?

sk409 avatar Nov 01 '22 04:11 sk409

Error trying to update the PR. Please do it manually.

mattermod avatar Nov 01 '22 04:11 mattermod

@sk409 In this case, you should merge master into this branch and resolve the conflicts. /update-branch tries to merge in master, but it aborts if there are any conflicts.

neallred avatar Nov 01 '22 12:11 neallred

Error trying to update the PR. Please do it manually.

mattermod avatar Nov 01 '22 12:11 mattermod

Heh, I like how both of you commenting that still triggered the bot, even when it was in a code block. That seems like it shouldn't work that way.

But yeah, if you could please merge the latest version of master into this and resolve the conflicts, that would unblock testing

hmhealey avatar Nov 02 '22 20:11 hmhealey

I'm sorry, I've been busy lately, but I'll start working on this tonight.

sk409 avatar Nov 03 '22 03:11 sk409

done!

sk409 avatar Nov 04 '22 14:11 sk409

/e2e-test

jgilliam17 avatar Nov 08 '22 14:11 jgilliam17

Successfully triggered e2e testing! https://git.internal.mattermost.com/qa/cypress-ui-automation/-/pipelines/259683

mattermod avatar Nov 08 '22 14:11 mattermod

Thanks @sk409 Tested, looks good to merge. E2E report - no PR related failures. @neallred can you please approve remaining workflow and merge - thanks 🙂

jgilliam17 avatar Nov 09 '22 14:11 jgilliam17

Test server destroyed

mm-cloud-bot avatar Nov 09 '22 14:11 mm-cloud-bot