-
Notifications
You must be signed in to change notification settings - Fork 214
Conversation
look like not working , because you change the init method arguments。 i did not understand you pseudo-code,i did not known where app from in sapper and selectRoute method ,i found selectRoute method in runtime.ts but not exported . i will expect more simple and clear sample code。 tks~ 🤗 |
It's not working because the new version of Sapper that it depends on hasn't been released yet. |
@@ -6,19 +6,21 @@ | |||
"dev": "sapper dev", | |||
"build": "sapper build", | |||
"export": "sapper export", | |||
"start": "sapper start", | |||
"start": "node build", |
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.
Is this correct? shouldn't this be npm build
?
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.
it's correct, yeah — as of 0.11, Sapper creates a launcher file which defaults to build/index.js
. So to run the app you just to node build
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.
This probably explains my problems w/ trying to build when upgrading Sapper. ;) Need to upgrade sapper-template
too...
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.
sapper start
still works
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.
I got it all working.
@@ -0,0 +1,31 @@ | |||
<Nav page={ |
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.
@Rich-Harris why the intensive props.path
logic here? This seems very manifest-y, which goes against the grain of the automated path-finding you seem to support? What exactly is the function of these page props?
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.
In other words, do I have to add to this for every page I add?
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.
you can pass props.path
down to <Nav>
instead (in fact, I prefer that — will change it)...
<Nav path={props.path}/>
...but yes, you have to explicitly pass stuff down, just like you used to have to explicitly pass down a page
property via the <Layout>
component in the previous template. How else will the nav bar know which option to mark as active?
That's much better, thx. |
See sveltejs/sapper#157