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

Remove tokens and classes helpers #738

Merged
merged 1 commit into from
Jun 24, 2024
Merged

Conversation

joeldrapper
Copy link
Collaborator

@joeldrapper joeldrapper commented Jun 24, 2024

Since #737, we no longer need these helpers.

@joeldrapper joeldrapper requested a review from willcosgrove June 24, 2024 19:04
@joeldrapper
Copy link
Collaborator Author

@willcosgrove can you think of any reason why we should keep these?

@willcosgrove
Copy link
Contributor

I can't think of a long term reason to keep them around. It might be nice if they didn't disappear at the same time as a new way gets introduced, just so the migration isn't as cumbersome

@joeldrapper
Copy link
Collaborator Author

joeldrapper commented Jun 24, 2024

It might be nice if they didn't disappear at the same time as a new way gets introduced, just so the migration isn't as cumbersome

That’s true, but introducing the new way and removing the old way are both breaking changes. We’d either need to keep them around until 3.0 or sneak the new way out in a 1.x release even though it’s technically breaking.

@ElMassimo
Copy link
Contributor

I think the new syntax is unlikely to break existing use cases, as passing a Hash was previously resulting in to_s to be called, which is unlikely to be a valid class or style.

Introducing it in a minor release before removing tokens and classes would provide a smoother migration path, we could even modify these methods to issue out a warning, and suggest the replacement.

@willcosgrove
Copy link
Contributor

willcosgrove commented Jun 24, 2024

passing a Hash was previously resulting in to_s to be called

I think it would have made hyphenated HTML attributes:

div(class: { foo: true }) # => <div class-foo></div>

But I think your point still stands: while technically breaking existing behavior, it is unlikely anyone was relying on it for class and style specifically.

@willcosgrove
Copy link
Contributor

Can we make them issue a deprecation warning and remove them in a later point release? Or maybe I'm the only one using them 😳 In which case, I don't need a slow removal of them for myself.

@brandondrew
Copy link
Contributor

It might be nice if they didn't disappear at the same time as a new way gets introduced, just so the migration isn't as cumbersome

That’s true, but introducing the new way and removing the old way are both breaking changes. We’d either need to keep them around until 3.0 or sneak the new way out in a 1.x release even though it’s technically breaking.

Does having the new way available really break any existing code?

@joeldrapper
Copy link
Collaborator Author

Does having the new way available really break any existing code?

Technically/theoretically, yes. Realistically, no way.

Let’s port the new behaviour back to 1.x and add a deprecation warning to these helpers. I’m happy to work on that. We’re due a 1.11 release anyway.

@joeldrapper joeldrapper force-pushed the remove-tokens-helpers branch from 7ab745f to 8f6cce1 Compare June 24, 2024 20:11
@joeldrapper
Copy link
Collaborator Author

I’m going to ship this to main, which is tracking 2.0. But I’ll back port the other changes and deprecations.

@joeldrapper joeldrapper merged commit de7e37c into main Jun 24, 2024
9 of 11 checks passed
@joeldrapper joeldrapper deleted the remove-tokens-helpers branch June 24, 2024 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants