- Issue created by @stox
- ๐จ๐ญSwitzerland florianmuellerch Aarau, Switzerland
Hi @stox!
Good idea :) I just needed the module asap, that's why I threw it together like that.
I'm not entirely sure how I could control composer dependencies in particular, especially as Drupal itself does add a composer file when the project is released and packed... Would you or anyone else mind making a PR or a patch with a draft?Thanks!
- ๐ฎ๐ณIndia chetan 11
chetan 11 โ made their first commit to this issueโs fork.
- @chetan-11 opened merge request.
- ๐ฎ๐ณIndia chetan 11
Hi,
I have added composer file for the above module, please check the raised MR & let me know if anything needs to be added.
Thanks. - Status changed to Needs work
about 1 year ago 3:24pm 26 October 2023 - ๐จ๐ฆCanada dalin Guelph, ๐จ๐ฆ, ๐
Why not require
"npm-asset/jquery-once": "^2.2"
rather than jQuery? It lists jQuery as a dependency, so it'll sort it out (especially if you have a specific version of jQuery required in your root composer.json).Also, this commit would need to remove the included files from these libraries, and add some documentation pointing to https://asset-packagist.org/
- ๐จ๐ญSwitzerland florianmuellerch Aarau, Switzerland
I've just released official 1.0 of the module, however I'm totally fine if you get a tested and working solution in your MR, I would merge that and release 1.1 from that.
I just would like more feedback from people on this, and the MR would have to be adapted.
- Status changed to Needs review
about 1 year ago 10:28am 27 October 2023 - Status changed to Needs work
about 1 year ago 4:35pm 27 October 2023 - ๐จ๐ฆCanada dalin Guelph, ๐จ๐ฆ, ๐
I don't think the MR can work yet. We still needs some changes mentioned in #7:
- remove the included files from these libraries in
jquery_once/lib
- the files will then be at
/libraries/[library]
sojquery_once.libraries.yml
will need to be adjusted - add some documentation (a README.md?) pointing people to https://asset-packagist.org/ because you need to add a few snippets to your root
composer.json
- bonus: add a
hook_requirements()
to check if the library is where we expect.
- remove the included files from these libraries in
- ๐จ๐ฆCanada RobLoach Earth
Thanks for putting together the module. I did laugh when I saw it.
The library is licensed MIT or GPL-2, so there's no problem copy/pasting it directly into the module. Happy to make consumption and maintenance easier. It is available on Packagist as a `component` type:
https://packagist.org/packages/robloach/jquery-onceThough, that could complicate things, as it specifies a dependency on components/jquery. Removing the defined dependency may make things easier?
Also, if anyone wants to help maintain the library, lemme know in the github.
- ๐จ๐ฆCanada joseph.olstad
Ya this module saved one of my clients months of very complicated high-risk js work. I tried refactoring away from jquery once but due to the weakness of the replacement once it just was too complicated.