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: lazy load toast-ui editor dependencies #11060

Merged
merged 2 commits into from
Jun 19, 2024

Conversation

JammingBen
Copy link
Collaborator

@JammingBen JammingBen commented Jun 18, 2024

Description

Dynamically load toast-ui editor languages and the syntax highlight plugin for markdown files. This improves editor loading times in other scenarios where of one these 2 things are not needed.

Related Issue

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests
  • Documentation
  • Maintenance (e.g. dependency updates or tooling)

@JammingBen JammingBen self-assigned this Jun 18, 2024
Dynamically load toast-ui editor languages and the syntax highlight plugin for markdown files. This improves editor loading times in other scenarios where one of these 2 things are not needed.
@JammingBen JammingBen force-pushed the feat/lazy-load-toast-editor-parts branch from d94a243 to 7b4158a Compare June 19, 2024 07:03
@AlexAndBear
Copy link
Contributor

Looks a little clumsy but I fear that's the downside of making it performant 😁

@JammingBen
Copy link
Collaborator Author

Looks a little clumsy but I fear that's the downside of making it performant 😁

Totally agree :( Also the weird dist-imports of the lib contribute to that unfortunately.

@kulmann
Copy link
Member

kulmann commented Jun 19, 2024

Looks a little clumsy but I fear that's the downside of making it performant 😁

Totally agree :( Also the weird dist-imports of the lib contribute to that unfortunately.

Do you think this is something to solve or propose upstream? ;-)

@AlexAndBear
Copy link
Contributor

Could you think of adding a new ts file for the translations where you import the lang files and then just importing that file Async, for now ?

@kulmann
Copy link
Member

kulmann commented Jun 19, 2024

Could you think of adding a new ts file for the translations where you import the lang files and then just importing that file Async, for now ?

good idea 👍

@JammingBen
Copy link
Collaborator Author

Do you think this is something to solve or propose upstream? ;-)

I didn't dig too deep, but it seems that you can use the non-dist imports, but then you have to explicitly name the supported languages for the syntax highlighting.

Could you think of adding a new ts file for the translations where you import the lang files and then just importing that file Async, for now ?

good idea 👍

Hmm I don't see much benefit tbh. Also it would raise the question where this file would live. We're not in an app context here, this is just a single web-pkg component. But if you 2 want to have it that way, sure that's possible 🤷

@AlexAndBear
Copy link
Contributor

Just decluttering I guess. Could make a new Folder
/Components/TextEditor/editor.vue
/Components/TextEditor/i18n.ts

@JammingBen JammingBen force-pushed the feat/lazy-load-toast-editor-parts branch from 666be14 to c1b9ead Compare June 19, 2024 08:27
Copy link

sonarcloud bot commented Jun 19, 2024

@JammingBen JammingBen merged commit 430aebd into master Jun 19, 2024
3 checks passed
@micbar micbar mentioned this pull request Jul 8, 2024
19 tasks
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.

Prevent toast-ui editor from always loading all dependencies
3 participants