We just open sourced our company guidelines site! We previously kept the contents in a private wiki on GitHub, but I’m glad we finally put the time in giving the contents a real home.
Like our docs site, the content is stored in markdown files, which can directly be edited on GitHub. The site deploys whenever something’s pushed to the master branch.
As for why we decided to open source it all…
This site contains a set of guidelines we use to bring our projects to a good end. We decided to document our workflow because consistency is one of the most valuable traits of maintainable software.
The contents of this site exist for ourselves—more importantly, our future selves—and for giving future collegues a reference to our way of doing things and their quirks. The guidelines cover workflow, code style, and other little things we consider worth documenting.
Headless Chrome to the rescue! Chrome can run as a cli tool, and print a pdf file from a url. All I had to do was make some layout tweaks to make everything printer-friendly.
Christopher Pitt wrote a pretty comprehensive article on one of our latest packages, which is one of my favorite packages I’ve written at Spatie to date, phpunit-snapshot-assertions.
Ah-ha moments are beautiful and rare in programming. Every so often, we’re fortunate enough to discover some trick or facet of a system that forever changes how we think of it. For me, that’s what snapshot testing is.
Read the full article on SitePoint, or check out phpunit-snapshot-assertions on GitHub.
In a recent Twitter thread, Sebastian McKenzie (Yarn and Babel author) shared his thoughts on the current state of open source. This tweet stood out for me (and he later ironically dubbed it his “most thoughtleader tweet ever”):
Revel in fragmentation and duplication because without it there’s stagnation and it stifles innovation.
When someone shares their latest pet project library, it’s often met with responses like “What a waste of time, you can already do this with library X!".
There’s no need for justification here. Maybe the author wants something that fully matches their use case instead of the 80% that library X does, maybe they want a different internal architecture. Maybe they have bigger future plans in mind, or most importantly, maybe they just want to experiment, learn, and have fun.
Since writing this post, TypeScript has become officially supported in Laravel Mix (version 0.12 and up). There’s still some informative stuff in here if you’re new to TypeScript, but use the official method if you’re on a newer version of Mix!
In a recent Spatie project we decided to give TypeScript a shot for the business critical part of a new application. TypeScript provides static analysis to reduce the chance of introducing bugs, to have self-documenting code, and to improve our tooling (autocompletion!)