Commit graph

4 commits

Author SHA1 Message Date
matc-pub
e48590b9d6
Use mixins and decorators for scroll restoration and tippy cleanup (#2415)
* Enable @babel/plugin-proposal-decorators

Dependency already exists

* Use tippy.js delegate addon, cleanup tippy instances from a mixin.

The delegate addon creates tippy instances from mouse and touch events
with a matching `event.target`. This is initially significantly cheaper
than creating all instances at once. The addon keeps all created tippy
instances alive until it is destroyed itself.

`tippyMixin` destroys the addon instance after every render, as long as
all instances are hidden. This drops some tippy instances that may have
to be recreated later (e.g when the mouse moves over the trigger again),
but is otherwise fairly cheap (creates one tippy instance).

* Restore scroll positions when resource loading settles.

The history module generates a random string (`location.key`) for every
browser history entry. The names for saved positions include this key.
The position is saved before a route component unmounts or before the
`location.key` changes.

The `scrollMixin` tires to restore the scroll position after every
change of `location.key`. It only does so after the first render for
which the route components `loadingSettled()` returns true.

Things like `scrollToComments` should only scroll when `history.action`
is not "POP".

* Drop individual scrollTo calls

* Scroll to comments without reloading post

---------

Co-authored-by: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com>
2024-04-11 13:18:07 -04:00
Dessalines
140ff8271c
Move to pnpm (#2345)
* Switch from yarn to pnpm.

* Moving from yarn to pnpm.

* Try 2

* Try 3

* Try 4

* Try 5

* Try 6

* Adding qs.

* Try corepack.

* Remove comment.

* Adding prebuild:dev.

* Some fixes.

* Fixing up husky.

* Fixing up version and others.
2024-01-28 22:09:08 -05:00
SleeplessOne1917
ac2a83a7a6
Lint fix (#1035)
* User HTTP instead of HTTPS when fetching icon in docker internal network

* Add debug statement.

* Revert "Add debug statement."

This reverts commit 7fbb12a4bd.

* Revert "User HTTP instead of HTTPS when fetching icon in docker internal network"

This reverts commit 498de660ba.

* Always replace host with internal host

* Fix lint script

* Remove prettier from pre-commit

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
2023-05-23 18:55:36 -04:00
241ef72290 Somewhat working webpack. Sponsors and communities pages done. 2020-09-06 22:41:46 -05:00