plantuml / plantuml.js

PlantUML that runs completely on javascript without needing java/servers
https://plantuml.github.io/plantuml.js/
MIT License
239 stars 42 forks source link

Remove some data from jar file #39

Closed arnaudroques closed 1 year ago

arnaudroques commented 1 year ago

To improve startup time, we propose to move outside of the jar file some resources that are not necessary needed (as we did for stdlib)

So we would move data files away from:

So inside plantuml-wasm folder , we would create:

We would also change initialization from:

await cheerpjRunMain("com.plantuml.wasm.RunInit", `${cheerpjPath}/plantuml-wasm.jar`, `${cheerpjPath}/stdlib/`)

to:

await cheerpjRunMain("com.plantuml.wasm.RunInit", `${cheerpjPath}/plantuml-wasm.jar`, `${cheerpjPath}/`)

@sakirtemel Does it sound good to you? We'll do the change if you agree on this.

sakirtemel commented 1 year ago

Let’s do that! Makes sense! Very similar approach with the “extensions” is something ace editor is doing. Later, after extracting all the other non-core elements, we can think about having them as bundles rather than small files, because git is a bit complaining about that :)

Technically, I can read the puml content and find the includes there, fetch them and extract them under under /files/ directory and then call render method. With this way, there won’t be anything to change at Java part, I mean, if the last “extensions path” argument is configurable as you suggest, I can make this optimization. What do you think?

On Wed, 1 Feb 2023 at 10:44, PlantUML @.***> wrote:

To improve startup time, we propose to move outside of the jar file some resources that are not necessary needed (as we did for stdlib https://github.com/plantuml/plantuml-wasm/tree/main/plantuml-wasm/stdlib )

So we would move data files away from:

So inside plantuml-wasm folder https://github.com/plantuml/plantuml-wasm/tree/main/plantuml-wasm/ , we would create:

- https://github.com/plantuml/plantuml-wasm/tree/main/plantuml-wasm/emoji

https://github.com/plantuml/plantuml-wasm/tree/main/plantuml-wasm/openiconic

https://github.com/plantuml/plantuml-wasm/tree/main/plantuml-wasm/themes

We would also change initialization https://github.com/plantuml/plantuml-wasm/blob/main/plantuml-wasm/plantuml.js#L9 from:

await cheerpjRunMain("com.plantuml.wasm.RunInit", ${cheerpjPath}/plantuml-wasm.jar, ${cheerpjPath}/stdlib/)

to:

await cheerpjRunMain("com.plantuml.wasm.RunInit", ${cheerpjPath}/plantuml-wasm.jar, ${cheerpjPath}/)

@sakirtemel https://github.com/sakirtemel Does it sound good to you? We'll do the change if you agree on this.

— Reply to this email directly, view it on GitHub https://github.com/plantuml/plantuml-wasm/issues/39, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHFKUBV6DN7JJM7QT7S24LWVIWA5ANCNFSM6AAAAAAUNPUZUY . You are receiving this because you were mentioned.Message ID: @.***>

--

Regards,

Sakir Temel

sakirtemel commented 1 year ago

I just looked at the emoji and the openiconic directories, there are more than thousands of files, I believe it should be a significant improvement after suggested change you mentioned is made :)