This repository has been archived by the owner on Jan 11, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 433
Serialize preloaded data for initial page and serve to client #87
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
be7c53b
quick attempt at fixing test for travis
lukeed f0bc68b
use built-in for `document.title`
lukeed 5aa01b9
add `page.title()` Nightmare action
lukeed 1b73baa
[temp - debug]: log out the `preload` value
lukeed 7cef1f1
only return from `show-url` if in server context
lukeed 887cb09
merge
Rich-Harris a80ac3a
change tests back to non-async versions
Rich-Harris 2abfdb0
wait for window.READY so that this tests we dont double-preload
Rich-Harris c4b4bd5
use %sapper.scripts%
Rich-Harris bd656cf
Merge branch 'fix-tests-without-async' into gh-3
Rich-Harris 44285cd
serialized preloaded data and send to client as initial payload - fix…
Rich-Harris File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
<script> | ||
export default { | ||
preload({ url }) { | ||
return { url }; | ||
if (url) return { url }; | ||
} | ||
}; | ||
</script> | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Awesome stuff!
Is this test supposed to be removed?
You know this better than me, but is it a good idea to have both
package-lock.json
andyarn.lock
in the same repository?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.
ack! well spotted, thanks — must have got lost when I was trying to merge some stuff. have added it back.
Bloody lockfiles. Removing yarn.lock
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.
Can you explain the reason for removing lock files? I always commit mine. (Yarn being the preferred tool in my builds.)
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.
Lock files are used to get consistent installs across machines. Having 2 separate lock files in the same repository violates this out of the gate. Having either
yarn.lock
orpackage-lock.json
in the repository is a good idea, though.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.
Did you mean to say Sapper only supports NPM? That would make more sense. But there's nothing wrong with committing Yarn and NPM lock files—it is just more effort.
Since Yarn has been pretty reliable almost since inception, I barely noticed the release of NPM 5, and just now had to go read up on the difference, including the lock files.
If this ticket is ever closed yarnpkg/yarn#3614 then it may be that Yarn folks won't need to fret about frameworks, etc., that rely solely on NPM, but until then, we should state it more explicitly in the docs that Sapper relies on NPM; use Yarn at your own expense (YMMV).
ALTERNATIVELY, you can commit both lock files and explicitly support both, but give the Sapper team a little more work to do. I could easily see y'all doing the first, with a well-worded explanation somewhere.