Commit graph

238 commits

Author SHA1 Message Date
Oliver Davies cdfb969938 docs(daily-email): add 2022-12-20 2022-12-20 23:42:02 +00:00
Oliver Davies 36c8de1078 docs(daily-email): add 2022-12-15 2022-12-16 00:46:25 +00:00
Oliver Davies 42fc8eb1d1 docs(daily-email): add 2022-12-10 2022-12-14 23:04:19 +00:00
Oliver Davies 4161ecbe7c fix: ensure that the slug is a string
Ensure that the last part of the permalink is used as the slug.
2022-12-11 00:39:51 +00:00
Oliver Davies 991c333c8a refactor: define slug as a string 2022-12-11 00:27:42 +00:00
Oliver Davies 90cac4102b feat: re-add archive page pagination
Refs: #28
2022-12-11 00:23:05 +00:00
Oliver Davies 8a2fb3770e docs(daily-email): add 2022-12-09 2022-12-10 22:16:12 +00:00
Oliver Davies b752fd4900 docs(daily-email): add 2022-12-08 2022-12-10 12:48:08 +00:00
Oliver Davies 88a330de84 docs(daily-email): add 2022-12-07 2022-12-10 10:55:50 +00:00
Oliver Davies 85a07e11ac revert: add pagination to the daily posts archive
This reverts commit 8527e7fb89.
2022-12-10 01:02:11 +00:00
Oliver Davies 7b25c2d9b1 revert: remove email signup form on Archive page
This reverts commit 46c3764176.
2022-12-10 01:01:50 +00:00
Oliver Davies 46c3764176 fix: remove email signup form on Archive page 2022-12-09 23:08:31 +00:00
Oliver Davies 8527e7fb89 feat: add pagination to the daily posts archive 2022-12-09 23:06:15 +00:00
Oliver Davies 5af5a33e1e docs(daily-email): add 2022-12-06 2022-12-09 17:17:30 +00:00
Oliver Davies 5f4aaac264 docs(daily-email): add 2022-12-05 2022-12-08 00:16:33 +00:00
Oliver Davies 476639ba3a chore: only show the latest daily email in RSS 2022-12-07 23:57:26 +00:00
Oliver Davies fe8810f6b4 docs(daily-email): add 2022-12-04 2022-12-06 00:02:10 +00:00
Oliver Davies 6182b0efd6 docs(daily-email): add 2022-12-03 2022-12-05 00:15:55 +00:00
Oliver Davies af170acf46 docs(daily-email): add 2022-12-02 2022-12-03 15:47:10 +00:00
Oliver Davies 7fa2153050 docs(daily-email): add 2022-12-01 2022-12-02 08:17:25 +00:00
Oliver Davies 53bd79bd5d docs: pairing session link 2022-12-01 21:48:43 +00:00
Oliver Davies 075de7ca94 docs: increase call amount 2022-12-01 13:11:27 +00:00
Oliver Davies d13416e78a docs(daily-email): add 2022-11-30 2022-12-01 01:09:39 +00:00
Oliver Davies b3c9b6a0b8 chore(daily): add Marcos' testimonial 2022-12-01 00:23:08 +00:00
Oliver Davies b6bdc92e0d docs(daily-email): add 2022-11-25 2022-11-29 23:53:53 +00:00
Oliver Davies 19a8120852 build: add path aliases 2022-11-29 23:53:53 +00:00
Oliver Davies fcd3504d3f docs(daily-email): add 2022-11-24 2022-11-28 23:06:32 +00:00
Oliver Davies 7c7ca2a63b feat: add Daily email testimonials 2022-11-28 22:07:20 +00:00
Oliver Davies 5717138441 docs(daily-email): add 2022-11-23 2022-11-26 17:40:26 +00:00
Oliver Davies 0e105ea035 docs(daily-email): add 2022-11-22 2022-11-26 09:09:38 +00:00
Oliver Davies e79804bb22 docs(daily-email): add 2022-11-21 2022-11-24 22:54:21 +00:00
Oliver Davies 9ad72e71b7 docs(daily-email): add 2022-11-20 2022-11-24 00:29:01 +00:00
Oliver Davies f3946dbd21 docs(daily-email): add 2022-11-19 2022-11-23 07:53:01 +00:00
Oliver Davies 93b0d7a8af docs(daily-email): add 2022-11-18 2022-11-22 08:33:08 +00:00
Oliver Davies 4540a3fc3b docs(daily-email): add missing link 2022-11-21 18:37:04 +00:00
Oliver Davies 2b0a5198b3 docs(daily-email): add 2022-11-17 2022-11-21 18:24:03 +00:00
Oliver Davies 32a41a245b docs(daily-email): add 2022-11-16 2022-11-18 19:24:26 +00:00
Oliver Davies 944562ffc5 docs(daily-email): add 2022-11-15 2022-11-17 00:06:21 +00:00
Oliver Davies 6676773bae docs(daily-email): add 2022-11-14 2022-11-15 22:51:58 +00:00
Oliver Davies c9e41e602b docs(daily-email): add 2022-11-13 2022-11-14 22:16:13 +00:00
Oliver Davies 426cf6e240 docs(daily-email): add 2022-11-12 2022-11-14 00:15:36 +00:00
Oliver Davies 5f6611f136 docs(daily-email): add 2022-11-11 2022-11-13 01:02:41 +00:00
Oliver Davies 806b7013c4 docs(daily-email): add 2022-11-09 2022-11-10 19:05:37 +00:00
Oliver Davies 31ea58660f docs(daily-email): add 2022-11-08 2022-11-08 21:52:42 +00:00
Oliver Davies 668f0a0b21 feat: add ordered list styling 2022-11-05 21:54:15 +00:00
Oliver Davies dd92d7aaa1 docs(daily-email): add 2022-10-30 2022-11-05 21:54:15 +00:00
Oliver Davies cddb003b5b docs(daily-email): add 2022-10-29 2022-11-04 01:03:14 +00:00
Oliver Davies cdeb015148 docs(daily-email): add 2022-10-28 2022-11-03 09:01:57 +00:00
Oliver Davies 6080c5fcf7 docs(daily-email): add 2022-10-27 2022-10-31 21:38:26 +00:00
Oliver Davies 7eb3d41e14 docs(daily-email): add 2022-10-26 2022-10-31 21:02:20 +00:00
Oliver Davies df3d046e7f docs(daily-email): add 2022-10-25 2022-10-27 10:43:19 +01:00
Oliver Davies c568234b08 docs(daily-email): add 2022-10-24 2022-10-25 23:33:20 +01:00
Oliver Davies 4d5481c45e docs(daily-email): add 2022-10-21 2022-10-24 00:20:08 +01:00
Oliver Davies b841499034 fix: use the main tag 2022-10-22 12:25:19 +01:00
Oliver Davies b33c575dbe chore: add space below the page title 2022-10-22 12:25:19 +01:00
Oliver Davies 68aa496b84 refactor: change gray to grey` 2022-10-22 12:20:01 +01:00
Oliver Davies e3cd850df9 chore: use a different grey colour
Use a different grey colour to make the site look more like the previous
version.
2022-10-22 12:20:01 +01:00
Oliver Davies a56e326a57 fix(daily-email): remove newlines in slugs
Fix page not found error when adding a permalink in this format:

```yaml
---
permalink: >
  archive/2022/10/20/cherry-picking-commits-is-an-anti-pattern
```

This causes a newline character to be added to the end of the permalink,
and causes the previous code to not be able to match the slug for the
filename based on the `permalink` value within the front matter.
2022-10-21 23:55:35 +01:00
Oliver Davies 6be23267c0 docs(daily-email): add 2022-10-20 2022-10-21 23:55:35 +01:00
Oliver Davies 949ede7d69 docs(daily-email): fix permalink 2022-10-21 00:31:14 +01:00
Oliver Davies 83205d48a5 docs(daily-email): add link 2022-10-21 00:17:54 +01:00
Oliver Davies 4dd37eb32d docs(daily-email): fix pubDate 2022-10-21 00:14:32 +01:00
Oliver Davies 571a3b6179 docs(daily-email): add 2022-10-19 2022-10-20 23:53:50 +01:00
Oliver Davies 5adc2a4b2b refactor(daily-email): make filenames consistent 2022-10-20 21:55:06 +01:00
Oliver Davies 92a3e001e1 feat: add links to common searches
Refs: #25
2022-10-19 22:02:54 +01:00
Oliver Davies 362f2335ec feat: add search functionality
Refs: #25
2022-10-19 22:01:11 +01:00
Oliver Davies 7ee59c28df feat: initial implementation of recommendations
An inititla implementation to add recommendations to the Daily List
page.

This is intentionally hidden until the feature is completed and the
styling is applied to each testimonial.
2022-10-19 21:17:10 +01:00
Oliver Davies dfdce8f144
docs(daily-email): add 2022-10-18 2022-10-19 12:35:17 +01:00
Oliver Davies dc72cbc91c
docs(daily-email): add 2022-10-12 2022-10-18 23:55:09 +01:00
Oliver Davies a9a64beb07 fix(daily-emails): change pubDate 2022-10-17 22:12:05 +01:00
Oliver Davies 1e7237ebea docs(daily-email): add 2022-10-17 2022-10-17 22:06:21 +01:00
Oliver Davies e25bc7007a docs: add missing syntax highlighting 2022-10-16 13:10:16 +01:00
Oliver Davies 52836ee597 fix: duplicate background color in code blocks 2022-10-16 13:07:59 +01:00
Oliver Davies 7d91a71917 fix: add the correct import 2022-10-16 12:52:45 +01:00
Oliver Davies f9df869c24 refactor: remove unused import 2022-10-16 12:52:23 +01:00
Oliver Davies 1ed365b129 refactor: extract getSlugFromFile() 2022-10-16 11:13:09 +01:00
Oliver Davies ee4f48abcd refactor(talks): use flatMap and size methods 2022-10-16 01:01:01 +01:00
Oliver Davies 217e98b7e3
docs(daily-email): add 2022-10-11 2022-10-15 17:24:18 +01:00
Oliver Davies 490aafca9b feat: re-add About Me block 2022-10-15 16:50:48 +01:00
Oliver Davies 535b4fef45 docs(talks): add mob programming talk 2022-10-15 16:14:54 +01:00
Oliver Davies 9e2b8196bd feat(talks): make talk count dynamic 2022-10-15 16:14:41 +01:00
Oliver Davies d2244d084c docs(talks): mark talks as online 2022-10-15 16:14:41 +01:00
Oliver Davies ad3c9171f7 refactor(talks): extract talk components 2022-10-15 16:14:37 +01:00
Oliver Davies d34d3415c1 feat: re-add events to talk pages 2022-10-15 00:33:17 +01:00
Oliver Davies 6e94d52f90 fix: re-add description 2022-10-15 00:03:28 +01:00
Oliver Davies 43ef7c2c70
docs(daily-emails): add 2022-10-10 2022-10-14 23:54:41 +01:00
Oliver Davies 6d7adf8c35 feat: re-add 404 page 2022-10-13 09:14:22 +01:00
Oliver Davies 5c4e54152a refactor: extract a Markdown component 2022-10-13 08:55:38 +01:00
Oliver Davies 18a1dd0e03 fix: remove unwanted URLs for daily emails 2022-10-13 08:49:55 +01:00
Oliver Davies 69112f3976 fix: add article content to description 2022-10-13 00:15:24 +01:00
Oliver Davies 5efaf23eca chore(daily-email): re-add form 2022-10-10 23:02:27 +01:00
Oliver Davies 5f7acceb93 docs(daily-email): add email 2022-10-10 22:58:04 +01:00
Oliver Davies 1cedd10c90 chore: re-add Plausible Analytics 2022-10-10 21:07:51 +01:00
Oliver Davies d1b76dda33 chore: replace Sculpin with Astro 2022-10-10 20:50:54 +01:00
Oliver Davies d0ef96dead
fix(daily-emails): typo 2022-10-08 22:44:27 +01:00
Oliver Davies fd8975c2b3
docs(daily-email): add 2022-10-08 2022-10-08 22:43:32 +01:00
Oliver Davies 3407a052b0
docs(daily-email): add 2022-10-03 2022-10-05 07:33:26 +01:00
Oliver Davies 1c317feeac
docs(daily-email): add 2022-10-02 2022-10-04 00:57:10 +01:00
Oliver Davies c935c174b0
docs(daily-email): add 2022-10-01.md 2022-10-03 00:55:57 +01:00
Oliver Davies f99561e66a docs(daily-email): add post
diff --git a/ansible/ansible.cfg b/ansible/ansible.cfg
deleted file mode 100644
index cc79c59..0000000
--- a/ansible/ansible.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-[defaults]
-inventory = ./hosts.ini
diff --git a/ansible/deploy.yml b/ansible/deploy.yml
deleted file mode 100644
index ea5647a..0000000
--- a/ansible/deploy.yml
+++ /dev/null
@@ -1,14 +0,0 @@
----
-- hosts: web
-  gather_facts: false
-
-  tasks:
-    - name: Update the code
-      git:
-        repo: https://github.com/opdavies/oliverdavies.uk
-        dest: ~/oliverdavies.uk
-
-    - name: Pull the latest images and re-generate the site.
-      shell: ./run run-production
-      args:
-        chdir: ~/oliverdavies.uk
diff --git a/ansible/hosts.ini b/ansible/hosts.ini
deleted file mode 100644
index 01a3341..0000000
--- a/ansible/hosts.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[web]
-18.132.197.147
-
-[web:vars]
-ansible_user=ubuntu
diff --git a/website/source/_daily_emails/2022-09-30.md b/website/source/_daily_emails/2022-09-30.md
new file mode 100644
index 0000000..f5a63eb
--- /dev/null
+++ b/website/source/_daily_emails/2022-09-30.md
@@ -0,0 +1,83 @@
+---
+title: "Store Wars: different state management in Vue.js"
+date: "2022-09-30"
+permalink: "/archive/2022/09/30/store-wars-vuejs"
+tags: ["vue"]
+---
+
+I'm currently working on a Vue.js application that I started building in Vue 2 before starting to use the Composition API, and then moved it to Vue 3.
+
+In the original version, I was using Vuex for state management within the application, and interacting with Vuex directly within my Vue components - calling `getters` and `dispatch` to retrieve and update data.
+
+As part of moving to Vue 3, I wanted to evaluate any new options, like Pinia which is now the default state management library for Vue.
+
+But because I was integrating with Vuex directly, switching to an alternative would mean changing code within my components.
+
+## Defining a Store interface
+
+This is a situation that often occurs in back-end development - where you may need to switch to a different type of database or a different payment provider in an eCommerce application.
+
+In that situation, you need a generic interface that can be used by different implementations. Because they have consistent methods, one implementation can be replaced with another or multiple can be added at the same time. This is called the Strategy design pattern, and related to the open-closed principle in SOLID.
+
+This is what I did by adding a `Store` interface:
+
+```javascript
+export default interface Store {
+  actions: {
+    addRow(): void;
+    init(): void;
+    removeRow(index: Number): void;
+  };
+
+  state: {
+    isLoading: boolean;
+    selection: {
+      items: [];
+    };
+  };
+}
+```
+
+Any store that I want to work with needs to have these defined actions and state values, so I can use them within my components knowing that they will always be available.
+
+## Creating a native Vue store
+
+This is one implementation of the `Store` interface, using just Vue's `reactive` function from the Composition API:
+
+```javascript
+let state = reactive({
+  isLoading: false,
+  selection: {
+    items: [],
+  },
+});
+
+let actions = {
+  addRow(): void {
+    state.selection.items.push({
+      // ...
+    });
+  },
+
+  init(): void {
+    state.isLoading = true;
+
+    // ...
+  },
+
+  removeRow(index: number): void {
+    state.selection.items.splice(index, 1);
+  },
+};
+
+const vueStore: Store = {
+  actions,
+  state: readonly(state),
+};
+
+export default vueStore;
+```
+
+If I needed to add a Pinia version or another library, I can create another implementation that complies with same interface.
+
+Each implementation being responsible for any specifics for that library - extracting that logic from the component code making it more flexible and reusable.
2022-10-01 22:54:10 +01:00