-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(vue-app): universal fetch #5028
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #5028 +/- ##
=======================================
Coverage 94.93% 94.93%
=======================================
Files 72 72
Lines 2408 2408
Branches 609 609
=======================================
Hits 2286 2286
Misses 102 102
Partials 20 20
Continue to review full report at Codecov.
|
@@ -13,6 +13,11 @@ export default () => ({ | |||
script: [] | |||
}, | |||
|
|||
fetch: { | |||
server: true, |
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.
A good way for excluding package from bundles
I guess, bye-bye axios |
@husayt no actually. Axios still rocks but we have even better plans 馃槉 |
@pi0 I am intrigued now. At least give a clue, please |
It is now asking for node-fetch to be installed
|
@husayt It is in public beta now: https://github.com/nuxt/http :) |
Regarding the error, if other dependency installs 1.x version of node-fetch Nuxt.js detects it and requires manually installing to the root of the project to prevent inconsistencies. |
how can i find the example to use it ? |
@kingda, it is simply fetch() function usable in asyncData and components |
Types of changes
Description
Add universal
fetch
support to Nuxt.js 馃挜 (Original idea credits: @Atinux)Users can control over disabling externals using the new
fetch
option. Defaults:Polyfill Overhead
Tested on
basic
fixtureBundle Analyzer
Gzip:
78.65 KiB
~>79.42 KiB
(0.77 KiB
)Normal:
216.73 KiB
~>219.17 KiB
(+2.44 KiB
)app
Chunk Size31.3 KiB
~>31.4 KiB
41.7 KiB
~>44.1 KiB
Install Size Additions
For
nuxt-start
we have to addnode-fetch
because of externalization.unfetch
:node-fetch
:Checklist: