-
Notifications
You must be signed in to change notification settings - Fork 32
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
feat: web notification #147
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/devrsi0n/chirpy/88YSzp2ANEghkqBFvR2baZpnLKNK |
📝 Changed routes:
And 3 other routes: Commit 2664175 (https://chirpy-ikc4pjubg-devrsi0n.vercel.app). |
jest coverage report 🧪Total coverage
Show new covered files 🌑Coverage of new files
Show files with reduced coverage 🔻Reduced coverage
|
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
📦 Next.js Bundle AnalysisThis analysis was generated by the next.js bundle analysis action 🤖
|
Page | Size (compressed) |
---|---|
global |
161.02 KB (🟡 +1.19 KB) |
Details
The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.
Any third party scripts you have added directly to your app using the <script>
tag are not accounted for in this analysis
If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!
Eighteen Pages Changed Size
The following pages changed size from the code in this PR compared to its base branch:
Page | Size (compressed) | First Load | % of Budget (250 KB ) |
---|---|---|---|
/ |
25.91 KB |
186.93 KB | 74.77% (+/- <0.01%) |
/404 |
24.15 KB |
185.17 KB | 74.07% (🟢 -0.01%) |
/500 |
23.05 KB |
184.07 KB | 73.63% (🟢 -0.01%) |
/analytics/[domain] |
23.22 KB |
184.24 KB | 73.70% (🟢 -0.01%) |
/auth/delete-confirmation |
22.57 KB |
183.59 KB | 73.44% (🟢 -0.01%) |
/auth/redirecting |
22.79 KB |
183.81 KB | 73.53% (🟢 -0.01%) |
/auth/sign-in |
24.14 KB |
185.16 KB | 74.06% (+/- <0.01%) |
/auth/welcome |
30.06 KB |
191.08 KB | 76.43% (🟢 -0.05%) |
/blog |
26.65 KB |
187.67 KB | 75.07% (🟢 -0.01%) |
/blog/[...slug] |
29.53 KB |
190.55 KB | 76.22% (+/- <0.01%) |
/dashboard |
39.9 KB |
200.92 KB | 80.37% (🟢 -0.06%) |
/docs/[[...slug]] |
26.65 KB |
187.67 KB | 75.07% (🟢 -0.01%) |
/privacy-policy |
25.4 KB |
186.42 KB | 74.57% (🟢 -0.01%) |
/profile |
32.2 KB |
193.22 KB | 77.29% (🟢 -0.06%) |
/terms-of-service |
25.39 KB |
186.41 KB | 74.56% (+/- <0.01%) |
/theme/[domain] |
159 KB |
320.01 KB | 128.01% (🔴 +44.98%) |
/widget/comment/[pageURL] |
150.68 KB |
311.69 KB | 124.68% (🔴 +44.68%) |
/widget/comment/details/[commentId] |
150.3 KB |
311.32 KB | 124.53% (🔴 +44.63%) |
Details
Only the gzipped size is provided here based on an expert tip.
First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link
is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.
Any third party scripts you have added directly to your app using the <script>
tag are not accounted for in this analysis
The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 10% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.
14f8b16
to
a641484
Compare
const buttonChildren = ( | ||
<> | ||
{isLoading ? <Loader tw="animate-spin w-5 h-5" /> : <Send size="14" />} | ||
<span>{'Post'}</span> |
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.
Post is a constant, delete {' '} better
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.
Yes
* fix(deps): update dependency framer-motion to v6.2.4 (#165) Co-authored-by: Renovate Bot <bot@renovateapp.com> * feat: web notification (#147) * feat: web notification * feat: send message with a test request * feat: set up mutation event * feat: send notification to site owner * fix: window is undefined * feat: add title and icon to notification * feat: focus on existing tab or open a new tab after click a notification * feat: add body to notification * fix: refactor the sw * feat: only register notification when user is posting * feat: add a popover to ask user notification permission * fix: delete notification subscription * feat: add a toast to notify user a new service worker is available * feat: add notification of reply * feat: save like notificatioin * fix: delete like notification failed * feat: add comment deleted notificatioin * fix: prettier is not working * feat: delete the existing comment after deleted a comment * fix: build error * fix: ut error * fix: cypress error * docs: update progress * fix: should redirect to previous page after logging in (#172) * fix: fix bug Footer should be sticky to the bottom * fix: fix bug Footer should be sticky to the bottom * fix: fix bug should redirect to previous page after logging in * fix: change sessionStorage name * fix: change * fix: change sessionStorage and localSession key * fix: sessionStorage bugfix Co-authored-by: 吴兴利 <xinglee@Xinglees-MacBook-Pro.local> * refactor: use next-auth callback url (#174) * fix: use next-auth callback url * fix: remove stale comment * fix: update comment * fix: remove a duplicated environment variable * fix: remove comment script url on blog page * fix: add notification type seed * feat: add environment badges (#179) * chore(deps): update dependency superjson to 1.8.1 [security] (#178) Co-authored-by: Renovate Bot <bot@renovateapp.com> * fix(deps): update dependency type-fest to v2.11.2 (#166) Co-authored-by: Renovate Bot <bot@renovateapp.com> * Polish web notification (#181) * fix: polish favicon * fix: don't show popup if user deny the notification permission * feat: add a playground page for testing * fix: remove unused variables * fix(deps): update tiptap packages (#167) Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Qing <7880675+devrsi0n@users.noreply.github.com> * fix: polish favicon (#183) * fix(deps): update dependency urql to v2.1.3 (#171) * Fix: database schema migration (#186) * fix: migrate database * fix: squash notification database schema * fix: remove alter * feat: add hasura ci/cd github action * Feat: use on-demand ISR and use middleware to protect API and pages (#188) * fix: prepare for next-auth middleware * fix: use middleware to check the authorized * fix: use next-auth middleware to protect pages * feat: use ondemand revalidate when hasura events happening * fix: enable swc minify * fix: squash schema * fix: cypress test * fix: missing env * chore: polish readme image * fix: cypress index page * fix: cypress test failed * fix: cypress test failed (#192) * fix: hasura ci target branch * fix: cypress error * fix: test error (#195) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Xinglee23 <xinglee23@outlook.com> Co-authored-by: 吴兴利 <xinglee@Xinglees-MacBook-Pro.local>
Description
Web notification based on web-push
Related Issue
Fixed #134
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Ask user for permission:
![image](https://user-images.githubusercontent.com/7880675/152635972-a7c7169b-2d9d-4d33-a94d-45dfb89fd70b.png)
Notification permission popup (Only shows up if user agrees):
![image](https://user-images.githubusercontent.com/7880675/152635906-fd4158ae-6c39-4750-a1ec-1c60cb15d0c5.png)
Notification example:
![image](https://user-images.githubusercontent.com/7880675/152635925-f6497795-194c-4010-82d4-f318cbbf1622.png)
Notify user a new service worker is available:
![image](https://user-images.githubusercontent.com/7880675/152644205-9fbea4be-1625-44bc-9c82-16f96c5c066a.png)
Checklist
fixes #number