shakacode / shakapacker

Use Webpack to manage app-like JavaScript modules in Rails
MIT License
430 stars 95 forks source link

Shakapacker v8: reintroduce `https?` predicate #486

Closed tagliala closed 6 months ago

tagliala commented 6 months ago

Desired behavior:

Allow Shakapacker::DevServer respond to https? predicate again, by checking if protcol == 'https'. This will also allow a tiny refactor:

https://github.com/shakacode/shakapacker/blob/295795e0ce28efdd02be21464508c9674e336cfa/lib/shakapacker/dev_server.rb#L53

- return "https" if server == "https"
+ return "https" if https?

If you are interested in reintroducing this predicate, I can submit a PR.

Use case: jamesmartin/inline_svg#158

Actual behavior:

DevServer does not respond to https? predicate anymore

Setup environment:

G-Rath commented 6 months ago

Why can't you use just check protocol? it's been there since v3 (seems like it could even be further back too).

Overall, I don't think it make sense to reintroduce this helper given how small it is and that the previous logic was deprecated upstream

tagliala commented 6 months ago

it's been there since v3

Thanks, I didn't check if it was available on legacy versions