owncloud / web

:dragon_face: Next generation frontend for ownCloud Infinite Scale
https://owncloud.dev/clients/web/
GNU Affero General Public License v3.0
434 stars 159 forks source link

perf: lazy load toast-ui editor dependencies #11060

Closed JammingBen closed 3 months ago

JammingBen commented 3 months ago

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

AlexAndBear commented 3 months ago

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

JammingBen commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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

sonarcloud[bot] commented 3 months ago

Quality Gate Passed Quality Gate passed

Issues
2 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud