Skip to content

Conversation

@fadi-george
Copy link
Contributor

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

Description

1 Line Summary

  • more size reduction
// old
 build/releases/OneSignalSDK.page.js
  Size limit: 420 B
  Size:       420 B gzipped
  
  build/releases/OneSignalSDK.page.es6.js
  Size limit: 46.6 kB
  Size:       46.6 kB gzipped
  
  build/releases/OneSignalSDK.sw.js
  Size limit: 13.44 kB
  Size:       13.44 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: 46.23 kB
  Size:       46.23 kB gzipped
  
  build/releases/OneSignalSDK.sw.js
  Size limit: 13.44 kB
  Size:       13.44 kB gzipped
  
  build/releases/OneSignalSDK.page.styles.css
  Size limit: 8.81 kB
  Size:       8.8 kB  gzipped
  

Details

  • more underscore prefix renames of class methods
  • change usage of model tag type (string) to ModelChangeTagValue
  • remove src/core/objects/PropertiesObject.ts through simple object creation
  • simplify ModelChangeTags value from string to number
  • simplify DismissPrompt value from string to number
  • break up userdirector class into functions
  • move getRetryIndicator to loading.ts

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 17, 2025 19:27
@@ -1,52 +0,0 @@
// Light weight JS to detect browsers push notification capabilities
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to user agent detect

Base automatically changed from fg/size-reduction-4 to main October 24, 2025 00:53
@fadi-george fadi-george merged commit b70f071 into main Oct 24, 2025
1 check passed
@fadi-george fadi-george deleted the fg/size-reduction-5 branch October 24, 2025 00:54
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