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

Live server shim/websocket customization #152

Merged
merged 4 commits into from
Nov 26, 2023

Conversation

estradilua
Copy link
Collaborator

Allows Ema users to specify the Ema Shim or a custom websocket response.

This can be used, for instance, to make the server open files in the user's favorite editor in response to a websocket request. So it could address #59, #69 (in some sense, since we can just use a custom shim).

@srid

This comment was marked as outdated.

@estradilua estradilua force-pushed the customize-server branch 2 times, most recently from 1c602b5 to 7d14612 Compare February 14, 2023 04:17
@estradilua
Copy link
Collaborator Author

Rebased on top of #154

@estradilua
Copy link
Collaborator Author

estradilua commented Feb 14, 2023

Cool "page-following" demo with emacs and organon (using this PR).

cut.webm

@srid
Copy link
Owner

srid commented Feb 19, 2023

@lucasvreis Could you link me to your source that uses this feature (the custom shim as well as the custom renderer)? Just curious to see how it gets used, so I can understand the change better.

@srid srid changed the title Server customization Live server shim/websocket customization Feb 19, 2023
@estradilua estradilua marked this pull request as draft February 20, 2023 05:17
@estradilua
Copy link
Collaborator Author

estradilua commented Feb 20, 2023

@srid I've changed some things. Here is a more recent demo, at the end I explain how it works briefly:
video.webm

The code referenced in the video is here:
https://github.com/lucasvreis/organon/blob/48eb54a9b4026cff542ce5b4cf1a77b16d138b8f/organon/src/Site/Organon/Server.hs#L63-L81
https://github.com/lucasvreis/organon/blob/48eb54a9b4026cff542ce5b4cf1a77b16d138b8f/organon/src/Site/Organon/Dynamic.hs#L40-L52

I can explain the PR in matrix chat too, if you prefer.

@estradilua estradilua marked this pull request as ready for review February 20, 2023 23:49
@srid
Copy link
Owner

srid commented Feb 21, 2023

Whoa, nice demo! That makes me want to switch back (again) to org. 😁 Waiting for organon release ...

@estradilua
Copy link
Collaborator Author

Gravacao.de.tela.de.2023-02-21.19-36-03.webm

@srid
Copy link
Owner

srid commented Mar 14, 2023

@lucasvreis Does it make sense to simplify this example by upstreaming the SWITCH case (even if unused)? Because then we won't need to write a whole new shim, and can just use the default one. Only a custom server handler is defined.

@estradilua
Copy link
Collaborator Author

@srid I rebased on top of master and updated the second commit with your suggestion

@srid
Copy link
Owner

srid commented Jul 18, 2023

I really let this slip by. This weekend I'll spend some time merging this and other PRs, and then make a release of ema, emanote and relevant libraries.

Lucas V. R added 2 commits November 25, 2023 20:14
Allows Ema users to specify the Ema Shim or a custom websocket response.

This can be used, for instance, to make the server open files in the
user's favorite editor in response to a websocket request.
@srid srid merged commit 9dad6e6 into srid:master Nov 26, 2023
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.

2 participants