Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove unused app-param transformer #17

Merged
merged 1 commit into from
Jan 11, 2025
Merged

Conversation

bjohansebas
Copy link
Member

It was planned to add a comment above the function, but I don't think this is the best approach. Anyone who updates to Express 5 will notice that the function will no longer be there, and adding a comment wouldn't add much. The idea behind the codemods is to update quickly and make the application compatible with the new version, meaning that a comment is not sufficient.

@bjohansebas bjohansebas requested a review from kjugi January 10, 2025 22:16
@bjohansebas bjohansebas self-assigned this Jan 10, 2025
Copy link
Member

@kjugi kjugi left a comment

Choose a reason for hiding this comment

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

yeah... code comment was the only reasonable choice for this codemod.

To solve this properly we would need to modify the flow a little bit by detecting usage places and requesting for name param on each entry without enough context. I think it's not the best developer experience and not the simplest thing to implement on our side now.

Docs about the change: https://expressjs.com/en/guide/migrating-5.html#app.param

The app.param(fn) signature was used for modifying the behavior of the app.param(name, fn) function...

We can delete this.

@kjugi kjugi merged commit 597d0b3 into main Jan 11, 2025
23 checks passed
@kjugi kjugi deleted the remove-app-param branch January 11, 2025 22:57
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.

2 participants