Giter Site home page Giter Site logo

Comments (14)

douglascrockford avatar douglascrockford commented on August 25, 2024 3

JSMin is written in C. You could have easily distinguished this project from your Python crap.

If it is any comfort to you, you are not the first to commit this blunder.

from jsmin.

Lazerbeak12345 avatar Lazerbeak12345 commented on August 25, 2024

I didn't realize that #23 was a dupe of this till now, but I have more insight as to what the problem is, and a workaround there, if you are interested.

from jsmin.

louking avatar louking commented on August 25, 2024

I'm seeing the same problem, just came looking for this here.

          d3.select(`.tablerow-${year} .date`).text(`${formatDate(d.date)}/${year}`);
          d3.select(`.tablerow-${year} .count`).text(d.count);

is getting translated to

d3.select(`.tablerow-${year}.date`).text(`${formatDate(d.date)}/${year}`);d3.select(`.tablerow-${year}.count`).text(d.count);

Note the spaces missing before .date and .count in the two statements

from jsmin.

louking avatar louking commented on August 25, 2024

I bumped into this again. Is this repo abandoned?

If anyone finds this I decided to use rjsmin, which comes included with webassets (see https://webassets.readthedocs.io/en/latest/builtin_filters.html#webassets.filter.rjsmin.RJSMin). rjsmin does not have this issue.

from jsmin.

thradams avatar thradams commented on August 25, 2024

from jsmin.

louking avatar louking commented on August 25, 2024

Maybe the encode (code page) you are using?

Not sure what this means. My compressed file (on my windows development system) is coming up as UTF-8 from jsmin (and rjsmin, which compresses properly). I see the same issue in my production system which is CentOS 7. I can check the encoding there if that seems important.

I'm using jsmin-3.0.1. I'm running it via flask-assets 2.0 using webassets 2.0.

What else could be affecting this behavior?

from jsmin.

thradams avatar thradams commented on August 25, 2024

from jsmin.

louking avatar louking commented on August 25, 2024

I'll see if I can come up with something -- may be a couple of days. Thanks.

If "not small" is ok, you can use this one.

charts.zip

e.g., https://github.com/louking/loutilities/blob/a1a2789c815b077fb08fe58a23d0db3a0337090f/loutilities/tables-assets/static/charts.js#L392 is being compressed as d3.selectAll(`${that.options.containerselect}.focuslabel-${label}`).style("display",null);

from jsmin.

louking avatar louking commented on August 25, 2024

I edited the previous comment and want to make sure you saw my edits. Please let me know if you need me to come up with a smaller example.

from jsmin.

louking avatar louking commented on August 25, 2024

It turns out it was pretty easy to recreate in a small example. In my environment (flask-assets 2.0; webassets 2.0; jsmin 3.0.1), test.js gets compiled by jsmin into testjs.js, in the enclosed zip file.

douglascrockford-JSMin#22.zip

asset_bundles = {
    'test_js': Bundle(
        'test.js',
        
        filters='jsmin',
        output='gen/testjs.js',
    ),

   ...

from jsmin.

thradams avatar thradams commented on August 25, 2024

I edited the previous comment and want to make sure you saw my edits. Please let me know if you need me to come up with a smaller example.

Using your file I got:
d3.selectAll(${that.options.containerselect} .focuslabel-${label}).style("display",null);

Are you sure you are using the latest version?

from jsmin.

louking avatar louking commented on August 25, 2024

I installed jsmin 3.0.1 from pypi. At least that is what pip freeze tells me. Is there something later than that?

From my requirements.txt file:

jsmin==3.0.1

from jsmin.

louking avatar louking commented on August 25, 2024

I installed this as a pip upgrade, I think from jsmin 2.2.2 (not sure because I didn't capture the original install in the log I keep -- grr). Is it possible that the old executable is being used somehow in that use case? Just grasping at straws here...

from jsmin.

louking avatar louking commented on August 25, 2024

Many apologies. Looking at pypi I see now that the correct repo is https://github.com/tikitu/jsmin/

I am not sure how I found your repo initially.

Sorry for any wasted effort.

from jsmin.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.