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

Make it all configurable. #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Make it all configurable. #3

wants to merge 2 commits into from

Conversation

jperon
Copy link
Collaborator

@jperon jperon commented Mar 2, 2024

This is quite a big change. The idea came from @paulfitzmessage: with this one, it would be possible to create standalone widgets from the code of a "personalized" one.

With that, the name pug_py doesn’t say all it does: it’s now starting from a configuration, that will define an entrypoint (for example a pug or a py code) and possibly other editors.

Another change is that it now uses RapydScript instead of Transcrypt or Brython (or PyScript that I tested too), as it’s far easier to interact with js. The only caveat I saw is that, for functions which really expect a pure Array (like grist.docApi.applyUserActions), it’s necessary to call the Array constructor, or to convert a python list with Array.from(LIST).

@jperon jperon force-pushed the configurable branch 2 times, most recently from ff20a1a to 1777905 Compare March 2, 2024 17:33
@jperon
Copy link
Collaborator Author

jperon commented Mar 3, 2024

I had tested in my self-hosted instance, where the widgets are hosted in the same domain as Grist itself. Now I’m facing cross-origin problems while hosting at docs.getgrist.com. Perhaps I’ll have to go back to Brython…
@berhalak if you had time (but I don’t want to abuse), would you mind looking at this and, if possible, explain me what I’m doing wrong?

@jperon
Copy link
Collaborator Author

jperon commented Mar 3, 2024

@berhalak Never mind, I ended finding the problem. It came from RapydScript, which builds an iframe, but which used, to pass messages between the iframe and its parent, a "pythonesque" equality. This one used an __eq__ property, and its access was forbidden because of CORS.

@jperon jperon force-pushed the configurable branch 2 times, most recently from b7ed402 to 8863b53 Compare March 3, 2024 15:52
@jperon
Copy link
Collaborator Author

jperon commented Mar 3, 2024

So here is a very basic showcase, featuring a customizable Markdown widget.

@jperon
Copy link
Collaborator Author

jperon commented Mar 3, 2024

And here is a new version of the Kanban widget, which could very easily be put into its own repository, and whose configuration is more straight forward than the previous one.

@berhalak berhalak self-requested a review March 4, 2024 17:47
@berhalak
Copy link

Sorry for the delay @jperon, it was busy week for me.

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.

None yet

2 participants