-
Notifications
You must be signed in to change notification settings - Fork 114
chore: more size reduction #1401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| this.path = path.trim(); | ||
| } | ||
|
|
||
| getQueryString(): string | null { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused
src/shared/services/limitStore.ts
Outdated
| @@ -0,0 +1,47 @@ | |||
| /* | |||
| LimitStore.put('colorado', 'rocky'); | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename to use new function name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/shared/services/limitStore.ts
Outdated
| store[key] = [null, null]; | ||
| } | ||
| store[key].push(value); | ||
| if (store[key].length == LIMIT + 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider using strict equality
| if (store[key].length == LIMIT + 1) { | |
| if (store[key].length === LIMIT + 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/entries/worker.ts
Outdated
| declare const self: ServiceWorkerGlobalScope; | ||
| self.OneSignalWorker = OneSignalServiceWorker; | ||
| // The run() is already called in ServiceWorker.ts, but importing it ensures it's not tree-shaken | ||
| void run; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would need confirmation that this actually works: e.g. does it actually make it to the final bundle? Even then, this approach seems confusing and potentially fragile.
I'm suspicious that it's not needed especially because run is already invoked at the top-level here.
My suggestion would be to either move that line here
import { run } from '../sw/serviceWorker/ServiceWorker';
run();or import the entire file (although the bundle size may take a hit)
import '../sw/serviceWorker/ServiceWorker';
// The run() is already called in ServiceWorker.ts, but importing it ensures it's not tree-shaken
void run;There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both work but for now ive moved run called to worker.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this call be removed then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is removed
Description
1 Line Summary
Details
Systems Affected
Validation
Tests
Info
Checklist
Programming Checklist
Interfaces:
Functions:
Typescript:
Other:
elem of arraysyntax. PreferforEachor usemapcontextif possible. Instead, we can pass it to function/constructor so that we don't callOneSignal.contextScreenshots
Info
Checklist
Related Tickets
This change is