-
Notifications
You must be signed in to change notification settings - Fork 122
Ascii uglify flag #363
Comments
??? |
@guybedford seriously, please write some tests around this stuff. |
reverting to "jspm": "0.16.12" fixes the issue |
@lookfirst this is actually server-specific stuff. Try adding a |
This has nothing to do with the server. The JS file that is served up is corrupted. I already have that header in my page. As I said, reverting to the previous version of jspm fixed this issue. |
Also, look at what I'm showing you... it is two JS files. One is the angularjs source code viewed on Github directly and the other is in developer tools. How can a meta header fix that?!? |
@lookfirst @guybedford There is nothing wrong with the builder output. This is an obvious encoding issue: utf8-encoded file is opened as win 1252. You can confirm it with any text editor at hand. I vote for making ascii-only mode configurable through builder. |
@enlait I think you're pretty off there with your analysis... =( |
@lookfirst here's my test:
Loading that in a test page works completely fine for me. It's definitely an encoding issue, but I think the problem you are having is at the network not the filesystem level? |
@guybedford BTW isn't |
bundler.buildStatic() with minification on? |
@lookfirst if you open the file on the filesystem are the characters encoded correctly there? I added a simple test in 490fe61 and it's definitely working. I'd advise checking your server is setup to load and serve utf-8 correctly? |
@guybedford This is a bug. My 'server' is fine. I'm using Google AppEngine. Like I said before, this works fine in the previous version of jspm, it only breaks after you made that utf change. |
Your test is not accurate, you need to use the same characters as what I showed you in the angularjs source code. I also want to see this as part of the output of bundler.buildStatic() and with minification turned on. |
Sure, see 18a2913, this is a test with both sfx and minification of the exact characters. @lookfirst I appreciate your reports, but I hope you can work on your tone in these issue queues. |
I'm starting to debug this further. It only happens when I turn minification on. |
builder installs uglify-js 2.4.24 |
echo "if (isInfinity) formatedText = '\u221e';" > test.js So basically, uglify is encoding things. |
uglifyjs -b ascii_only=false test.js |
Let's not have uglify mess with the source code. =) |
Ok... so as a test, I made sure to send 'Content-Type: application/javascript;charset=utf-8' with the response. Never mind that I shouldn't have to do that. What this does is make the browser handle the javascript ok... or at least it does for Chrome and Safari, Firefox on the other hand totally screws this up. On the left is chrome, on the right is firefox (loading the same exact file): http://take.ms/pkbFi I really recommend telling uglifyjs to not rewrite the unicode. Keep it as ascii. |
I'd be happy to add a flag for this option certainly. |
@guybedford Sweet, I can't upgrade to latest jspm until this happens. =( Seems weird that your tests are passing. The input clearly isn't the same as the output here. I'm also really surprised that I'm the only one having this issue. It really turns up if you use angular with |
Added in b1c09a5. |
👍 thanks @guybedford |
Released in 0.14.10. |
👍 works |
This is angular.js source that is being minified with the builder and it is getting corrupted by the builder.
http://take.ms/y8MGr
latest builder/jspm/systemjs
The text was updated successfully, but these errors were encountered: