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

[ci skip] Remove guide docs for rackup #53533

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

Earlopain
Copy link
Contributor

Rackup now recommends to not use it: https://github.com/rack/rackup?tab=readme-ov-file#soft-deprecation

I'd wager a guess and say that most apps (in a rails context) are already using either bin/rails server or just invoke their chosen server directly anyways.

Additionally, this info outdated. config.ru is already generated in such a way that users don't have to change anything: https://github.com/rails/rails/blob/32dcdcaef666e0043b0df844aa167201d50f8c9c/railties/lib/rails/generators/rails/app/templates/config.ru.tt

Verified

This commit was signed with the committer’s verified signature.
MichaelDeBoey Michaël De Boey
Rackup now recommends to not use it: https://github.com/rack/rackup?tab=readme-ov-file#soft-deprecation

I'd wager a guess and say that most apps (in a rails context) are already
using either `bin/rails server` or just invoke their chosen server directly anyways.

Additionally, this info outdated. `config.ru` is already generated in such a way that users don't have to change anything.
@rails-bot rails-bot bot added the docs label Nov 4, 2024
@p8
Copy link
Member

p8 commented Nov 4, 2024

I think this change makes sense.
I'm wondering if we can remove rackup as a dependency of Railties as well? (not in this PR)

s.add_dependency "rackup", ">= 1.0.0"

Edit: I guess not as ActionPack still supports Rack 2:

s.add_dependency "rack", ">= 2.2.4"

@Earlopain
Copy link
Contributor Author

It's not so easy. Even with Rack 3 only, there is a dependency here:

class Server < Rackup::Server

You would need to inline a bunch from this class: https://github.com/rack/rackup/blob/8d32c964c3ab7495b6fc59f30d83ae3d80bb4851/lib/rackup/server.rb

Rails does its own argument parsing, handles middleware by itself, does not expose profiling like rackup does, and probably more. I'm not sure how much relevant code would actually be left in the end (doesn't look too bad honestly) but it's definitly more involved and I'm sure there's need for deprecation somewhere as well.

@p8
Copy link
Member

p8 commented Nov 4, 2024

That Rackup::Server is referencing this:
https://github.com/rails/rails/blob/32dcdcaef666e0043b0df844aa167201d50f8c9c/railties/lib/rails/rackup/server.rb
See: #47885
It's basically a fallback for when rackup gem is missing.

@p8
Copy link
Member

p8 commented Nov 4, 2024

Also related "Require Rack 3": #50565

@Earlopain
Copy link
Contributor Author

Rack::Server is gone in Rack 3 since it was moved to the gem. I don't quite get under which circumstances rackup/server would not be present (since railties depends on it) but it seems to definitely be required with Rack 3 at least. For Rack 2, I guess it could end up in the rescue block.

Still, anything extra to this PR will indeed be easier when Rack 2 is dropped.

@rafaelfranca rafaelfranca merged commit 6d30780 into rails:main Nov 5, 2024
3 checks passed
rafaelfranca added a commit that referenced this pull request Nov 5, 2024

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
[ci skip] Remove guide docs for `rackup`
@Earlopain Earlopain deleted the no-docs-for-rackup branch November 5, 2024 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants