Skip to content

Conversation

matux
Copy link
Contributor

@matux matux commented Jul 22, 2025

Description of the change

Turns out, using concatenation results in a smaller minified file as the transpiler...

Turns this interpolated strings

export const defaultRollbarJsUrl = 'https://${cdnHost}/rollbarjs/refs/tags/v${version}/rollbar.min.js`;

into

var u="https://".concat("cdn.rollbar.com","/rollbarjs/refs/tags/v").concat("3.0.0-alpha.3","/rollbar.min.js");

While if we use concatenation, it turns

export const defaultRollbarJsUrl = 'https://' + cdnHost + '/rollbarjs/refs/tags/v' + version + '/rollbar.min.js';

into a static string:

"https://cdn.rollbar.com/rollbarjs/refs/tags/v3.0.0-alpha.3/rollbar.min.js"

This takes the size of rollbar.snippet.js back to its usual 6581 bytes.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Maintenance
  • New release

@matux matux self-assigned this Jul 22, 2025
@matux matux enabled auto-merge (squash) July 22, 2025 19:21
@matux matux merged commit e1838c8 into master Jul 22, 2025
4 checks passed
@matux matux deleted the matux/concat-all-the-things branch July 22, 2025 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants