DEV Community

Yasunori Tanaka
Yasunori Tanaka

Posted on

1

[From May 21 to May 27] The things I knew and thought last week

[vuetify] breadcrumb generator

I want to generate Vuetify's breadcrumb automatically by URL.

Let's say it the URL is /home/company/list. The generator makes breadcrumbs like the below.

[
  {
    title: 'HOME',
    url: '/home',
  },
  {
    title: 'HOME / Companies',
    url: '/home/company/list',
  },
]

[vue] create form initializer

Almost case, I will create an initial data with an interface using TypeScript like this.

interface Data {
  id: number
  name: string
}

Vue.extend({
  data(): Data {
    return {
      id: 0,
      name: '',
    }
  }
})

But if the Data interface definition gets much more, I have to fill in all initial value for the Data because the TypeScript compiler cannot build it.

So I want to generate initial values from a Data interface. Below is an example. generator function makes initial values from the interface.

const initalValues = generator(data: Data)

// initialValues
{
  id: 0,
  name: '',
}

[js] module bundler

I'm looking into how module bundler works.

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay