Skip to content
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

[feat] return list of prerendered files when prerendering #2675

Merged
merged 6 commits into from Oct 25, 2021

Conversation

pngwn
Copy link
Member

@pngwn pngwn commented Oct 24, 2021

Returns an array fo written files from prerender. Similar to #2674, it is useful for adapters to know which files have been prerendered.

@dummdidumm Also similar to #2674, would this be better an object return value for future proofing? There are probably things in here that we may want to return in the future. That said, I don't think anything really obvious comes to mind right now and we don't want to overcomplicate every signature 'just in case'. Easy change either way.

@changeset-bot
Copy link

changeset-bot bot commented Oct 24, 2021

🦋 Changeset detected

Latest commit: 2ad9d2e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@@ -83,15 +83,15 @@ const OK = 2;
const REDIRECT = 3;

/**
* @param {{
* @type {(opts: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@type is a bit uncommon. I'd make it @param and @return so you can add a description on the return value

Copy link
Member Author

@pngwn pngwn Oct 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated this, can you check it is correct? I'm not too familiar with jsdoc types but i think @returns is correct.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, but I think it'd be nice to add a short description after the type of what it is that's being returned

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, also tweaked the early return value to ensure a consistent return value.

@pngwn
Copy link
Member Author

pngwn commented Oct 24, 2021

Tests have magically passed now, don't look it directly in the eye!

Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
@benmccann benmccann changed the title Prerender return [feat] return list of prerendered files when prerendering Oct 25, 2021
@pngwn pngwn merged commit e664d90 into master Oct 25, 2021
@pngwn pngwn deleted the prerender-return branch October 25, 2021 15:45
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.

None yet

2 participants