Skip to content

Update to Svelte 3 #16

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

Merged
merged 18 commits into from
Jun 16, 2019
Merged

Update to Svelte 3 #16

merged 18 commits into from
Jun 16, 2019

Conversation

pngwn
Copy link
Member

@pngwn pngwn commented Jun 12, 2019

This PR updates the realworld app to Svelte 3 and the latest Sapper beta.

Aside from the upgrade there were a few problems with the application as it was, so I've fixed these and added a few features too:

  • Editor and Profile routes didn't seem to exist, these have been added (Missing Editor and Profile routes? #14)
  • Profiles routes didn't follow the spec, they have been updated to /profile/@username.
  • Navigating to /profile/ now takes you to your own profile page if you are logged in or to the home page if you are not.
  • Clicking the Follow ${username} button on the profile page now redirects to the login page if you aren't logged in.
  • Added route paths for pagination with scrolltop behaviour, ie. example.com/2 - maybe this needs a prefix? (Better pagination #3 )
  • Added some end-to-end tests. These are for reading posts, filtering by tags, viewing profiles, errors for registration forms. I did write a few tests for registering, logging in, writing and editing posts but they were flakey. I've left them in but commented them out. They ran in UI mode fine but not headless (well sometimes they did). Maybe someone else will have more luck because I don't really know what I'm doing. (Write some acceptance tests #4)

Everything was relatively straight forward, the only thing I wasn't too sure about was reimplementing the custom store from v2. Since this is an example app, I wanted to use the session store, so I essentially created a set of custom methods that could be applied to any store and passed a reference to the session store to it (in the root _layout.svelte). I wanted to keep the easy import { store } from '@sapper/app' but I also wnated those custom methods. Maybe there is a better way.

There was no package-lock.json in the old version, there is now.

This PR fixes, closes or kind of fixes or closes the following issues: #3, #4, #9, #14, #15.

@Rich-Harris Rich-Harris mentioned this pull request Jun 16, 2019
Merged
@Rich-Harris Rich-Harris merged commit 0b01b72 into sveltejs:master Jun 16, 2019
@Rich-Harris
Copy link
Member

you beauty — merged via #17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants