swup / scroll-plugin

A swup plugin for smooth scrolling 🏄‍♂️
https://swup.js.org/plugins/scroll-plugin
MIT License
3 stars 8 forks source link

Make use of `swup.resolvePath` if present #38

Closed hirasso closed 1 year ago

hirasso commented 1 year ago

Runs swup.resolvePath on the cache key for stored scroll positions, so that they can be restored correctly.

I renamed previousUrl to currentCacheKey, to make it easier to understand what it's for. Also, I moved it's declaration from constructor to mount, to be able to access the swup instance.

daun commented 1 year ago

Can we add somewhere as a code comment that it'll be available in swup v3+ so it's a bit more self-explaining? Otherwise looks good :)

hirasso commented 1 year ago

@daun would you agree to bumping and publishing a new minor version for scroll-plugin to npm, so that we don't forget about it? In my notes, it says:

To publish the release, manually run the version update action on the 'Actions' tab. That will create a PR you can review and merge. Then create a tagged GitHub release, that will publish to npm.

...but I can't find the big green "Run Workflow" button.

daun commented 1 year ago

Sure, let's go ahead and publish. If there isn't a button for running the workflow, it's probably not part of the repo yet? For now, a PR with a manual version bump should work as well.

daun commented 1 year ago

@hirasso I've created PR #40 adding the workflow. Feel free to approve and merge.

hirasso commented 1 year ago

Thank you!