Closed (fixed)
Project:
EU Cookie Compliance (GDPR Compliance)
Version:
8.x-1.14
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
25 Jan 2021 at 13:08 UTC
Updated:
5 Oct 2022 at 16:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
svenryen commentedI'm reclassifying this as a feature request, since it's not really considered a bug that the script is not minified.
Comment #3
reszliprobably has to do with the fact that it is deferred, so Advagg will not pick it up: https://www.drupal.org/project/advagg/issues/3072469 (also related https://www.drupal.org/project/drupal/issues/1587536#comment-13852581)
eu_cookie_compliance: version: VERSION js: js/eu_cookie_compliance.js: { attributes: { defer: true } } dependencies: ...so it probably won't be possible to aggregate it with the rest, but it could be minified nonetheless
Comment #4
reszliI guess this would be like having both the original (un-minified) and the minified version in the repo, but include the minified one in the library with the {minified: true} flag
the minification needs to happen on every change, will be part of every patch / MR which changes the original file
@svenryen do you have a specific process / tool in mind to obtain the minified version?
Comment #5
svenryen commentedNo, I don't have any strong preference for tool to generate the minified version.
Comment #6
selinav commentedHello,
Will it be available in a future version ?
Best regards
Comment #8
svenryen commented@selinav not a high priority right now, but when we finally get around to a version 2, this will be addressed.
Comment #9
svenryen commentedComment #10
svenryen commentedComment #13
jeroentComment #14
jeroentFor now, I created a patch that replaces the js file with a minified version.
Comment #15
svenryen commentedThanks @JeroenT - what tool do you use for the minifying? We would need to distribute the un-minified version as well so that people can contribute. Could you create a task runner and a setup for generating a minified script?
Comment #16
jeroentI've added an npm command that minifies the js file.
Comment #17
svenryen commentedThanks! I'll take a look and merge.
Comment #18
svenryen commented@JeroenT, on my installation with a fairly default setup I get this error in Console and no banner is shown:
Also, how would this apply to the module's events API and functions that other modules and sites leverage such as the hasAccess(category) function?
Could you take a look?
Comment #19
guardiola86 commentedI'm getting the same error as @svenryen after applying the changes
Comment #20
jeroentI made some changes to the script that generates the JS file. Let's see if that works better.
Comment #23
svenryen commentedThanks for the work. I'll tag @DropSolid for a check if the APIs still function with the script minified.
Comment #24
svenryen commentedI wonder if we have a regression and the API isn't working any longer. I wasn't able to make the API work in the non-minified state when following the example in the readme file from the module, so I doubt the API calls would work when minified. Anyways this will have to wait till I hear back from DropSolid.
I added the latest code changes to the minified file.
Comment #25
jeroentI've created a patch that works with 8.x-1.22.
Comment #27
svenryen commented@JeroenT, you've done a fantastic job!
I can confirm the event API still works with the latest set of files from your issue branch.
I've tested and all seems to work well so I'll commit this to the module and tag a new release.