New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
config doesn't understand symbol values #552
Comments
To add some details, you can use a symbol in
|
I don't know that I want to go digging through Uglifiers options to flag what should be a symbol, and not be a symbol, I do know this is a Jekyll bug, as they're the ones that are turning your symbols into Strings in the name of safety (even though Ruby has had a symbol GC for quite some time) and maybe Uglifier could be more relaxed (considering it must in some way pass that to JavaScript which doesn't have the concept of a Ruby symbol (though it does have Symbols now), but that's neither here-nor there in this context.) I would vote take this to Uglifier and see if they can relax a bit, but it's not really their responsibility as much as it is Jekyll's. I'll sit on it for a few days and decide what to do, in the meantime, maybe you could consider taking this bug to Jekyll, and maybe even seeing what Uglifier has to say about it. |
I forgot where I saw it but it seems Jekyll is aware of the problem of not supporting symbols in the Accepting a ruby symbol in option is the design choice of uglifier (in ruby). Not sure this is good or not but they have decided to do that. Since jekyll-assets is a downstream of uglifier, I think it should pass whatever arguments
There are only 5 cases in which you need to detect a string and convert it to what uglifier expects. These being said, as you said above if uglifier is relaxed a bit (taking a string) then maybe there doesn't have to be a change here in |
One more thing: I think you can add a hotfix by using |
YAML was designed explicitly for this type of data. It's a serialization, and data interchange format. If Jekyll wanted only strings they should have opted for JSON.
Then take it up with Jekyll, I'm not in the habit of fixing upstreams bugs. One of my upstreams is causing a bug with another upstream, that doesn't put the responsibility in my hands, and if I do assume responsibility... all it does is make my software less performant, and my job harder when I have to track specific bugs at specific places, so that I can walk back a fix when and if it's ever fixed upstream, or just leave my software with dead and worthless code. I'm not funded by Github, or have Github employees helping me, like Jekyll.
Again, you are putting the responsibility for a bug Jekyll has created, in my hands. This is not a good way to convince me to work around this problem. |
All right. I just read the issue you posted on jekyll: jekyll/jekyll#6558 So at least we understand the situation is uglifier expects a symbol while jekyll uses a string and jekyll-assets, sitting in the middle, doesn't want to tamper with the options. However, I want to point out that the problem here is a bit different than the one you listed, in that it's not really about symbolized keys, but values. Now that the situation is clear and you are aware of it, you may choose to close this thread if you want. But the problem remains: |
This can be fixed in 4.x given we have 2.6 as a requirement now and there is a symbol GC. |
jekyll-assets/lib/jekyll/assets/compressors/uglify.rb
Line 22 in 4e614e8
Cannot set an option to tell uglifier to only keep copyright comments in
_config.yml
.Doesn't work:
Doesn't work:
uglifier is expecting a symbol. However, it seems whatever you write in jekyll
_config.yml
it's passed as a string. Have to modify the code here to handle a string value instead of simply symbolizing the keys. Plus,jekyll-assets
sets default comment option tofalse
. However, if you don't set it, the default inuglifier
is:copyright
, which may be more useful.The text was updated successfully, but these errors were encountered: