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

PUGizmoForMoose is broken in Pharo 9 (looks like Spec changed a lot) #17

Open
fuhrmanator opened this issue Oct 28, 2021 · 10 comments
Open

Comments

@fuhrmanator
Copy link
Owner

When running PUGizmoForMoose open in a Moose Playground, I get many DNUs, some of which, e.g.,
Instance of SpCheckBoxTableColumn did not understand #onDesactivation: are easy to fix (the API has now a #onDeactivation selector), but others are less obvious.

@fuhrmanator
Copy link
Owner Author

It's not just the Spec2 that is broken in Pharo 9, but also the underlying PlantUML code.

https://github.com/kasperosterbye/PlantUMLBridge (which was based on the core elements here) has been updated for Pharo 9 and 10 (by @kasperosterbye a more experienced Pharo developer than I), so I suggest re-basing the tool on that.

@kasperosterbye
Copy link

Thanks for the compliment Cris. I might know Pharo, but am completely ignorant of Moose. I validated a few days ago that the PlantUMLBridge does indeed still work in both Pharo 9 and 10.

@fuhrmanator
Copy link
Owner Author

@kasperosterbye I propose to do a PR on your PlantUMLBridge project, adding some tests and support for reversing a URL to source (one of the features of Gizmo). I hope you're OK with that dimension (it's more complex, but I promise there are tests).

@kasperosterbye
Copy link

I saw that the reverse direction was part of what the gizmo could do. I never really studied Gizmo and Moose. What is the usage scenario of reversing? I need to understand why it is necessary as part of the Bridge. In the scenarios I have been using Bridge for, the source has been stored in the application using Bridge.
Note, I am not against extending it, but I would like to understand why this is a necessary feature.

@fuhrmanator
Copy link
Owner Author

fuhrmanator commented Oct 29, 2021

So, it's not so much related to Moose, but an API for PlantUML should allow getting the source back from a URL.

A typical thing when doing a diagram is to generate a URL: https://www.plantuml.com/plantuml/png/SoWkIImgAStDuN9KqBLJS5AmKl18pSd9vt98pKi12WC0f

Sequence diagram

Now, what happens when you've no longer the source of that image? Well, the source is actually in the URL. It's why I proposed a method sourceFromUrl: and its test

@fuhrmanator
Copy link
Owner Author

PlantUML's web site allows doing this, but it's not programmatic. You can replace /png/ in the URL with /uml/ (you also have to make it http:) and you can get the source back in the web page:
http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuN9KqBLJS5AmKl18pSd9vt98pKi12WC0f

@kasperosterbye
Copy link

OK, I am still not sure about the use case, but I like the symmetry of it. I will take a look at the method you proposed. Is it intentional that the test looks like this:
image

I am a bit surprised of the letters in the equals part. I will find out I guess. In anycase, if you make a PR I will merge it after I test it. Sometime before Tuesday I would think.

@fuhrmanator
Copy link
Owner Author

fuhrmanator commented Oct 29, 2021

I put the  for testing characters with accents in plantuml source, otherwise the diagrams come out with the wrong text if you use accents. There's a symmetrical test for urlFromSource: with the same funny word Âllo (which should be Allô in French). I will make the test more readable.

I think your original code didn't support extended encoding properly (I had tests for this in PlantUML Gizmo originally). I changed it here to get my tests to pass:

image

The (default system) converter I used in P8 got deprecated in P9, so I had to find a way using ZnUTF8Encoder (which is the asUTF8Bytes extension to String I think). You'll see I encode/decode in urlFromSource/sourceFromUrl.

There's no urgency on a PR. Ideally, I would like to test the Gizmo Spec2 GUI with this, but that GUI likely needs a complete rewrite, and I don't have time or motivation in the immediate future to embark on the Spec for P9 dimension (the GUI is quite complex in the Moose component).

@fuhrmanator
Copy link
Owner Author

I have made a pharo9 fork here that basically removes all dependencies on Moose and fixes things for Spec in P9. I fixed the baseline and the tests run (most of them, there's one GUI test that doesn't pass, but I didn't spend time on it).

I think the best way ahead is to create a separate project for the Moose-only PlantUML support (I won't call it Gizmo).

Many people are interested in PlantUML in Pharo without Moose. Admittedly I didn't keep the projects separate because I was focusing on Moose and there are only so many hours in a day - in retrospect it was not very wise.

So my plan is to do the PR of the basic features of PlantUML in Pharo to @kasperosterbye 's PlantUMLBridge as discussed above, then create a PlantUMLForMoose project (separately) to re-use PlantUMLBridge. I will close this issue since PUGizmoForMoose will become something else in P9.

I'm not touching the master branch here, because all of the Moose builds (images) load it in a menu and I don't want to break the tutorials, etc. that rely on it to work. At some point the updated Moose builds (p9) will load the new PlantUMLForMoose when it exists.

@fuhrmanator
Copy link
Owner Author

Reopening, since this problem isn't really fixed in Moose yet.

@fuhrmanator fuhrmanator reopened this Jan 15, 2022
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

No branches or pull requests

2 participants