• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Dion Almaer

Software, Development, Products

  • @dalmaer
  • LinkedIn
  • Medium
  • RSS
  • Show Search
Hide Search

Archives for July 2016

Separating Concerns through Service Worker Helpers

July 25, 2016 Leave a Comment

Literal cross cutting

I am enjoying a new pattern emerge as we do more work with service workers, and that is wrapping a libraries usage, or some functionality, with a service worker that improves a particular concern: e.g. reliability. This reminds me of a past life in which I enjoyed aspect oriented programming techniques to keep the core business logic clean, but add other concerns separate from that codebase.

Let’s take a look at two examples of this technique that popped up in the last couple of days.

Case One: Offline Google Analytics

As soon as you start considering how your app will work offline, you think about many side effects. How will I track the offline usage is one. You may naturally take an analytics library and start flushing out the cases for checking for network access and doing the right thing. The problem though is now you may have a lot of logic that is dealing with offline usage tied into business logic, and you also may be looking at how to funnel all usage through this library.

Instead, you can add this functionality through a service worker that is able to intercept access to particular URLs, which is exactly what sw-offline-google-analytics does:

“sw-offline-google-analytics sets up a new fetch event handler in your service worker, which responds to requests made to the Google Analytics domain. (The library ignores non-Google Analytics requests, giving your service worker’s other fetch event handlers a chance to implement appropriate strategies for those resources.) It will first attempt to fulfill the request against the network. If the user is offline, that will proceed as normal.

If the network request fails, the library will automatically store information about the request to IndexedDB, along with a timestamp indicating when the request was initially made. Each time your service worker starts up, the library will check for queued requests and attempt to resend them, along with some additional Google Analytics parameters”


Case Two: Keeping Users Logged In

“Why does my app never ask me to re-login, but the website seems to force me to every now and then?”

There is no reason to not offer safe long sessions on the web, and we can piggy back on the age old two-token pattern to refresh tokens at appropriate times.

The example code shows a service worker that does the refresh work based on the expiration date, by wrapping calls to the backend.


Helpful Workers

Service workers are powerful and as such there are many things that you can do. It is interesting to see people come up with patterns to make common uses simpler. We are pushing on this with our own sw-helpers and I am curious to see what others come up with.

We need to remember to scope the work that is done there appropriately, because you obviously can’t rely on the user having a service worker, but there are so many cases where you can drop in useful functionality in a progressive way.

Remixing the Web

July 11, 2016 Leave a Comment


Building the next top app is often compared to getting a big hit at the box office. Talent often finds itself in a crowded marketplace where you need some luck (including timing!) to go along with said talent.

Building applications and services for people isn’t the same as building movies, but there is a lot that each medium can learn from each other.

I have been thinking about the current disruption of media, and if there is anything that we can learn from it on the software development side.

Who Are The Professionals

There are only 6-700 hollywood movies distributed in a given year. Compare that to the 500+ hours of video uploaded to YouTube alone. The realm of video used to be solely for huge groups with expensive equipment, coming together to create something (hopefully) epic. Now, everyone with a smart phone has a camera in their pocket and they aren’t afraid to use it (and upload the results).

It isn’t only the creation of video content that matters of course, but the consumption side. Gone are the days where these videos were siloed off as family movies and the like. My kids jump on YouTube as their main source of video content, and the quality of some of the content is incredibly high (much of it is…. no so).

When we went mainstream, first the tools allowed you to capture video simply. Then, you could do simple edits and manipulation. Now, you can do a lot of top quality editing on your own device, not needing all of the expensive custom equipment. The high end tools push the barrier on what is possible with movies, and then the consumer grade software slowly follows and sucks up the good ideas and makes amazing things happen with a click or tap of a button. At this point services often go ahead and do all if this work proactively and just tell you “hey, I sticked together your content, and put it together with a great score…. want to check it out?”

I notice that a lot of the content that my kids enjoy is very directly remixed. You can remix content at various levels of abstraction. At a high level you could take the concepts behind Joseph Campbell’s hero’s journey analysis. In fact you may have ended up following the pattern without even knowing it. At a lower level though you can take a product and add your touch. Maybe you didn’t like the ending and create another one? Maybe you have something to add to the “universe” and you put in new adventures? Fan fiction has had a long history in society, and it seems that this is now exploding as the distribution of this content has less friction and fans can easily find it.

There is something great about the constraints of one story, and the craft that the team put into it. I value that. I also value the ability for us to keep iterating and expand on these ideas. I have always dreamt of going to a movie and having a “choose your own adventure” experience where the audience votes. This would enable a special live experience, and chances are you would be willing to come back and give it another shot if the content was great. There is a certain amount of freedom given to the platform (movie distribution, theatre, capabilities, etc) the developer (people making the movie components) and the user (choose your own adventure).

Crafting applications that mimic the large scale movie hits is one thing, but what about also enabling great remixing of these experiences?

The Web has always had a foot in this world. We have mashups and iframes and the like, which have encouraged the joining of different sources beyond a backend API, and all in a fairly simple way. Marry this with responsive design and progressive enhancement and the content can know its constraints and adapt to them.

Could we do more to the web platform to enable even more remixing and merging of experiences? Can we make it very secure? Could we use web components as a way to go beyond iframe?

What if we used the fact that a <semantic-tag> is loosely coupled to its implementation? Developers could offer alternative implementations, and users could even make choices here too. I like it when the ecosystem has nobs for each group. On the other hand, it drives me nuts when I am in “Application A” and want to send a URL to my browser of choice and instead am only given the option to pass it to the “standard” browser. Too many of the integrations do not allow the user as much control as they would sometimes like. Browser extensions have been interesting because power users have mainly been the consumers. With these, and tools like greasemonkey, more was possible. They were often brittle, and they would often cause performance and/or security issues, but they did bring flexibility that didn’t exist for users in other ways.

We have all had instances where we use a product but wish it did something a lil different, or wish there was one minor feature. These features may not make the ROI of the product owner, but to you… they are P1. It would be nice to be able to enable a system where your priorities can be taken care of even if they aren’t the top average priority.

With progressive web apps we are bringing some important native capabilities to the Web, in a way that fits in well. Now that we have more capabilities, what can we do with them, and how can we apply the pieces that we love about the Web into this new Web. I have loved how traditionally easy it was for someone to get up and running with Web content. We had a period of time where we didn’t keep going up the stack, and thus it is easy to bold some content, but it isn’t easy to drop in rich controls.

It is important to go after the movie makers, but I think it is also important to keep pushing to enable everyone else to be able to create compelling content too. At scale, some of it will be some of the most interesting content out there.

Widening your lens for usability testing

July 6, 2016 Leave a Comment


Do you you start your user testing at the wrong point? I really enjoy watching users interact with my software products. When I get behind the two way mirror I never know what is going to happen, but I do know that I will learn a lot. It turns out that time and time again users think very differently as they try to get tasks done. Seemingly small changes can have large effects, and vice versa.

As you see more and more user tests you also learn the art of how to set them up. One common mistake I have made is seeding the wrong starting point, and thus missing out on a lot of learning.

One recent example revolved around some developer products. I asked a developer to add a feature to an application and set them up with the documentation of said feature. This initial web page anchored them for the entire process. They stayed within the walls of the website to get the job done. There were many learnings to be had on the information architecture of the site and how a lot of great content was locked away from the developer. For example, some of the best content for a particular problem that she ran into was not exposed in the main documentation, but rather in a codelab, and even a Udacity course. The mental model of the developer wasn’t “now I am going to do a codelab”, nor “I will sign up for a course to learn this first”, but rather “I just want the answer to my damn question to keep progressing!”

I have re-run tests like these, and finally I noted my mistake. Why was I anchoring the developer? The next time around the test subject started with a blank slate. What happened next was obvious: they started to google around for the answer. This lead them to solutions all over the web (for good and ill) and gave us a vastly different view of the problem.

We then opened things up once again by changing the request to involve their own systems. Now we got to observe beyond “how to add feature X to a skeleton” and instead see how the feature fits into particular contexts. You quickly uncover the fact that your documentation may not take into account the pain of having to glue together “feature X” with the context of “getting that setup on AWS”.

Getting into the right mindset can be key. This often comes up on the product side when you are making comparisons. When creating a shopping list app you may focus on competing with $OTHER_SHOPPING_LIST_APP when you should be thinking about how to compete with a pen and paper. With payment solutions you are competing with the features intrinsic to credit cards and cash.

There is a time to go narrow and iterate in focused areas, but it is often important to widen the lens.

Next Page »

Primary Sidebar

Twitter

My Tweets

Recent Posts

  • Stitching with the new Jules API
  • Pools of Extraction: How I Hack on Software Projects with LLMs
  • Stitch Design Variants: A Picture Really Is Worth a Thousand Words?
  • Stitch Prompt: A CLI for Design Variety
  • Stitch: A Tasteful Idea

Follow

  • LinkedIn
  • Medium
  • RSS
  • Twitter

Tags

3d Touch 2016 Active Recall Adaptive Design Agile AI Native Dev AI Software Design AI Software Development Amazon Echo Android Android Development Apple Application Apps Artificial Intelligence Autocorrect blog Bots Brain Calendar Career Advice Cloud Computing Coding Cognitive Bias Commerce Communication Companies Conference Consciousness Cooking Cricket Cross Platform Deadline Delivery Design Design Systems Desktop Developer Advocacy Developer Experience Developer Platform Developer Productivity Developer Relations Developers Developer Tools Development Distributed Teams Documentation DX Ecosystem Education Energy Engineering Engineering Mangement Entrepreneurship Exercise Eyes Family Fitness Football Founders Future GenAI Gender Equality Google Google Developer Google IO Google Labs Habits Health Hill Climbing HR Integrations JavaScript Jobs Jquery Jules Kids Stories Kotlin Language LASIK Leadership Learning LLMs Lottery Machine Learning Management Messaging Metrics Micro Learning Microservices Microsoft Mobile Mobile App Development Mobile Apps Mobile Web Moving On NPM Open Source Organization Organization Design Pair Programming Paren Parenting Path Performance Platform Platform Thinking Politics Product Design Product Development Productivity Product Management Product Metrics Programming Progress Progressive Enhancement Progressive Web App Project Management Psychology Push Notifications pwa QA Rails React Reactive Remix Remote Working Resilience Ruby on Rails Screentime Self Improvement Service Worker Sharing Economy Shipping Shopify Short Story Silicon Valley Slack Soccer Software Software Development Spaced Repetition Speaking Startup Steve Jobs Stitch Study Teaching Team Building Tech Tech Ecosystems Technical Writing Technology Tools Transportation TV Series Twitter Typescript Uber UI Unknown User Experience User Testing UX vitals Voice Walmart Web Web Components Web Development Web Extensions Web Frameworks Web Performance Web Platform WWDC Yarn

Subscribe via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Archives

  • October 2025
  • September 2025
  • August 2025
  • January 2025
  • December 2024
  • November 2024
  • September 2024
  • May 2024
  • April 2024
  • December 2023
  • October 2023
  • August 2023
  • June 2023
  • May 2023
  • March 2023
  • February 2023
  • January 2023
  • September 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • November 2021
  • August 2021
  • July 2021
  • February 2021
  • January 2021
  • May 2020
  • April 2020
  • October 2019
  • August 2019
  • July 2019
  • June 2019
  • April 2019
  • March 2019
  • January 2019
  • October 2018
  • August 2018
  • July 2018
  • May 2018
  • February 2018
  • December 2017
  • November 2017
  • September 2017
  • August 2017
  • July 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016
  • October 2016
  • September 2016
  • August 2016
  • July 2016
  • June 2016
  • May 2016
  • April 2016
  • March 2016
  • February 2016
  • January 2016
  • December 2015
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • June 2015
  • May 2015
  • April 2015
  • March 2015
  • February 2015
  • January 2015
  • December 2014
  • November 2014
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • May 2014
  • April 2014
  • March 2014
  • February 2014
  • December 2013
  • November 2013
  • October 2013
  • September 2013
  • August 2013
  • July 2013
  • June 2013
  • May 2013
  • April 2013
  • March 2013
  • February 2013
  • December 2012
  • November 2012
  • October 2012
  • September 2012
  • August 2012

Search

Subscribe

RSS feed RSS - Posts

The right thing to do, is the right thing to do.

The right thing to do, is the right thing to do.

Dion Almaer

Copyright © 2026 · Log in

 

Loading Comments...