Deleted to many files which include jquery.once

Created on 4 March 2024, 9 months ago
Updated 19 March 2024, 8 months ago

Hello and thanks for the module!
My question is:
I am workin on a very, very big project, with a lot of files. In order to upgrade the site to D10, I had to remove jquery.once from many places, and also for many projects! So there would be a bit of problem to revoke all of these files...
So, any suggestions, solutions?
Thank you all up in front and looking forward for your answers!
Best regards,
Dusan

💬 Support request
Status

Fixed

Version

1.0

Component

Documentation

Created by

🇦🇹Austria dv@blinker.digital

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @dv@blinker.digital
  • Issue was unassigned.
  • Status changed to Fixed 9 months ago
  • 🇨🇭Switzerland florianmuellerch Aarau, Switzerland

    Hi @dusandelucia

    The short answer is: "It depends" :-)

    I personally would not migrate any custom code, if you just started and then installed this module. Every jquery.once usage will continue to work as usual, so there's no need to change your code.

    However all other modules most likely already have changed their own code and use the built-in Drupal.once(), which is also fine.

    I would avoid using both jQuery.once() and Drupal.once() in the same module, let alone in the same file. I would decide on one of the two and then consistently only use that, to avoid problems.
    In fact, I also have a project running that uses now both Drupal.once() and jQuery.once() in the same large module, but it runs just fine - if the two libraries do their own jobs and don't intersect with each other.

    Hope that helps - happy site building!

  • 🇦🇹Austria dv@blinker.digital

    Ok, that helps. The custom code will not be migrated than. Many thanks!

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

Production build 0.71.5 2024