• Robert Knight's avatar
    Limit line length in minified JS bundles · 2233d721
    Robert Knight authored
    Limit the line length in minified bundles to make them easier to examine in
    various tools which don't like very long source lines, and also mitigate an
    issue with stack traces in Firefox.
    
    Firefox stack traces report column numbers in Unicode code points whereas Sentry
    expects UTF-16 code units. If the input source contains Unicode characters which
    require multiple UTF-16 code units to represent then processed stack traces in
    Firefox will point to the wrong location.
    
    One of our dependencies (Showdown) contains a long string of emojis, which
    require multiple UTF-16 units to represent, and Terser by default tries to
    compress the code into as few lines as possible. The combined result of this is
    that stack traces from Firefox could end up being resolved to a location far
    from what is expected.
    
    Though it is not a complete fix for the issue, limiting the length of lines
    effectively mitigates this problem as only code nearby (on the same line as)
    these characters in the output is affected.
    
    I did also try Terser's `ascii_only` output option, but that increased the
    bundle size by 2% and has more potential for unexpected consequences elsewhere.
    2233d721
Name
Last commit
Last update
.github Loading commit data...
bin Loading commit data...
dev-server Loading commit data...
docs Loading commit data...
embedding-examples Loading commit data...
images Loading commit data...
requirements Loading commit data...
scripts Loading commit data...
src Loading commit data...
.babelrc Loading commit data...
.dockerignore Loading commit data...
.eslintignore Loading commit data...
.eslintrc Loading commit data...
.gitignore Loading commit data...
.npmignore Loading commit data...
.npmrc Loading commit data...
.prettierignore Loading commit data...
.python-version Loading commit data...
CODE_OF_CONDUCT Loading commit data...
Dockerfile Loading commit data...
Jenkinsfile Loading commit data...
LICENSE Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
codecov.yml Loading commit data...
gulpfile.mjs Loading commit data...
package.json Loading commit data...
pyproject.toml Loading commit data...
requirements-dev.in Loading commit data...
rollup-boot.config.mjs Loading commit data...
rollup-tests.config.mjs Loading commit data...
rollup.config.mjs Loading commit data...
tailwind.config.mjs Loading commit data...
tox.ini Loading commit data...
tsconfig.json Loading commit data...
yarn.lock Loading commit data...