Skip to content

CSS: Fix duplicate "JQMIGRATE" prefix in cssProps warning #424

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

Merged
merged 1 commit into from
May 7, 2021

Conversation

Krinkle
Copy link
Member

@Krinkle Krinkle commented May 1, 2021

This prefix is added by migrateWarn(), but in the case of cssProps, the prefix was also in the string passed as parameter.

Test case:

$.cssProps.foo = 1

// Expected:
//> JQMIGRATE: jQuery.cssProps is deprecated

// Actual:
//> JQMIGRATE: JQMIGRATE: jQuery.cssProps is deprecated

This prefix is added by `migrateWarn()`, but in the case of cssProps,
the prefix was also in the string passed as parameter.
wmfgerrit pushed a commit to wikimedia/mediawiki that referenced this pull request May 1, 2021
This is similar to that we did for jQuery 1.9 Migrate in 2014 when
we upgraded from 1.8 to 1.11 (T46740), and this will likely be the
last patch in this series that's suitable for backporting to stable
releases.

After this, we'll start janking stuff out during the 1.37-master
release, slowly working toward its removal.

I've removed the patch file for now since we're far from the original
now, and if any changes do get released by upstream for migrate 3.x
in the next few months we'll have to apply by hand either way.

(Yes, I'm volunteering to do that.)

* Remove needless window.mw guard.
  I think I copied this from our jQuery 1.9 migrate patch,
  when we started the jQuery 3 migration, not realizing that by
  now mw.loader and startup no longer depend on jquery.
  jquery is loaded by an mw.loader callback (as evidenced by the need
  for the window.jQuery lookup pach), so mw.track always exists.
  If it doesn't we have bigger problems.

* Remove migrateTrace code instead of disabling it.

* Change `jquery-migrate` to `jquery_migrate` in mw.track call.
  Otherwise, the name gets transformed into an underscore later on for
  Prometheus, Graphite, Statsv, etc. WMF: in WikimediaEvents/statsd.

* Improve PATCH comments to state upfront whether they change, add,
  or remove something (makes it a little easier for me if/when
  this needs to be rebased).

* Fix duplicate "JQMIGRATE" prefix in cssProps warning.
  Upstream ref jquery/jquery-migrate#424.

Bug: T280944
Change-Id: Ieecf02982468f1c576d2c56b43dcd59d5255bf20
Copy link
Member

@mgol mgol left a comment

Choose a reason for hiding this comment

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

Nice catch, thanks!

@mgol mgol added this to the 3.3.3 milestone May 7, 2021
@mgol mgol merged commit 7214002 into jquery:main May 7, 2021
@Krinkle Krinkle deleted the warn-msg-fix branch May 7, 2021 19:03
@mgol mgol modified the milestones: 3.3.3, 3.4.0 Mar 14, 2022
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.

2 participants