Runtime variables with Vue CLI

Docker and Vue.js

When building an distributable version of a project, it should be relatively easy to swap out some variables at runtime. The benefit of this is that you can build the code once and then deploy it across your stack without the need to rebuild. There’s nothing more frustrating than building for test and then having to rebuild for production – it technically means you’re playing a guessing game as to whether what worked and was signed off, will actually work next time around! Vue CLI doesn’t cope with this concept very well. Recently, we have been using nuxt.js and there has been an introduction of runtimeConfig as a concept in their nuxt.config.js file. This is a new release as of v2.13 and works very well. There were workarounds before, but this is the next level of easy environment swapping. To […]

Persisting state with Server Side Rendering

A lot of our projects in the last couple of years have focused on Vue.js. We have used a number of scaffolding solutions and most recently we have had success with Nuxt.js. One thing we have struggled with however, is state management and persistence. When using a ‘universal’ approach it’s immediately clear that having state traverse between client-side and server-side isn’t that easy. There’s a great plugin that allows you to persist your state into local storage or cookies. Server-Side-Rendering (SSR) doesn’t have access to your local storage, so if you want to harness the power of SSR and state management you have to use cookies. We have been using the vuex-persistedstate plugin with great success. It works well with nuxt.js and if you create a plugin to handle your storage method, you can create custom hooks for getItem and […]

You’re remote, I’m remote, everybody is remote!

Remote developers desk

It’s been a crazy start to the year, and each month has been more ridiculous than the last! With a few of our clients being put into a state of frenzy as a result of the new working restrictions, we’re being asked some pretty strange questions. As a successful, remotely focused, engineering company, we are well-equipped for the challenges of an entirely remote workforce. Our clients on the other hand, not always! I’m hoping that this new shift will see a rise in companies agreeing to remote teams and the ‘work-from-home’ request being part of the norm where possible. We’ve compiled our top-tips for a successful switch to remote teams: Stick to a schedule – allow the team to create the schedule, but once it is agreed, stick to it. It’s more productive for the team, and also beneficial for […]

Kubernetes for multiple projects

Working with multiple projects at the same time using docker and kubernetes can get painful. Needing to remember contexts, configurations and the way that you interact with those can start to weigh down a local development process. Enter kubernetes namespaces Kubernetes namespaces allow you to separate a context out into multiple namespaces that all act like their own context. This is intended from the documentation to help segregate a kubernetes cluster based on environment (dev, staging, prod etc…) but it is also useful for local contexts. Check your current context is set to either docker-desktop or minikube (whichever you’re using) and create a new namespace: kubectl create namespace {project-name}. You can then list your config to identify your local context and user details with kubectl config view then from this create a new context that is tied to your local context […]

Be the difference in an evolving world!

Technology is evolving at a pace faster than ever before. And it increases in pace year on year. This can be a daunting time for many businesses. Whether you are a sole-trader or a multi-national corporation, those changes can be offputting for a number of reasons. At SMG Digital, we have spent the best part of 15 years providing expert analysis, advice and implementation services to companies around the world. We try and help with some of the tasks that shouldn’t affect the productive output from the day to day within your business. From the simple questions such as ‘is this email a scam?’ to the strategic deployment process of migrating physically hosted accounting software to the cloud, we are able to provide the expert knowledge to put your mind at ease. Explore our offerings and contact us to start […]