Skip to content

Conversation

@lua-vr
Copy link
Collaborator

@lua-vr lua-vr commented Feb 10, 2023

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.

@lua-vr lua-vr force-pushed the customize-server branch 2 times, most recently from 1c602b5 to 7d14612 Compare February 14, 2023 04:17
@lua-vr lua-vr mentioned this pull request Feb 14, 2023
@lua-vr
Copy link
Collaborator Author

lua-vr commented Feb 14, 2023

Rebased on top of #154

@lua-vr
Copy link
Collaborator Author

lua-vr 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
@lua-vr lua-vr marked this pull request as draft February 20, 2023 05:17
@lua-vr
Copy link
Collaborator Author

lua-vr 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.

@lua-vr lua-vr 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 ...

@lua-vr
Copy link
Collaborator Author

lua-vr commented Feb 21, 2023

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.

@lua-vr lua-vr force-pushed the customize-server branch from 23ab5ab to 46aad40 Compare March 19, 2023 19:41
@lua-vr
Copy link
Collaborator Author

lua-vr commented Mar 19, 2023

@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