maoberlehner / vue-lazy-hydration

Lazy Hydration of Server-Side Rendered Vue.js Components
MIT License
1.18k stars 52 forks source link

ignoredProps does not work when using hydrateSsrOnly #63

Closed lautr closed 3 years ago

lautr commented 3 years ago

ignoredProps does not work when using hydrateSsrOnl

code

<template>
  <div>
    <ContentArticles :limit="9" />
    <hr />
    <ContentTodos :limit="50" class="mt-5" />
  </div>
</template>

<script>
import { hydrateSsrOnly, hydrateWhenVisible } from 'vue-lazy-hydration'

export default {
  components: {
    ContentArticles: hydrateSsrOnly(
      () => import('~/components/content/articles.vue'),
      { ignoredProps: ['limit'] }
    ),
    ContentTodos: hydrateWhenVisible(() =>
      import('~/components/content/todos.vue')
    )
  }
}
</script>

still generates a limit attribute for ContentArticles

<div data-fetch-key="0" class="grid grid-cols-3 gap-5" limit="9">[....]</div>

see https://github.com/lautr/nuxt-performance-starter

to reproduce

  1. checkout repository
  2. yarn install
  3. yarn dev
maoberlehner commented 3 years ago

This is now obsolete thanks to v2