Skip to content

chore: more size reduction for bundled files#1398

Merged
fadi-george merged 5 commits intomainfrom
fg/size-reduction
Oct 17, 2025
Merged

chore: more size reduction for bundled files#1398
fadi-george merged 5 commits intomainfrom
fg/size-reduction

Conversation

@fadi-george
Copy link
Copy Markdown
Contributor

@fadi-george fadi-george commented Oct 14, 2025

Description

1 Line Summary

  • more size reduction via underscore prefixing
// old
  build/releases/OneSignalSDK.page.js
  Package size is 1 B less than limit
  Size limit: 421 B
  Size:       420 B gzipped
  
  build/releases/OneSignalSDK.page.es6.js
  Size limit: 49.43 kB
  Size:       49.43 kB gzipped
  
  build/releases/OneSignalSDK.sw.js
  Size limit: 13.62 kB
  Size:       13.62 kB gzipped
  
  build/releases/OneSignalSDK.page.styles.css
  Size limit: 8.81 kB
  Size:       8.8 kB  gzipped

// new
  build/releases/OneSignalSDK.page.js
  Size limit: 420 B
  Size:       420 B gzipped
  
  build/releases/OneSignalSDK.page.es6.js
  Size limit: 48.83 kB
  Size:       48.82 kB gzipped
  
  build/releases/OneSignalSDK.sw.js
  Size limit: 13.62 kB
  Size:       13.62 kB gzipped
  
  build/releases/OneSignalSDK.page.styles.css
  Size limit: 8.81 kB
  Size:       8.8 kB  gzipped

Details

  • adds more underscore prefixing to more class methods
  • adds macro for quickly renaming symbols

Systems Affected

  • WebSDK
  • Backend
  • Dashboard

Validation

Tests

Info

Checklist

  • All the automated tests pass or I explained why that is not possible
  • I have personally tested this on my machine or explained why that is not possible
  • I have included test coverage for these changes or explained why they are not needed

Programming Checklist
Interfaces:

  • Don't use default export
  • New interfaces are in model files

Functions:

  • Don't use default export
  • All function signatures have return types
  • Helpers should not access any data but rather be given the data to operate on.

Typescript:

  • No Typescript warnings
  • Avoid silencing null/undefined warnings with the exclamation point

Other:

  • Iteration: refrain from using elem of array syntax. Prefer forEach or use map
  • Avoid using global OneSignal accessor for context if possible. Instead, we can pass it to function/constructor so that we don't call OneSignal.context

Screenshots

Info

Checklist

  • I have included screenshots/recordings of the intended results or explained why they are not needed

Related Tickets



This change is Reviewable

@fadi-george fadi-george requested review from jkasten2 and sherwinski and removed request for jkasten2 October 14, 2025 23:39
@fadi-george fadi-george changed the title More Size Reduction chore: more size reduction for bundle Oct 14, 2025
@fadi-george fadi-george changed the title chore: more size reduction for bundle chore: more size reduction for bundled files Oct 14, 2025
@fadi-george fadi-george force-pushed the fg/bell-fixes branch 4 times, most recently from fb5886c to 24abd6d Compare October 16, 2025 21:53
Base automatically changed from fg/bell-fixes to main October 17, 2025 16:04
@fadi-george fadi-george merged commit c20a21f into main Oct 17, 2025
2 checks passed
@fadi-george fadi-george deleted the fg/size-reduction branch October 17, 2025 16:26
@github-actions github-actions Bot mentioned this pull request Feb 27, 2026
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.

2 participants