Replace Express servers with Fastify#1279
Open
DamianReeves wants to merge 4 commits into
Open
Conversation
0f8af76 to
d0b8d28
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d0b8d28f13
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
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
Replaces Morphir-Elm's first-party Express web servers with Fastify while preserving the existing public route behavior.
This PR migrates:
morphir-elm developdev servermorphir-elm treeviewserverserver/server.jscli/assets/DaprAppShell.jsIt also updates direct dependencies so first-party code no longer depends on Express or
body-parserfor these server entrypoints, while leaving transitive third-party Express dependencies untouched.Motivation
Express is no longer the recommended web server for this codebase. The goal is to move first-party server code to Fastify without changing the behavior expected by existing CLI/web workflows.
Details
CLI develop server
expresswithfastifyand@fastify/static.100mbJSON body limit./server/*JSON endpoints.CLI treeview server
expresswithfastifyand@fastify/static.morphir.jsonandmorphir-ir.jsonJSON routes.Standalone server
expresswithfastifyand@fastify/static.0.0.0.0, port8080, and the50mbJSON body limit./insight,/insight.html,/insight.js,/server/morphir-ir.json, and logo asset routes.POST /insightbehavior by writing the posted IR and returning the HTML app body./verifyresponse behavior by avoiding Fastify's special handling of rawErrorinstances.Generated Dapr app shell
body-parserwith Fastify.application/*+json, which is needed for Dapr CloudEvents-style payloads.listen({ port })startup.Regression Coverage
Adds
tests-integration/cli/fastify-server-smoke.test.tsto cover the migrated server behavior:POST /insightreturning HTML and writing IR JSONapplication/*+jsontopic POST handlingThe regression tests were also copied into known-bad intermediate worktrees during development to confirm they catch real migration failures:
POST /insightreturned an empty bodylisten(...)Validation
rg -n 'require\("express"\)|require\('\''express'\''\)|from "express"|from '\''express'\''' cli server package.jsonreturned no first-party direct Express importsbun test tests-integration/cli/fastify-server-smoke.test.ts- 6 pass, 0 failbun test tests-integration/cli- 56 pass, 3 skip, 0 failmise run test:check-package-lockmise run build:climise run build:bundlenode --checkon migrated JavaScript entrypointsgit diff --check main..HEADNotes
path.join,path.delimiter, andprocess.execPathto avoid Unix-only assumptions and keep the smoke suite portable across Windows and Unix-like environments.