chore: migrate timeflies-beam example to Fable.Beam rc.30 typed Cowboy API#27
Merged
Merged
Conversation
…y API Bump the timeflies-beam example to Fable.Beam 5.0.0-rc.30 (Cowboy 5.0.0-rc.24) and drop all inline [<Emit>] Cowboy workarounds in favour of the typed bindings: - App.fs: delete the local route/hostRule/protoOpts/transportOpts Emit helpers; use CowboyRouter.wildcard/route/hostRule/compile and Cowboy.tcpPort/protocolOpts/startClear. Switch the now-internal application.ensure_all_started to Application.ensureAllStarted. - Http.fs: replace the content-type header Emit with Maps.ofList (added upstream in Fable.Beam#105 after this migration surfaced the gap), and type init's return as HandlerResult<'State> since CowboyHandler.ok is now typed. The example F# is now free of Cowboy/Beam Emits; only Fable.Actor's own wire-protocol Emits remain in Platform.fs. Verified: dotnet build, Fable BEAM transpile, rebar3 compile, and native + BEAM test suites (21/21 each) all pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
Migrates the
timeflies-beamexample to Fable.Beam 5.0.0-rc.30 (Cowboy5.0.0-rc.24) and removes every inline[<Emit>]Cowboy/Beam workaround in favour of the typed bindings.The main
Fable.Actorlibrary is unchanged — itsFable.Beamreference is a floating5.0.0-rc.*wildcard that already resolves to rc.30, and it uses no Cowboy/changed APIs.Changes
Timeflies.fsprojFable.Beam5.0.0-rc.29 → 5.0.0-rc.30;Fable.Beam.Cowboystays at5.0.0-rc.24(latest).App.fsroute/hostRule/protoOpts/transportOpts[<Emit>]helpers.CowboyRouter.wildcard/route/hostRule/compileandCowboy.tcpPort/protocolOpts/startClear.internalapplication.ensure_all_startedtoApplication.ensureAllStarted.Http.fs[<Emit>]withMaps.ofList— the helper added upstream in Fable.Beam#105 after this migration surfaced the gap (the array-basedfrom_listlowered to a process-dictionary ref;ofListemits a directmaps:from_list([...])).init's return asHandlerResult<'State>sinceCowboyHandler.okis now typed.The example F# is now free of Cowboy/Beam Emits; the only remaining
[<Emit>]s in the repo are Fable.Actor's own wire protocol inPlatform.fs(fable_actor_msg/fable_actor_reply/EXIT), which are app-specific, not a Fable.Beam gap.Verification
dotnet build(lib type-check) ✓rebar3 compile✓ — inspected generatedapp.erl/http.erl:cowboy_router:compile([{'_', […]}]),[{port,3000}],#{env => #{dispatch => …}}, and cleanmaps:from_list([{<<"content-type">>, <<"text/html">>}])(no process-dict-ref wrapper).just test-native21/21 ✓just test-beam21/21 ✓dotnet fantomasclean🤖 Generated with Claude Code