plantuml / plantuml.js

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

Add stdlibs from PlantUML #3

Closed sakirtemel closed 1 year ago

sakirtemel commented 1 year ago

https://github.com/plantuml/plantuml/issues/803#issuecomment-1404126757

We should find a way for such content to work:

@startuml
!include <awslib/AWSCommon>
!include <awslib/InternetOfThings/IoTRule>
!include <awslib/Analytics/KinesisDataStreams>
!include <awslib/ApplicationIntegration/SimpleQueueService>

left to right direction

agent "Published Event" as event #fff

IoTRule(iotRule, "Action Error Rule", "error if Kinesis fails")
KinesisDataStreams(eventStream, "IoT Events", "2 shards")
SimpleQueueService(errorQueue, "Rule Error Queue", "failed Rule actions")

event --> iotRule : JSON message
iotRule --> eventStream : messages
iotRule --> errorQueue : Failed action message
@enduml
arnaudroques commented 1 year ago

Here is a beta with the standard library embedded http://beta.plantuml.net/plantuml-wasm-v5.jar

This is really an intermediate version: we just would like to be sure that the the standard library is working that way.

The main drawback of this solution is that the main jar file is now 16 MB large. So even diagrams not using standard library are impacted.

The next step we are thinking of is taking advantage of the /app/ mount point: We would compress each folder of the standard library in an independent zip file (so we'll get C4.zip, DomainStory.zip, archimate.zip, aws.zip, awslib10.zip, awslib14.zip, azure.zip ...)

All those files must be hosted on the root server:

Needed zip files would be load from the Java/JS code only if needed (that is only if some !include <...> is done)

Drawback: I'm not sure this will work from a local browser (that is, is the HTML file is opened locally on the browser).

sakirtemel commented 1 year ago

Drawback: I'm not sure this will work from a local browser (that is, is the HTML file is opened locally on the browser).

nothing works locally right now, that's how cheerpj works. imo we can evaluate this concern later on, 👍 for the idea of having the zip files.

Java is run in "/app" folder, so when it looks for a file in the same directory, like "C4.zip", it then downloads the file and gives it to java.

sakirtemel commented 1 year ago

It worked 🎉 , after adding https://github.com/plantuml/plantuml-wasm/issues/5#issuecomment-1406916805

Screenshot 2023-01-27 at 19 44 55