-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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(server): allow passing loadingTimeout
and other arguments to renderAndGetWindow()
#6178
feat(server): allow passing loadingTimeout
and other arguments to renderAndGetWindow()
#6178
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #6178 +/- ##
==========================================
+ Coverage 50.8% 95.74% +44.93%
==========================================
Files 80 80
Lines 2655 2655
Branches 683 683
==========================================
+ Hits 1349 2542 +1193
+ Misses 1008 97 -911
+ Partials 298 16 -282
Continue to review full report at Codecov.
|
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.
Since globals
are not used only for renderAndGetWindow
, so we'd better not add loadingTimeout
in it.
How about adding third parameter ?
renderAndGetWindow (url, jsdomOpts, {
loadedCallback = this.globals.loadedCallback,
loadingTimeout = 200,
ssr = this.options.render.ssr,
globals = this.globals
} = {}) {
return renderAndGetWindow(url, jsdomOpts, {
loadedCallback,
ssr,
globals,
loadingTimeout
})
}
Ah, I totally agree. It is definitely better since it is easy to customize the arguments externally. Thank you! |
loadingTimeout
and other arguments to renderAndGetWindow()
Types of changes
Description
Resolves: #6008
Currently, it is impossible to give the
loadingTimeout
option to therenderAndGetWindow
from outside. This is very inconvenient, since we cannot avoid the following error.If we can give the
loadingTimeout
option from theglobals
option innuxt.config.js
, we can solve this problem. In fact this solution is suggested in #6008 (comment).Checklist: