Microblog

@tomfinley@wptoots.social Yeah WordPress itself is impressively backward compatible. Unfortunately PHP isn’t so much. I’ve been bit by breaking changes in PHP a number of times. Luckily, WordPress is actively developed and on top of things!

social.lol/@bw/111344605250778679

How does Slack not have syntax highlighting on code blocks? It's supposed to be *the* chat application for work. Discord’s code blocks are way better.

(Someone correct me if Slack does have this feature and I'm just using it wrong. But including a language abbreviation after the opening code fence doesn't seem to do it.)

social.lol/@bw/111333489165075385

Continuing in my quest for nice Vue DX without build steps… I’ve learned two things:

- Even tho I’m using a downloaded ESM browser version, I can still install the Vue npm package and refer to its types from JSDoc.

- The composition API is much easier to type than the options API.

social.lol/@bw/111313172895016528

Vue devs, help!

Trying to get type support in regular JS using Vue’s ESM browser build.

Inside of the hasName computed value, VSCode thinks `this` refers to the `computed` object rather than the Vue app. What can I do here?

const test = createApp({
  data: () => ({
    name: 'Testing'
  }),

  computed: {
    hasName() {
      return !!this.name;
    }
  }
});

social.lol/@bw/111309530389909270

Another piece of nice-vue-but-no-build-step is using ES modules. That let’s me separate out components into their own files.

Still exploring type support, but adding a jsconfig.json with checkJs turned on is the first step. It kinda misinterprets things when using Vue’s options API, so it might be that the composition API is better for this use case.

social.lol/@bw/111308874619186766

If you often embed other languages into JS template literals (and you use VSCode) then I have the extension for you.

This baby lets you hit a shortcut, pops open a tab with just the contents of your template literal, and sets the syntax mode accordingly. Now you have full editor support for the given language!

It syncs everything you type back to the original file and saving the tab just saves the original file. It’s a lil weird, sure, but kinda neat.

marketplace.visualstudio.com/i

social.lol/@bw/111308636085686309