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

Deprecate unused evented utility #3125

Merged
merged 7 commits into from
Oct 31, 2021
Merged

Conversation

fredden
Copy link
Contributor

@fredden fredden commented Oct 26, 2021

This is related to #2547, but is only step one of two listed there

Changes proposed in this pull request:
I found #2547 while looking for a task to get started with. This is my first contribution to this project.
The issue mentions marking evented as deprecated and removing this. This pull request marks that utility as deprecated so we can safely remove the same in the future. This pull request introduces no functional changes.

Reviewers should focus on:
I'm unsure what to suggest here as the changes shouldn't have any impact on existing functionality, but is instead future-planning.

Necessity

  • Has the problem that is being solved here been clearly explained?
  • If applicable, have various options for solving this problem been considered?
  • For core PRs, does this need to be in core, or could it be in an extension?
  • Are we willing to maintain this for years / potentially forever?

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Backend changes: tests are green (run composer test).
  • Core developer confirmed locally this works as intended.
  • Tests have been added, or are not appropriate here.

Required changes:

Copy link
Sponsor Member

@askvortsov1 askvortsov1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, thank you very much! Aside from the suggestion in the code, the only minor idea I have is changing the wording to "the evented util is deprecated and will be removed in v2.0 of Flarum". Otherwise, LGTM!

As to other steps, no bundled extensions currently use this util, so no action is needed from the Flarum side, so this issue is effectively done with this PR. Thank you very much for the contribution!

js/src/common/utils/evented.js Outdated Show resolved Hide resolved
Copy link
Member

@davwheat davwheat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm hesitant towards this, personally.

I think we should use the existing debug warning helper we have, instead, to prevent firing unnecessary console messages in production forums: https://github.com/flarum/core/blob/master/js/src/common/helpers/fireDebugWarning.ts

Furthermore, I'd prefer us to use a more descriptive message for this and to store it in a variable rather than repeating it.

Maybe...

"The `evented` util is deprecated and will be removed in Flarum 2.0. For more info, please see https://github.com/flarum/core/issues/2547"

I know very few or no extensions actually use this, but it sets a precedent for future deprecations. (And is very similar to the tootips message.)

To be clear, there's nothing inherently wrong with this PR, and a big thank you goes out to @fredden. First time PRs are nerve-wracking, and I know that from experience! ❤️

@fredden
Copy link
Contributor Author

fredden commented Oct 27, 2021

Thanks for the feedback. I'll make the suggested changes and ask for another review.

@fredden fredden requested a review from davwheat October 27, 2021 18:40
@askvortsov1 askvortsov1 merged commit c44cf42 into flarum:master Oct 31, 2021
@SychO9 SychO9 linked an issue Oct 31, 2021 that may be closed by this pull request
@fredden fredden deleted the deprecate-evented branch November 1, 2021 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecate and remove evented util
4 participants