Skip to content

v1.0.1

Choose a tag to compare

@DominusKelvin DominusKelvin released this 15 Jan 10:38

The Boring Stack 1.0.1

Patch release with infinite scroll implementation and test infrastructure improvements.

What's Changed

Infinite Scroll Support

Added sails.inertia.scroll() helper for building infinite scroll lists with proper pagination:

Action:

const page = this.req.param('page', 0)
const perPage = 10
const invoices = await Invoice.find({ status }).paginate(page, perPage)
const total = await Invoice.count({ status })

return {
  page: 'invoices/index',
  props: {
    invoices: sails.inertia.scroll(() => invoices, { page, perPage, total })
  }
}

Vue Component:

<InfiniteScroll :data="invoices" preserve-url>
  <Link v-for="invoice in invoices.data" :key="invoice.id" :href="`/invoices/${invoice.id}`">
    {{ invoice.name }}
  </Link>

  <template #loading>
    <div class="spinner" />
  </template>
</InfiniteScroll>

The helper automatically:

  • Wraps data with pagination metadata (current_page, per_page, total, last_page, next_page, prev_page)
  • Merges new pages with existing data on the client
  • Works seamlessly with Inertia's <InfiniteScroll> component

Test Infrastructure

  • Refactored unit tests to use getSails() singleton pattern for faster test execution
  • Split helper tests into individual files (tests/unit/helpers/*.test.js)
  • Standardized e2e tests to use .test.js extension
  • All templates now have consistent tests/ directory structure:
tests/
├── e2e/
│   └── pages/
│       └── home.test.js
├── unit/
│   └── helpers/
│       ├── capitalize.test.js
│       └── get-user-initials.test.js
└── util/
    └── get-sails.js

Bug Fixes

  • Fixed duplicate timeout property in ascent template playwright configs
  • Updated ascent templates to use testDir: './tests/e2e' for consistency with mellow templates

Configuration

  • Simplified config/inertia.js in all templates to empty object (auto-versioning handles the rest)

Full Changelog: v1.0.0...v1.0.1