-
Notifications
You must be signed in to change notification settings - Fork 27.1k
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
[WIP] Add an example with page loading indicator #250
Conversation
@rauchg I think we could pass the But I hope this is enough for now. |
const { | ||
onStart = () => null, | ||
onComplete = () => null, | ||
onError = () => null |
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 didn't know this is possible
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.
Ha ha. ES6 is pretty mysterious.
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 do this also:
onStart: theNewNameForOnStart = () => null
This is a beautiful example, specially because it shows integration with a 3rd party (even non-react!) library. I would like to add That's the format we're going with for all examples/, since right now they're kinda cryptic. |
@rauchg sure. Will do it. |
@nkzawa I hope we could take this and land this on the next release. |
<div style={{ marginBottom: 20 }}> | ||
<Head> | ||
{/* Import CSS for nprogress */} | ||
<link rel='stylesheet' type='text/css' href='http://ricostacruz.com/nprogress/nprogress.css' /> |
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.
maybe make a copy of this into /static
instead? Since this is http
and we don't want to spam his site
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.
Okay. Makes sense.
"version": "0.0.0", | ||
"description": "", | ||
"scripts": { | ||
"dev": "../../dist/bin/next" |
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 requires a top-level npm install
, which is not clarified in the instructions. I think it's best if we include maybe "next": "*"
in the deps?
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.
Okay that makes sense. I will right another script to play with current source code.
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.
Other than these changes everything looks amazing!
I noticed loading indicator would be required for history back ( |
Good point @nkzawa. Let's address it |
Good catch @nkzawa :) Let's see. |
Since we need to support popstate events, I think it's better to remove onStart, onStop events from the Link and expose a similar API to the singleton Router. Just like Router.go() |
@rauchg I changed the example as you suggested. |
@arunoda
|
Closing this in favor of #511 |
Stats from current PRDefault Server ModeGeneral
Client Bundles (main, webpack, commons)
Client Bundles (main, webpack, commons) Modern
Client Pages
Client Pages Modern
Client Build Manifests
Rendered Page Sizes
Serverless ModeGeneral
Client Bundles (main, webpack, commons)
Client Bundles (main, webpack, commons) Modern
Client Pages
Client Pages Modern
Client Build Manifests
Serverless bundles
Commit: 0410a43 |
Check this:
In order to do this, I have to introduce two new events to the ``. They are:
Why not using onClick instead of onStart?
onClick gets called even any clicks including external navigations. That's why we need this event.