-
Notifications
You must be signed in to change notification settings - Fork 100
Conversation
When this PR is accepted we have to rewrite fetch. I didn't look into that :D Fell free to discouse about this. I don't know if my way is the best way... |
Finished for review. |
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.
@danielroe changed ssrRef to only hydrate if value is function or value of ref get changed
useasync cannot use router hoocks when setup is called routerGuards are finished
Note: The old and my new implementation do not allow to use outside of setup! I'm working on that there are some problems with |
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.
Looking really interesting. Apart from the comments below, would you consider adding some e2e tests (or possibly we'll need to do it in jest
if we're inspecting the raw HTML for the __NUXT__
content). I'd be happy to do the latter if you'd prefer, after it gets merged.
Co-authored-by: Daniel Roe <[email protected]>
Co-authored-by: Daniel Roe <[email protected]>
Co-authored-by: Daniel Roe <[email protected]>
…some refactorings
I don't know where the test fails. Lokaly
|
You're getting the error because the change to the Babel plugin is now injecting a key into every function call, including (in this case) |
adopted partial approach from #28
Why are these test failing? |
The reason they are now failing is that the e2e tests now run against a built version of the fixture, where this error is occuring: |
this works: <template>
<div>
<div>test: {{test}}</div>
</div>
</template>
<script>
import {
defineComponent,
ref,
onServerPrefetch
} from '@vue/composition-api'
export default defineComponent({
setup() {
const test = ref('test')
onServerPrefetch(() => {
test.value = 'Hello World.'
})
return {
test
}
},
})
</script> this doesn't work: <template>
<div>
<div>test: {{test}}</div>
</div>
</template>
<script>
import {
defineComponent,
ref,
onServerPrefetch
} from 'nuxt-composition-api'
export default defineComponent({
setup() {
const test = ref('test')
onServerPrefetch(() => {
test.value = 'Hello World.'
})
return {
test
}
},
})
</script> |
@danielroe had to rewrite onServerPrefetch now it works. |
That was wanted when useing a function I think it should be in |
Looks good for me. |
Features
useAsync
helper to prefetch data and send in ssrContext to clientserverPrefetch
helperssrRef
handling