Comments

droplet created an issue. See original summary.

dawehner’s picture

We reverted that before the commit in order to have a patch which was easier to understand. Of course your code is a bit better, but I'm wondering whether we could go through more code and apply these kind of optimizations.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

joshmiller’s picture

Status: Needs review » Reviewed & tested by the community

Applies cleanly, good optimization refactorization.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, remove-return.patch, failed testing. View results

joshmiller’s picture

Status: Needs work » Reviewed & tested by the community

Re-queued the test, it failed on composer for some reason?

alexpott’s picture

Status: Reviewed & tested by the community » Needs review

It'd be great to get answer to @dawehner's

Of course your code is a bit better, but I'm wondering whether we could go through more code and apply these kind of optimizations

Especially since the issue title makes someone expect a much larger patch.

If we want to focus on just this one - fine but the issue title needs fixing.

alexpott’s picture

I guess we could do the same here:

        response.stylesheets.forEach((url) => {
          editor.document.appendStyleSheet(url);
        });

And maybe here

      // List of fields IDs on which to bind the event listener.
      // Create an array of IDs to use with jQuery.
      Object.keys(drupalSettings.copyFieldValue || {}).forEach((element) => {
        ids.push(element);
      });
dawehner’s picture

Do we know whether there is an eslint rule covering this?

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

nod_’s picture

Status: Needs review » Needs work

need reroll :)

Pooja Ganjage’s picture

StatusFileSize
new1.02 KB

Hi,

Creating a patch for this issue.

Please review the patch.

Thanks.

Pooja Ganjage’s picture

Status: Needs work » Needs review
anmolgoyal74’s picture

StatusFileSize
new1.02 KB
new339 bytes

Fixed CS issues.

Madhu kumar’s picture

applied patch remove-return.patch and working as expected.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

vikashsoni’s picture

Patch not working in drupal-9.3.x-dev
Needs to re-roll
giving error while going to apply patch #18

nod_’s picture

Title: [Clean Code] Remove unnecessary returns » Follow-up: remove unnecessary returns in ajax.es6.js
Version: 9.4.x-dev » 10.0.x-dev
Status: Needs review » Needs work

At the moment patches are applied to the 10.x branch first so a patch or MR for that version is needed.

I'm ok with the change itself, just need the right version for the 10.x branch :)

tom konda’s picture

Status: Needs work » Needs review
StatusFileSize
new929 bytes

I rerolled the patch #18 for the 10.0.x branch.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

Needs a reroll for 10.1 now that es6 files are no longer used

akram khan’s picture

StatusFileSize
new1.07 KB
new440 bytes

reroll against 10.1 address #25

akram khan’s picture

Status: Needs work » Needs review
nod_’s picture

Title: Follow-up: remove unnecessary returns in ajax.es6.js » Follow-up: remove unnecessary returns in ajax.js
Version: 10.0.x-dev » 10.1.x-dev
Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs reroll

Went through all core calls of .forEach() and .map() in JS files. Found one possible update in olivero but that's it. The rest would require more involved refactoring.

Given that, RTBC it's small and painless to keep that scoped to ajax.js.

  • longwave committed 5ee487c on 10.0.x
    Issue #2927407 by Akram Khan, anmolgoyal74, droplet, Pooja Ganjage, Tom...
  • longwave committed 8a3da3d on 10.1.x
    Issue #2927407 by Akram Khan, anmolgoyal74, droplet, Pooja Ganjage, Tom...
longwave’s picture

Committed and pushed 8a3da3d43f to 10.1.x and 5ee487c087 to 10.0.x. Thanks!

longwave’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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