Add browser extension to ruby_event_store-process_manager#1956
Open
pjurewicz wants to merge 1 commit into
Open
Add browser extension to ruby_event_store-process_manager#1956pjurewicz wants to merge 1 commit into
pjurewicz wants to merge 1 commit into
Conversation
Process manager streams follow the ClassName$id convention, which the browser can now recognize and inspect. The gem ships an extension for the ruby_event_store-browser extension API: - a "Process state" link on process manager stream pages - a /process_managers/:stream_name view rendering the current state and the state rebuilt step by step, newest step first - its own stylesheet, built with Tailwind from the gem's views and served by the extension itself Recognition is backed by a registry filled when a class includes ProcessManager.with_state - no constant resolution of URL input. State is rebuilt through the new public ProcessMethods#replay(events), the same fold build_state uses in production; act is never invoked, so browsing is side-effect free.
pjurewicz
marked this pull request as ready for review
July 17, 2026 18:23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First consumer of the browser extension API from #1951: the process manager gem now ships a browser extension inspecting stateful processes.
Process manager streams follow the
ClassName$idconvention, so the browser can recognize them and offer a dedicated view:/process_managers/:stream_namerenders the current state and the state rebuilt step by step (newest step first) — each row shows the event, its timestamp and the state after applying itmake css), so the browser's asset pipeline stays untouchedDesign notes:
ProcessManager.with_stateregisters the class;parse_stream_nameis a hash lookup. NoObject.const_geton URL-derived input, no autoloading side effects, and hand-rolled classes that skipwith_stateare deliberately not browsable.ProcessMethods#replay(events)foldsapplyfrominitial_stateand returns the successive states. Productionbuild_stateuses the same fold, so the view shows exactly what the process computed.actis never invoked — browsing is side-effect free.StateReplayreturns steps plus the current state; the route handler is plain plumbing.Example wiring in a Rails app: