Skip to content

Remove Express + unused dependencies - #14028

Merged
andrewscfc merged 104 commits into
latestfrom
remove-express
May 21, 2026
Merged

Remove Express + unused dependencies#14028
andrewscfc merged 104 commits into
latestfrom
remove-express

Conversation

@amoore108

@amoore108 amoore108 commented May 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Removes Express and dependencies related to it
  • Removes other dependencies that are no longer in use or can be replaced by built-in Node APIs, like URL and fetch
  • Removes webpack configs. Maintains the main webpack dependency as its used by Storybook
  • Removes @loadable as we now use next/dynamic for lazy loading components
  • Removes url-parse as we can now use the native URL interface for constructing URLs
  • Removes now unneeded @babel dependencies, but not all of them as some are still required to run the src/app unit tests
  • Removes all the getInitialData folders for the page types
  • Removes applyBasicPageHandlers and the PageHandlers Higher Order Components as these are not needed
  • Removes the src/server folder which started the Express app. Keeps the utility files still used in the Next.js app
  • Removes the src/integration folder as its no longer used
  • Removes the <App /> component which rendered the Express app
  • Removes unneeded scripts in package.json
  • Removes --nextJS arg from integration test runner and commands
  • Moves utilities used by the Next.js from the Express app, into the Next utilities folder
  • Moves the Renderers folder into the Next.js app
  • Creates new #utilities alias to route to the ws-nextjs-app/utilities folder
  • Fixed tsc errors in the Next app
  • Some 'modernisation' + general tidy up of files not used anymore

Useful Links

@amoore108 amoore108 self-assigned this May 15, 2026
@amoore108 amoore108 changed the title test removing express Remove Express May 15, 2026
Comment thread ws-nextjs-app/utilities/addCspHeader/index.test.ts
Comment thread docs/JavaScript-Bundling-Strategy.mdx Outdated
Comment thread package.json
"build:storybook": "rm -rf build && cp envConfig/local.env .env && storybook build -c .storybook -o storybook_dist",
"setupDevEnv": "cp envConfig/local.env .env && rm -rf envConfig/secret.env && ./scripts/checkSecretEnvVariables.sh",
"dependencyFreshness": "node ./scripts/dependencyFreshness",
"dev": "yarn setupDevEnv && rm -rf build && run-p webpack:dev:client webpack:dev:server",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of outright removing this, could we maybe point dev and other common commands like test to the NextJs folder? Just a lazy suggestion, can prefix commands with something like:

run-p --cwd ./ws-nextjs-app

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly, although I'd encourage we start merging the 2 package.jsons together.

I wouldn't want some weird behaviours happening when folks run the Next app from the root directory, but maybe I'm being overly cautious?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be in favour of merging the package.jsons, definitely safer. Would be good to audit/review which commands we still want too. I can make a tech ticket for that too

Comment thread README.md

NB there is further documentation colocated with relevant code. The above list is an index of the top-level documentation of our repo.

## Simorgh Overview

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels like this should also be updated rather than removed. May be better done in a tech/other ticket

@amoore108 amoore108 May 20, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like it should be done when/if we uplift the Next.js app to the root directory. Tech ticket is a good idea. Don't really want it kept since it gives a false impression to devs and AI about how the application behaves.

@andrewscfc andrewscfc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚆 Express leaves the station

@andrewscfc
andrewscfc merged commit 9b61265 into latest May 21, 2026
13 checks passed
@andrewscfc
andrewscfc deleted the remove-express branch May 21, 2026 09:02
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.

8 participants