inline_svg icon indicating copy to clipboard operation
inline_svg copied to clipboard

Add support to Shakapacker

Open tagliala opened this issue 1 year ago • 6 comments

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 avatar May 19 '24 09:05 tagliala

@tagliala Looks good to me. Just need a maintainer to have a look and review.

paypro-leon avatar May 27 '24 14:05 paypro-leon

Thanks.

I have two successful builds on Shakapacker 7 and 8 at:

  • https://github.com/diowa/icare/actions/runs/9256714063
  • https://github.com/diowa/icare/actions/runs/9256838181

A proper solution would be to create a new app with Shakapacker 8 and make an integration test here, as per #159, but this would require to fix the test apps repo

tagliala avatar May 27 '24 14:05 tagliala

I have a working build against Rails 7.1 / Shakapacker 8: https://github.com/tagliala/inline_svg/actions/runs/9549035858

I've removed the old test against webpacker because of python 2.7 and deprecations.

Please let me know if you need some help or if I should fork

tagliala avatar Jun 17 '24 14:06 tagliala

Please let me know if you need some help or if I should fork

Thanks for your work so far. Sorry for the delayed responses, I was away on vacation and then work trips. Let's get CI working properly and then get this merged.

jamesmartin avatar Jun 24 '24 06:06 jamesmartin

Hi,

Let's get CI working properly and then get this merged.

I did not invest time in webpacker (it should have been upgraded from v4 to v5 in the rails 6 branch), so this is expected to fail against the CI like it is failing now

#159 is based on this PR and should make the CI pass agains Rails 7.1 / Shakapacker 8

If you are interested, I can make a PR to drop compatibility with legacy Rails and Ruby versions

tagliala avatar Jun 24 '24 07:06 tagliala

If you are interested, I can make a PR to drop compatibility with legacy Rails and Ruby versions

Sounds good. Let's do that. 👍

jamesmartin avatar Jun 24 '24 07:06 jamesmartin

Friendly bump.

The first steps would be to merge:

  • #157
  • jamesmartin/inline_svg_test_app#24
  • jamesmartin/inline_svg_test_app#25
  • jamesmartin/inline_svg_test_app#26

Then this PR can be merged because it is not breaking (and it is tested in #159 against Shakapacker)

Then, after a rebase and some changes to the target repo in actions, it will be possible to merge:

  • jamesmartin/inline_svg#159

To have a working CI.

At that point, it would be possible to release a minor version with proper Shakapacker 7+ support.

After the minor release, it would be possible to consider to drop old Ruby and Rails support and go for 2.0. I would entirely drop webpacker support for 2.0

tagliala avatar Jul 20 '24 13:07 tagliala

Thanks, this is on my TODO list.

jamesmartin avatar Jul 30 '24 06:07 jamesmartin

Thanks, please let me know if you need help and what strategy you decide, everything works for me

tagliala avatar Jul 30 '24 07:07 tagliala

Thanks for your patience, @tagliala. I'm pushing forward with the plan to properly support Shakapacker v8 moving forward and also to drop support for end-of-life Rails versions in an incoming v2.0 of this gem.

jamesmartin avatar Sep 03 '24 02:09 jamesmartin