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

Shakapacker v8: reintroduce https? predicate #486

Closed
tagliala opened this issue May 22, 2024 · 2 comments
Closed

Shakapacker v8: reintroduce https? predicate #486

tagliala opened this issue May 22, 2024 · 2 comments

Comments

@tagliala
Copy link
Contributor

Desired behavior:

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

return "https" if server == "https"

- 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:

  • Ruby version: n/a
  • Rails version: n/a
  • Shakapacker version: 8.0
@G-Rath
Copy link
Contributor

G-Rath commented May 23, 2024

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
Copy link
Contributor Author

it's been there since v3

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

tagliala added a commit to tagliala/inline_svg that referenced this issue May 25, 2024
Shakapacker is the official, actively maintained successor to Webpacker.

Shakapacker v7 changed the spelling of `Webpacker` to `Shakapacker` in
the entire project, but still provided backward compatibility for
`Webpacker` spelling.

v8 dropped the deprecated spelling

This commit also:
- Checks if `Shakapacker` is defined; if not, it falls back on
  `Webpacker`.
- Uses the scope resolution operator to resolve at top-level
  scope
- Checks `protocol` instead of `https?` because the former is available
  from Webpacker 3 and the latter is not available anymore in
  Shakapacker >= 8

Refs:
- shakacode/shakapacker#414
- shakacode/shakapacker#429
- shakacode/shakapacker#486

Close jamesmartin#156
tagliala added a commit to tagliala/inline_svg that referenced this issue Jun 24, 2024
Shakapacker is the official, actively maintained successor to Webpacker.

Shakapacker v7 changed the spelling of `Webpacker` to `Shakapacker` in
the entire project, but still provided backward compatibility for
`Webpacker` spelling.

v8 dropped the deprecated spelling

This commit also:
- Checks if `Shakapacker` is defined; if not, it falls back on
  `Webpacker`.
- Uses the scope resolution operator to resolve at top-level
  scope
- Checks `protocol` instead of `https?` because the former is available
  from Webpacker 3 and the latter is not available anymore in
  Shakapacker >= 8

Refs:
- shakacode/shakapacker#414
- shakacode/shakapacker#429
- shakacode/shakapacker#486

Close jamesmartin#156
tagliala added a commit to tagliala/inline_svg that referenced this issue Jul 27, 2024
Shakapacker is the official, actively maintained successor to Webpacker.

Shakapacker v7 changed the spelling of `Webpacker` to `Shakapacker` in
the entire project, but still provided backward compatibility for
`Webpacker` spelling.

v8 dropped the deprecated spelling

This commit also:
- Checks if `Shakapacker` is defined; if not, it falls back on
  `Webpacker`.
- Uses the scope resolution operator to resolve at top-level
  scope
- Checks `protocol` instead of `https?` because the former is available
  from Webpacker 3 and the latter is not available anymore in
  Shakapacker >= 8

Refs:
- shakacode/shakapacker#414
- shakacode/shakapacker#429
- shakacode/shakapacker#486

Close jamesmartin#156
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants