sf-package-version-checker – SFDX Plugin to notify on completion of Salesforce Package Builds

If you’ve ever built Salesforce packages with the SFDX commands (in fact long before this) you’ll know that the creation of a package can take some time, especially if your package has dependencies.

At MobileCaddy we’ve been adopting the SFDX CLI as much as we can – and in fact embracing the SFDX ethos as a whole – and recently we’ve been working with the Salesforce second-generation packaging (2GP). During this I’ve found that the standard SFDX command to create a package version would continue to give me status updates every 30 seconds for 10 minutes by default, and even though I could set the overall timeout to a longer value (using the –wait flag, and specifying a number of minutes) I often forgot that the task was running and found myself forgetting to watch the terminal window. What I really wanted was something that would notify once the build had completed successfully (or erroneously).

So, during one of the package builds (~25 minutes in this case, if I remember correctly) I put together the basis for a new SFDX plugin that I could run to monitor the latest package build request, and then ping up a desktop notification when it had completed.

I was actually on the line-up for the (now postponed) CzechDreamin’ 2020, with a talk titled “Take your SFDX Plugins to the Next Level”. The talk covers many ways to interact with SFDX plugins other than via the CLI, and one of the topics included was the use of the node-notifier npm module to create native desktop notifications, and so I put this to good use.

You can very easily support basic (and more advanced) notifications with node-notifier for Mac, Linux and Windows environments; here’s some sample code (similar to that used in my plugin);

First import node-notifier (after installing it with npm/yarn)

Then to use it have code similar to this;

This results in this type of experience;

The source code (with little over 100 lines of actual logic) can be found in the github repo, and the plugin can be installed as an SFDX CLI plugin and run with the following commands;

Solved: Opening a new Salesforce scratch org not working

Just a quickie… have you ever created a new Salesforce scratch org then tried to open it from the CLI with sfdx force:org:open only to be routed to login.salesfoce.com? Well I have, and it was really annoying me.

But I have a solution (at least it works for me), just enter the domain of your new scratch org – this is output by the CLI command -straight into your browser. On doing this I’m taken into my org in a logged in state.

The Salesforce Podcasts I listen to

I’m a big fan of podcasts, and although my daily commute is often only a few seconds long (I work from home most days) when I do travel up to London for clients meets, or to attend the many Salesforce Trailblazer groups, it’s a journey upwards of 1.5 hours, so it’s an ideal time to get some listening in.

I’m going to list here a few of the podcasts that I regularly enjoy, and also a couple of new ones that I’ve subscribed to just recently.

8) Salesforce Developer Podcast

Although it was only launched a couple of weeks ago, around Dreamforce ‘19, there are already a handful of episodes available. Josh Birk – Principal Developer Evangelist at Salesforce – interviews folk from the Salesforce ecosystem. The shows are relatively short at 15-30 mins and have covered topics such as porting Aura to LWC, Blockchain, and PMD (Apex static analysis tool), and have included great folk such as Fabien Taillon and Brian Fear.

7) DEVel-UP – A RAD Women Podcast

Another pretty new podcast, and one I’m really enjoying already. The shows, like the Salesforce Developer Podcast, follow an interview format. It’s hosted by Blanca V. Leon-Carter – VP of Community Engagement at RAD Women. Each interview (so far at least) has been with folk who’ve been engaged with the RAD (RAD Apex Developer) Women project,either as grads, coaches (or both), and include really brilliant women such as MVP Bonny Hinners and Ladies be Architect co-lead Susanah Kate St.Germain.

6) The SaaS Revolution Show

OK, so not a true Salesforce podcast,but one I certainly recommend as someone working in the Salesforce and SaaS world. Alex Theuma chats to folk from all roles within the SaaS ecosystem, and covers topics from scaling businesses to business models, and company culture to content marketing.

5) Bet on the Web

Alright, you got me… it’s another non-Salesforce specific podcast. Bet on the Web is hosted by Mike Hartinginton and Matt Netkow from Ionic – a cross platform mobile (and desktop) UI framework. The episodes are released (mostly) monthly and focus on web technologies. This podcast should be of Interest to Salesforce developers since many of the topics discussed are relevant to the lovely new(ish) world of Lightning (specifically LWC). This is a show I’ve been listening to since the first episode, and is hugely relevant to us at MobileCaddy due to the fact we use Ionic in our stack when delivering mobile apps to the Salesforce world.

4) Salesforce Posse

This is a kind-of-regular podcast from two folk I know pretty well, Anup Jadhav (MVP and a former co-lead of the London Developers’ Trailblazer group that I help run) and Francis Pindar (also an MVP and one of my co-organisers of the Salesforce community conference London’s Calling). This podcast covers subjects and news relevant to both developers and architects, and is one that I certainly recommend you put on your list.

3) Code Coverage

This pretty irregular podcast (irregular in release schedule, not format) is hosted by two Salesforce developer superstars in the form of MVP Steven Herod and MVP Matt Lacey. There have only been three episodes this year, and the last one was in July, but when the pair do get together they discuss the latest Salesforce news along with some good deep technical discussions.

2) Two WiT

This podcast just never fails to make me smile… apart from when the ladies took a few months out of their pretty regular monthly release schedule. Hosted by MVP Kristi Campbell and MVP Melinda Smith the show is a brilliant mix of thoughts and mind-farts on everyday life, and views and discussion on Salesforce related topics. Although not specifically a dev-related podcast, I find it hugely valuable to hear from folk who are experts in other parts of the Salesforce world. The latest episode, an interview with Military Trailblazer LaRon Butler was doubly amazing… and if you do nothing else after reading this article please listen to this one. LaRon’s story is incredible, and her story-telling is just brilliant.

1) Good Day, Sir! Podcast

And so we come to my favourite Salesforce podcast… and yes it’s the Good Day,Sir! podcast hosted by MVP Jeremy Ross and MVP John De Santiago (who deliberately isn’t on twitter). Shows are released almost every week, and are usually John & Jeremy’s take on the latest goings-on in the Salesforce (and wider tech) sphere, along with a good amount (IMO) of beer and whiskey chat. They’re both well versed in their craft,but it’s not just their knowledge that’s good to hear, they’re also happy to turn down the Kool-Aid and call a spade a spade.

But you know what? The goodness of the Good Day, Sir! Podcast doesn’t end with the show. Oh No! They also have an incredible community of listeners (and probably some non-listeners) who come together and share and help each other out on their slack channel. Go register to join it right now!

So there you have it, that’s my run-down of podcasts to check out. But do you have others I’ve missed (I’m sure I have), if so please comment and share away.

Recommendations received since publishing the article;

  1. Cloudfocus Weekly Podcast – Suggested by Randi Thompson 
  2. Cloud Force Collective -Suggested by Randi Thompson 
  3. One of These Things -Suggested by Randi Thompson 
  4. WizardCast -Suggested by Randi Thompson 
  5. SalesforceWay -Suggested by Paul Battison

 

Hooked on communities

With WordCamp London just around the corner (6th April), and the recent success of the London’s Calling event – a community conference for those in the Salesforce world – it got me thinking about how I’ve come to love community events so much, and made me wonder when and where it all began.

From the London’s Calling point of view, as an organiser, it’s so rewarding to see folk enjoying themselves at the events. It’s clear to see that there are real personal benefits to attending events like this; you don’t just get to learn (which is huge in itself) but to be surrounded by fellow attendees, speakers and sponsors gives such an opportunity to (buzzword alert) network that just can’t be found anywhere else. The event has just run its fourth year, and is going from strength to strength.

Credit: Kerry Townsend

My history with WordCamps stretches even further back. I attended my first one in 2010; I was dabbling with web development (and failing at design) when I read about it in a copy of the .net magazine. At that point I’d never been to a conference like this, and the same could be said for the local meets too… but I decided to bite the bullet. I can’t remember the precise reason for signing up, perhaps it was the schedule, perhaps it was the incredibly low price (this year’s event is still amazing value at £40), perhaps it was just an excuse to geek out for a weekend? Whatever the reason I was hooked; listening to the volunteer speakers share their knowledge and experiences was life changing, and on top of that I had some amazing conversations and met folk that I’m still in contact with and certainly consider friends.

Following that WordCamp I started attending the local WordPress London meetups, and returned to WordCamp annually, and with each event I was exposed to more tech, more knowledge, and more great people. It was these events that spurred me to create the Widgets on Pages plugin (which has ~0.5 million downloads). They also gave me the push to give public speaking a go, which is a decision that has greatly helped me in both a personal and business sense.

Fast forward 9 years and I’m still attending community events, with the only issue being that the risk of clashes increases with each new one I sign up to. I’m also now paying back the communities that welcomed me with such open arms, through being on the organising teams of London’s Calling, the London Salesforce Developer’s Trailblazer Community Group, and WordCamp London 2019.

And now’s your chance to get hooked, with WordCamp London taking place during the weekend of the 6th – 7th April (with a contributor day on the 5th). If you have any involvement with WordPress, be it as a user, designer, or developer then there’s great content for you, and at just £40 for the two day conference ticket it’s mind-blowing value.

Start of a new journal – Green Fingers

I thought it was about time that I started blogging again, and what better subject to write on to ensure some cadence than gardening.

Following our move to Broadstairs one of the things we’ve gained is a lot more outdoor space, and so I’m hoping to put it to good use. In fact may good uses;

  1. Save money by growing some of our own food
  2. Help the environment through composting etc
  3. Educate the kids on all things green
  4. Educate myself on all things green
  5. Foster the idea of outdoor activites
  6. Create a beautiful place to be mindful

The garden is currently in a bit of a state, we had a ground-floor extension added to the back of the house, and the to-fro of workman and diggers has taken it’s toll… but onwards and upwards, right?

The first task was to build a raised bed for some veggies. Raff and I did this together, though as with every task that a 5 year old helps with it did take longer. The structure is made from decking (that I brought down with us in our move) and it stands at 8ft x 3ft and 2 ft tall. It’s filled with homemade compost from the 2 gigantic compost bins that were left by the previous owners. Whether or not this is a good base for veggies I don’t know, we’ll just have to wait and see. I have also made a flimsy frame for the top that is covered with chicken wire, as a hopeful barrier to the birds getting at the goodies inside.

The bed has had an initial “sowing” of peas, carrots, onion and garlic. At this point I should make it clear that I really don’t know what I’m doing, but I am reading and trying things out – and of course watching Monty Don on a weekly basis.

As well as planting stuff in the raised bed I’ve also planted a couple of Nicola potatoes in a tub, and I really hope to have 20-odd new potatoes from this.

Other tasks were also completed at the weekend, including vigorously cutting back a buddleia in the front garden (it stood about 12 ft tall and was being strangled by ivy) and ripping out a load of ivy from the hedges that border our garden at the front.

 

How I Archived sessions on London’s Calling site

Past conference sessions are a valuable asset for conference organisers, so for the London’s Calling Salesforce community event I came up with a way to archive them, and now you can too.

For the second year I was tasked with maintaining the website for Europe’s largest Salesforce community event – London’s Calling. And running up to the launch of the this years CFP for speakers and sponsorship registration I wanted to leverage the incredible resources that we had in the form of the sessions for the past two years.

Seeing that our site was powered by WordPress – using the Tyler conference theme – and that I have released a couple of WordPress plugins before (including the 5* rated Widgets on Pages) I wrote the Past Events Extension plugin to do just what was needed.

The free version enables site admins to archive sessions, which are then listed on a Past Sessions page. The Pro version includes support for a shortcode that can be used in any page or post to list these archived sessions for a given date range, meaning that you could for example create pages for each past event. The latter is what has been used on the London’s Calling site.

Running a not-for-profit event? Get 50% of the annual license now!

Other PRO features are;

  • Additional Video setting – Add embedded video for each past-session (e.g. from Vimeo, YouTube); ideal to show off past presentations.
  • Additional Slide-deck link setting – Add a link to slide-decks used for each session.
  • Enhanced Single-Session page – Shows the embedded video and slide links

So what are you waiting for? Go grab the free version now and use your previous events to help sell tickets and gain sponsors.

SOLVED Updating Failed – Error when updating with Gutenberg

As part of my recent investigations in the new Gutenberg editor for WordPress I came across a cheeky little error that had me stumped for a while.

Gutenberg Updating Failed error

Now, I saw this issue whilst running on a local VVV setup, that I’d created solely for this Gutenberg investigations, and as such it was running on an nginx server. I had also not tweaked the default permalinks settings.

Some digging later I pulled out this github issue, and that lead me to the solution workaround here.

Solution

To get it working, all you have to do is set a more fancy permalink structure, such as http://local.wordpress.dev/sample-post/.

Further Info

It seems the issue is to do with PUT request support in the default nginx config, and the way the WordPress REST API works out-of-the-box. If you want more info, follow that trac ticket above.


I hope to be writing more on my Adventures in Gutenberg, especially my work on adding support for it to the Widgets on Pages plugin.

Sinon – Checking if a function has been stubbed

Just a quick post here, in reference to using Sinon.jS, and checking whether or not a function has been stubbed.

Let’s say that you might have stubbed a function like this;

You can check to see if it’s been stubbed already, with this;

 

 

WordPress London – June 2017

After another favourable month in the meetup calendar, I was again available to get along to the WordPress London meetup, and boy was it a stonker.

Todd Halfpenny talking at WordPress London, wearing an Ionic Tshirt, looking animated.
Picture: Primary Image

The meet was held again at City University, who have been incredible venue sponsors of the meetup for ages, and who’ve agreed to keep up the sponsorship deal until the end of January 2018… bloomin’ good folk they are.

And speaking of sponsors, I should also mentioned that Gary and Dan announced that WP Engine have just agreed to a 12 months sponsorship renewal… so huge thanks to them also, and of course to SiteGround who sponsored the June event too.

Community Announcements

The meetup was taking on a new format this month, and the first change was the expanded section on announcements within the WordPress community. I’ll just bullet the key notes here;

  • WordPress London 2017 are after some support in formatting and posting up the transcripts from the talks. If you’re interested then you can find out more by tweeting me.
  • Videos from previous meets are on the WordPress London facebook page.
  • There’s a Profitable Developer Bootcamp for WordPress – Looks interesting if you’re interested in making money from WordPress
  • WordPress London have a new section for lightning talks, called wp_update_post… and they’d like talk ideas. If you’re interested, tweet ‘em up.

Also, here are some upcoming events…

The Role of Page Builders for Developers – Doug Belchamber

This first talk came from Doug, who works for Smarter Digital, and focused on his history with Page Builders, and how his opinion has changed over time, right up to the 2nd-gen page builders of today.

He told us how they’ve evolved, from the times of using shortcodes, and widgets, and then ACF. From these building-blocks came, what Doug refers to as, 1st gen page builders. These 1st gen incarnations had a few weak spots. They weren’t great at showing how content was going to be rendered on the front-end, their performance was questionable, and then if you disabled them you were left with what Doug refers to as shortcode hell. These thoughts and anecdotes appeared to ring true with many attendees… there were a lot of burnt fingers.

He then talked about Beaver Builder, one of a current raft of plugins that he classes as 2nd gen page builders. This part was thoroughly enlightening… he talked through how he uses it in his workflow, as a developer, and how you can create modules for it, configure it dramatically via its powerful API, and handle user access.

Now, I can certainly see myself as one of these devs who instantly feels a bit nauseous when page builders are mentioned, but Doug has done them proud with this talk… go watch it now.

wp_update_post

This next slot was incredible… Dan and Gary made a real steal in getting hold of this chap to talk through the updates to WordPress that dropped in version 4.8.

OK, I’m kidding… it was me doing a brief lightning talk as part of the new format of the meetup. I don’t want to big myself up too much, but if you want to know about the new Widgets then checkout the slides, or video of the talk.

WP_Model – Anthony Budd

Next up was Anthony, talking through his pseudo ORM for WordPress, WP_Model, and open source project designed to provide a better method for handling posts using a simple OOP style syntax.

I made so many notes on this, as it was truly fascinating. WP_Model can be thought of as cake, or Laravel, if you’re familiar with such things. Anthony started the project to abstract the way he had to deal with multiple tables in the WordPress database when building apps with WordPress as a Backend. He was having to use wp_post and wp_postmeta tables, but with WP_Model he was able to create an abstraction of the data. He had several goals for his project, they included;

  • Simple syntax
  • Easily added to existing project
  • Calls to go through wp core

Anthony also mentioned some generic benefits of re-using WordPress as the backend for your project. Things like its popularity and community, and from those the vast repository of plugins.

There were loads of great examples in Anthony’s talk, so I strongly suggest you check out the following links;

Wrap up

Well what can I say… GO CHECK OUT THE VIDS OR BE SQUARE.

Seriously, do it now… Doug and Anthony are aces!

And so are Dan, Gary and Annabelle, for organising another great meet. Thanks too to City University, WP Engine and SiteGround, for sponsoring.

Next meet is booked in for the 27th July, RSVPs open right now, too.

AngularZone Sept 2016 Meetup Review

I’ve got to be honest, when this meetup’s talks were announced I honestly didn’t know anything about GraphQL – in fact the only mention of it I’d seen (or taken notice of) was this one;

And with this in mind, and the fact the last AngularZone meet was so good, I was more than eager to make sure I went along… and of course it gave me a chance to sport my new MobileCaddy tee, too.

beta-tee

As well as these physical meets, Gerard has been putting on web based “JavaScript – Ask me Anything” sessions too, though I have yet to partake in those.

Now, I have some thoughts about the meetup and venue as a whole, but for now let’s jump straight into the talks.

Progressive Web Apps in the Real World – Dean Hume

PWAs are creating a lot of noise at the mo – and rightly so – and Dean “Deano” Hume was here to give us the latest lowdown on them, and talk about how their features can be used in the real world.

PWAs are built using an emerging set of web standards, and essentially offer web developers the tools to bring native-esq experiences to web sites and apps. Such capabilities include Push Notifications, Geo-location access and other hardware APIs including bluetooth and NFC.

Dean Hume presenting PWAs at AngularZone

Part of the awesome-sauce that powers PWAs are Service Workers. These are also being pumped highly in the web dev world, and they enable support for many cool enrichments to standard “web sites” as well “web apps” (and no, I don’t know what the difference really is, or even if it’s important). I’ve seen many talks on Service Workers and on the whole they’ve been very good, and normally have covered different uses, approaches, and features. But one thing they all include is a statement like “Nope, sorry, Safari doesn’t support them”.

Service Workers provide a dev with the ability to intercept network requests before they leave the browser, and this can be used to provide offline handling, low-data requests and probably plenty of other use cases that haven’t yet been thought of. Speaking of which, Dean covered a scenario using Promise.race in a Service Worker that provided an improved experience for when a third party library failed to load, and meant that the page was able to load much more quickly – very cool.

Dean showed us a few other PWA features, including;

  • Add to home-screen
  • Push Notifications
  • No-connectivity handling – being able to give the user at least some basic information offline.
  • Handling Chrome’s Data Saver.

Along with the great demos and info, Dean also supplied an incredible amount of links to online demos and resources… so check out his slides for all the details.

JavaScript Jeopardy – Tracy Lee

Now, I won’t claim to understand what happened next. But it was fun, so I’m just gonna leave this picture here and you can make of it what you will.

Angular Jeopardy - WTF

