Comments (9)
Thanks a lot Julian for putting together a test case. I'm terribly swamped in work right now but will try to do my best to find out the culprit soon!
from minify.
git bisect shows ff4ee8b as the problem (28 May 2022), usage of template literals
from minify.
interesting, I wasn't aware this was a regression! Thank you so much for looking into it as always 😁
from minify.
Specifically, it's not the fact that strings are converted to template literals, but that \n
and \r
are being converted to literal characters within template literals (eg. 0x5C6E
=> 0x0A
). This ought to be fine, not sure how undici can tell the difference.
from minify.
I've found it. See the end of https://tc39.es/ecma262/#sec-static-semantics-trv, it says that a a sequence of literal <CR><LF>
becomes a 0x0A
in the string, not 0x0D0A
as I expected.
from minify.
that's interesting! this means we get to shave off a few more bytes off our scripts 😆
that's really impressive how you tracked this down!
from minify.
Unfortunately, it's the reverse hehe. Now must keep the sequence \r
as two characters :-( I've pushed out a fix and will be releasing a new version now.
from minify.
Thanks! I'll run this on Monday!
from minify.
everything is fixed! thanks again!!!!
from minify.
Related Issues (20)
- TemplateDelims can eat an entire range operator HOT 1
- javascript with calls to String.raw gets incorrectly minified HOT 17
- Vulnerable version of moment referenced by Javascript unit tests HOT 2
- Minify incorrectly removes spaces after `</code>` element that contains a template HOT 1
- SVG xmlns attribute could be stripped when inside HTML documents HOT 2
- Builds fails on 32 bit systems HOT 9
- Minifying CSS in a HTML document which uses Mustache template, incorrectly minifies HOT 4
- How to minify HTML, but only HTML and JS i.e. excluding CSS HOT 2
- Javascript option to preserve string newline or char codes HOT 8
- xmlns attribute is required for single SVG file HOT 3
- XML CDATA minify issue HOT 12
- Minifier always transforms `!(string)` to `!1` even if the string is empty. HOT 1
- Removing parenthesis of expression containing optional chaining can make different output HOT 1
- Accessing property of object should be considered as side effect-able expression. HOT 3
- CLI doesn't handle directory inputs with trailing forward slashes on Windows HOT 1
- `npm i @tdewolff/minify` fails on Windows HOT 3
- `undefined` can be redeclared in function body
- Add arm64 builds for node package
- HTML: closing tag for '<p>' purged HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minify.