Problem/Motivation

I discovered today that in addition to the dialogue itself, we have a fairly large amount of jquery code.

I believe that in order to make switching to a native dialog easier in the future, we need to get rid of jQuery that is not related to the functionality of the dialog.

In this task I simplified the code in dialog.ajax.js
Now there are only $ associated with the jQueryUI dialog options.

Release notes snippet

probably we need to add change record for `dialogButtonsChange` Event.

Issue fork drupal-3460979

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

finnsky created an issue. See original summary.

finnsky’s picture

Version: 11.0.x-dev » 11.x-dev

finnsky changed the visibility of the branch 3460979-reduce-jquery-usage to hidden.

finnsky’s picture

Title: Reduce jQuery usage » Reduce jQuery usage in dialog.ajax.js
Issue summary: View changes
finnsky’s picture

Status: Active » Needs review

VladimirAus made their first commit to this issue’s fork.

vladimiraus’s picture

Status: Needs review » Reviewed & tested by the community

Looks good.

nod_’s picture

Status: Reviewed & tested by the community » Needs work

I like it, we do need to add the deprecation of the jQuery event here. And introduce a BC layer for events so that calling $dialog.trigger('event'); triggers a deprecation and generate the custom DOM event.

finnsky’s picture

Status: Needs work » Needs review

Added BC and change record

smustgrave’s picture

Status: Needs review » Needs work

Possible to get a deprecation test.

finnsky’s picture

Not sure how this deprecation check work in Drupal.
I wrote Nightwatch test. But is seems still not working as it should.

https://gyazo.com/825ac43bc3dea0bb303cc214a7fab597

Depreciation messages presented in console. script js aswell.

finnsky’s picture

That is weird. But in logs i see that test was trigered in test environment.

finnsky’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

JS skill is mid at best.

But deprecation and test coverage looks correct to me.

Testing the changes on dialog popups on views and block_layout and everything appears to be working as before.

Going to go on a limb and say this is good.

finnsky’s picture

rebased, seems ready to go

finnsky’s picture

Issue tags: -beta target
finnsky’s picture

Rebased. Review needed

¯\_(ツ)_/¯

nod_’s picture

Status: Reviewed & tested by the community » Needs work

Thanks, solid work, still a few things to address. Thanks for your patience!

finnsky’s picture

Status: Needs work » Needs review

I've added one comment about jQuery selectors.
All other feedbacks are fixed.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new1.51 KB

The Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

finnsky’s picture

Status: Needs work » Needs review

@nod_ thank you for feedbacks. i fixed everything according them.

I agree - we need to care about jquery selectors in own task and deprecate them globally at once.

please review!

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new1.51 KB

The Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

finnsky’s picture

Status: Needs work » Needs review
needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new1.51 KB

The Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

nod_’s picture

Status: Needs work » Needs review
Issue tags: +no-needs-review-bot
smustgrave’s picture

Status: Needs review » Needs work

Believe needs a manual rebase now, probably would update the deprecations for 11.2 now :(

finnsky’s picture

Status: Needs work » Needs review

rebased and updated versions

smustgrave’s picture

Status: Needs review » Needs work

Sorry to do it but appears to need another rebase.

finnsky’s picture

Status: Needs work » Needs review

Rebased. Please review

smustgrave’s picture

Status: Needs review » Needs work

Sorry slipped my radar, needs a rebase again. Please ping me so I can add to top of my list

If you are another contributor eager to jump in, please allow the previous poster at least 48 hours to respond to feedback first, so they have the opportunity to finish what they started!

vladimiraus’s picture

Status: Needs work » Needs review

+1 for RTBC.

smustgrave’s picture

Status: Needs review » Needs work

Seems to have test failures now though, functional, javascript, and nightwatch

finnsky’s picture

Status: Needs work » Needs review

@vladimiraus thank you for care about this issue ;)

@smustgrave here usual random failures. all green now.

smustgrave’s picture

Status: Needs review » Needs work

Seems to need another rebase

@finnsky or @VladimirAus feel free to self RTBC after

If you are another contributor eager to jump in, please allow the previous poster at least 48 hours to respond to feedback first, so they have the opportunity to finish what they started!

finnsky’s picture

Status: Needs work » Needs review

Rebased. Thank you Please review.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Seems good now

finnsky’s picture

Rebased. Please review

catch’s picture

This looks like good clean-up and a nice net reduction in code even without taking into a account the new test coverage, but it needs someone more js-competent than me to do a final review so tagging for front end framework managers.

  • nod_ committed bd70656b on 11.x
    Issue #3460979 by finnsky, smustgrave, nod_, catch: Reduce jQuery usage...
nod_’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -no-needs-review-bot, -Needs frontend framework manager review

:)

Committed bd70656 and pushed to 11.x. Thanks!

nod_’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

acbramley’s picture

The test here caused a very frequent random fail #3521621: [random test failure] jQuery Events Deprecation Tests (Tests/dialogDeprecations) let's try to a) be careful with random ms waits in tests (wait for elements instead) and b) not use nightwatch wherever possible.