Following on from this, erm… experience… Tracy and Gerard went on to tell us about ngCruise. This is a new Angular conference with a difference. Yes, you’ve guessed it, it’ll take place on a cruiseship. The website should be launching this week but the plan is for the conference/cruise to commence by bobbing out of Florida in May 2017, and will comprise of a few days of talks, programming and fun. Tracy is hoping it’ll be a few hundred USD per day and should include talks, food and of course accommodation (with a difference). CFPs should open soon.

Angular Connect – Peter Bacon Darwin

Peter and Gerard gave us a nice little fireside-chat type thing, discussing the upcoming Angular Connect conference (27th/28th Sept). They mentioned how they were updating the format slightly, from last years conf, to try to emphasise some of the more interactive sessions. I can only imagine that the conference is going to be ace… as I’ve once again had to bail on getting a ticket.

Angular meets GraphQL – Uri Goldshtein

Closing us off was Uri Goldshtein, who had literally only just flown into London. Uri is part of the Apollo team and was hear to give is an introduction to GraphQL, and although his talk title mentioned Angular, it was mostly a generic intro. This was fine with me as I had virtually no idea about GraphQL, whatsoever.

Now I won’t try to come across as a GraphQL expert following the talk, in fact if anything I have more questions now than before… so as well as writing down what I think I grasped from the evening, I’ll also suggest that you take a look at the GraphQL website for yourself.

But anyhoo, GraphQL was born out of Facebook, late 2011, at around the time Mark Zuckerburg dissed web tech for mobile, and went all native on us. It is designed to be a “Query language over your existing data”. It can be used to provide a middleware and protect your clients from evolving backend APIs and updates. It’s also type-based, and should allow for absolute understanding between what a client asks for, and what it receives. Part of this middleware behaviour includes splitting single request out to multiple backends, and bundling the responses to each up into a single response for the calling client. This kind of architecture can mean drastically simplified client code… and that’s definitely a good thing in my book.

Uri demoed Instagraph, built by Kamil Kisiela, and showed us a very neat GraphQL editor/runner called Graphiql. During the demo Uri spoke about how the use of GraphQL allowed for “optimistic UIs”. This is an approach where UIs update as soon as an action, such as liking an Instagram photo, is invoked, and that actually these changes take place before any round-trip to the server/backend is made. This approach is one that we automatically use at MobileCaddy, though we tend to include this under the Offline First banner, but it’s nice to know this specific UI handling has it’s own name too.

Users of GraphQL, other than Facebook obviously, include Pinterest, Github and Shopify.

Despite Uri being a really passionate and captivating speaker, I’m not entirely sure I’ve “got” GraphQL yet – I don’t know whether it’s available simply through client side and server side libraries, or what transactional performance overhead, if any, comes into play. I would love the chance to see him and again and have a good chat about it all. With this in mind I think I’ll do some digging into whether or not I could sit GraphQL in front of Salesforce’s SOQL. So why not go out and start playing.

Wrap Up

In all this was another excellent meetup, and Gerard deserves high praise for organising such great talks and food (burritos) and drink. The inclusion of prize draws (FREE TICKET to ANGULAR CONNECT) is a really good touch. Thanks to go to eSynergySolutions for sponsorship and assistance.

Sadly, turn-out was relatively low. I counted less than 50 attendees, which is a shame as well over 100 had RSVP’d “Yes”. I found that there was little chat among attendees, and I also noticed this at the previous meetup. Whether or not it’s due to the size of the venue, or the fact that folk were sitting in the hall before and between talks, rather than around the breakout area, I’m not sure. At other meetups I attend, these “before and after chats” are one of the really valuable and attractive things. Maybe next time the hall can be “closed” whilst talks are not on, and hopefully they’ll be a deliberate post-talks-chat arrangement too?

Regardless of the above I definitely recommend coming along to these AngularZone meets if you’re in and around London and have interest in anything JavaScript, not just Angular.

Until next time… oh and please be in touch if you want to sponsor me to attend ngCruise 😉