114 Commits

Author SHA1 Message Date
keyan
e09ea310cd fix mdast library conflict 2023-07-25 13:59:07 -05:00
keyan
dae9c64e96 more package updates 2023-07-24 19:50:55 -05:00
keyan
e87610c45b update packages and reduce bundle size 2023-07-24 17:50:12 -05:00
keyan
6407455def upgrade react-bootstrap 2023-07-24 13:53:53 -05:00
keyan
567b1b9e88 Revert "Revert "deploy hack: fix slashtags package user""
This reverts commit ba0cd71d23880473ecb85f07f2a42322765929ef.
2023-07-23 10:08:53 -05:00
keyan
59f7b6ff26 Revert "Revert "shield your eyes; massive, squashed refactor; nextjs/react/react-dom/apollo upgrades""
This reverts commit 18910fa2ed470fe12ffbfb83df18e206101f0a05.
2023-07-23 10:08:43 -05:00
keyan
18910fa2ed Revert "shield your eyes; massive, squashed refactor; nextjs/react/react-dom/apollo upgrades"
This reverts commit d0314ab73c42ebf85fe2f418dddd681af45dbc55.
2023-07-23 09:16:12 -05:00
keyan
ba0cd71d23 Revert "deploy hack: fix slashtags package user"
This reverts commit 67509fe2be4e2622a4e94f7cc96a57881318876c.
2023-07-23 09:16:06 -05:00
keyan
67509fe2be deploy hack: fix slashtags package user 2023-07-21 19:40:17 -05:00
keyan
d0314ab73c shield your eyes; massive, squashed refactor; nextjs/react/react-dom/apollo upgrades 2023-07-21 17:33:11 -05:00
keyan
8350b1df3b trust algo v4 2023-07-05 20:30:50 -05:00
keyan
09d7e960cc back to lightning animation 2023-07-05 09:47:44 -05:00
keyan
3068252adf merge github master 2023-07-04 15:35:04 -05:00
ekzyis
388e00dd04
Service worker rework, Web Target Share API & Web Push API (#324)
* npm uninstall next-pwa

next-pwa was last updated in August 2022.
There is also an issue which mentions that next-pwa is abandoned (?): https://github.com/shadowwalker/next-pwa/issues/482

But the main reason for me uninstalling it is that it adds a lot of preconfigured stuff which is not necessary for us.
It even lead to a bug since pages were cached without our knowledge.

So I will go with a different PWA approach. This different approach should do the following:
- make it more transparent what the service worker is doing
- gives us more control to configure the service worker and thus making it easier

* Use workbox-webpack-plugin

Every other plugin (`next-offline`, `next-workbox-webpack-plugin`, `next-with-workbox`, ...) added unnecessary configuration which felt contrary to how PWAs should be built.
(PWAs should progressivly enhance the website in small steps, see https://web.dev/learn/pwa/getting-started/#focus-on-a-feature)

These default configurations even lead to worse UX since they made invalid assumptions about stacker.news:
We _do not_ want to cache our start url and we _do not_ want to cache anything unless explicitly told to.
Almost every page on SN should be fresh for the best UX.

To achieve this, by default, the service worker falls back to the network (as if the service worker wasn't there).

Therefore, this should be the simplest configuration with a valid precache and cache busting support.

In the future, we can try to use prefetching to improve performance of navigation requests.

* Add support for Web Share Target API

See https://developer.chrome.com/articles/web-share-target/

* Use Web Push API for push notifications

I followed this (very good!) guide: https://web.dev/notifications/

* Refactor code related to Web Push

* Send push notification to users on events

* Merge notifications

* Send notification to author of every parent recursively

* Remove unused userId param in savePushSubscription

As it should be, the user id is retrieved from the authenticated user in the backend.

* Resubscribe user if push subscription changed

* Update old subscription if oldEndpoint was given

* Allow users to unsubscribe

* Use LTREE operator instead of recursive query

* Always show checkbox for push notifications

* Justify checkbox to end

* Update title of first push notification

* Fix warning from uncontrolled to controlled

* Add comment about Notification.requestPermission

* Fix timestamp

* Catch error on push subscription toggle

* Wrap function bodies in try/catch

* Use Promise.allSettled

* Filter subscriptions by user notification settings

* Fix user notification filter

* Use skipWaiting

---------

Co-authored-by: ekzyis <ek@stacker.news>
2023-07-04 14:36:07 -05:00
keyan
b6628eb159 july 4th festivities 2023-07-03 14:46:54 -05:00
ekzyis
e97509eea7
Use PWA with display: standalone (#292)
* Use next-pwa

* Use standalone + back button

* Use Notification API

* Use custom service worker

* Use url_handlers

* Add offline page

* Use smaller icon in notification

* Only prompt for notifications if logged in

* small enhancements to standalone pwa

* remove unused back arrow

---------

Co-authored-by: ekzyis <ek@stacker.news>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-05-31 17:28:33 -05:00
keyan
93d4581360 complete nip 57 support 2023-02-14 16:58:12 -06:00
keyan
ef5346000b support NIP-57 2023-02-14 12:52:15 -06:00
keyan
29c59d93ea open timestamps 2023-01-22 14:17:50 -06:00
keyan
9644a9f867 slashtags auth 2023-01-18 12:49:20 -06:00
keyan
9823969418 unshorten links 2023-01-12 12:05:47 -06:00
keyan
afc9a70a02 ignore subdomains on dupe detection 2023-01-11 16:20:14 -06:00
keyan
2080cb896d lexical beta test url 2023-01-05 13:24:09 -06:00
keyan
525cab2573 upgrade deps 2022-11-06 11:28:58 -06:00
keyan
6225b9e7aa upgrade ln-service 2022-10-10 19:43:51 -05:00
keyan
beef34abfa linkable headers 2022-07-17 10:35:50 -05:00
keyan
f024cd39a2 add usage mvp usage charts 2022-06-10 14:20:33 -05:00
keyan
1df49e03d9 account linking 2022-06-08 16:26:44 -05:00
keyan
29fb37b763 profile photos 2022-05-16 15:51:22 -05:00
keyan
9abc41b7b2 image uploading backend 2022-05-12 13:44:21 -05:00
keyan
b954186d31 jobs w/o payments yet 2022-02-24 13:05:57 -06:00
keyan
18ff637e5c fix cls of twitter embed 2022-02-12 08:06:41 -06:00
keyan
ac19d89ba8 upgrade markdown stuff 2022-02-06 07:59:22 -06:00
keyan
8141d29b36 youtube embed 2022-02-05 15:40:54 -06:00
keyan
8c2a4dc76a add search SEO and capture 2022-02-05 11:29:41 -06:00
keyan
66d2c4f9a9 search highlighting 2022-02-03 16:01:42 -06:00
keyan
af2c990a51 add production search config 2022-01-28 12:37:23 -06:00
keyan
d413b49e24 search index functions 2022-01-25 14:57:40 -06:00
keyan
977639ccb9 twitter embed 2022-01-20 14:22:10 -06:00
keyan
3d94ef32ac improve screen capture: 2x resolution, caching, exit on exception 2022-01-12 17:13:09 -06:00
keyan
e950b0df7f add job queue 2022-01-05 14:37:34 -06:00
keyan
06f5ed731e satisitics with invoice & withdrawal 2021-12-15 10:50:11 -06:00
keyan
16685771da downgrade prisma given breaking changes 2021-11-28 12:22:47 -06:00
keyan
70c4edfbaa upgrade prisma 2021-11-23 15:23:40 -06:00
keyan
f56315f89f add progress bar and fix reply padding 2021-11-13 07:28:08 -06:00
keyan
c255a4b8fe remove styled components 2021-11-09 16:44:48 -06:00
keyan
c6e6ddfa65 half-working local storage version 2021-11-09 11:38:58 -06:00
keyan
2d97314d33 dark mode without ability to switch 2021-11-04 14:22:03 -04:00
keyan
41504ba06b long press tip dialog 2021-10-30 11:52:24 -05:00
keyan
68ddd0f86b sort by top posts 2021-10-21 17:05:06 -05:00