Meteor/V3/Api Rename Express Migration

1.0.0Last update Aug 30, 2024
by@manishjha-04

This codemod automates the process of updating API names from Connect to Express in your project. The codemod is specifically designed to align your codebase with the new naming conventions introduced after switching from Connect to Express in Meteor 3.0.

You can find the implementation of this codemod in the Studio here.

Overview

This codemod updates the following API names:

  • WebApp.connectHandlers.use(middleware) is now WebApp.handlers.use(middleware).
  • WebApp.rawConnectHandlers.use(middleware) is now WebApp.rawHandlers.use(middleware).
  • WebApp.connectApp is now WebApp.expressApp.

Examples

Example 1: Updating Middleware Handlers

This codemod updates the API names for middleware handlers.

Before

WebApp.connectHandlers.use(middleware);
WebApp.rawConnectHandlers.use(middleware);

After

WebApp.handlers.use(middleware);
WebApp.rawHandlers.use(middleware);

Example 2: Updating WebApp Instance

This codemod updates the WebApp.connectApp to the new WebApp.expressApp.

Before

const app = WebApp.connectApp;

After

const app = WebApp.expressApp;

Build custom codemods

Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community

background illustrationGet Started Now