Using Windows 10 and WSL for frontend web development
I’ve been an exclusively Mac developer ever since I bought a second hand MacBook
(remember the all white, plastic ones?). I absolutely loved it and as I got more
into software development and discovered the terminal it became hard for me to
see how I could go back to Windows.
When I started my first full time engineering role the company provided a
MacBook Pro and a Cinema Display. This was so exciting! Over the next few years
I was provided exclusively with MacBook Pros to work on (which I recognise is a
fortunate position to be in).
When Apple released the latest iteration of the MacBook Pro, with its touchbar
and keyboard woes, I did begin to wonder if Windows was going to end up being
something I’d have to try. Reviews online and from friends and colleagues who
had these MacBooks were not positive. About a year ago I was due a new laptop
and work and was given the newest MacBook Pro, at around the same time I was
starting to think about buying a laptop myself so I didn’t rely on my work
machine for personal projects. I’m also an Android phone user, so I’m not
invested into the Apple ecosystem as others which makes the potential swap to
Windows easier, I think.
The rest of this post is very much based on my opinions: none of this is a
recommendation on what you should do. We all have different preferences and
opinions on which hardware and software combination is best for us.
Sadly I’ve not found the experience of the MacBook Pro to live up to either its
“Pro” naming or its “Pro” price point. Whilst I think I’m in the minority of
people who actually don’t mind the butterfly keyboard I’ve found the software to
have some constant issues that I’ve struggled with. I’ve had the MacBook
completely shut down whilst running a workshop for 40 people because it told me
it was charging the battery despite not. I have to hard reset the machine when I
try to wake it from sleep at least once or twice a week in order to get anything
beyond a blank screen (the first time it did this I thought it had broken). I’ve
had regular issues with the HDMI dongle (and yes, I did pay full price for the
official Apple dongle 😢) and it not connecting properly to external screens. As
someone who does a reasonable amount of talking and teaching this has become a
real issue to the point where I considered taking a backup laptop because I
didn’t trust the MBP to work properly.
Windows and WSL
I’d been following the work on WSL (Windows Subsystem for Linux) for some time
and found it a very compelling prospect; being able to run a Linux distribution
from within Windows could be a great way to make Windows more feasible for the
development work I do. Coupled with the
VS Code WSL plugin,
which makes it seamless to run VS Code with files from that Linux subsystem, I
felt it could be a viable alternative.
Taking the plunge
So I decided, given my MBP frustrations, to go for it. I did some research into
machines and went for a Dell XPS, which are regularly given very high reviews
online. Some (non-engineering) colleagues at work have them and spoke highly of
the machine. It worked out at ~£1000 less than the MacBook Pro cost, which I
figured was a very good saving – but only if I could work effectively on the
machine.
Getting started with WSL
I didn’t really have a clue where to start with setting up the Windows machine.
I was fighting years of Mac muscle memory and took to Google to find posts to
point me in the right direction.
Dave Rupert’s post on webdev with Windows
was the best blog post I found and really helped explain some things and point
me in the right direction. However, that post was written in early 2018, and
somethings have changed which means the steps are simpler now. Dave mentions
needing to install Git on the Windows side so VS Code can find it, but with the
VS Code WSL plugin that’s not needed as it plugs into the git
that you have
installed on the Linux side. I also referred to the
official Windows WSL installation instructions,
using those to verify if a blog post was up to date or not.
The terminal
I’ve been a solid fan of iTerm2 for a long time and was struggling to find a
terminal on Windows that could get close to it. I tried a few before discovering
that the next big update to Windows will include a brand new terminal app! Even
better, you can download it now from the Windows store. The
Windows Terminal has provided me with
everything I need; it can easily be configured via JSON (so I can get my custom
font in there just fine) and you can configure it to automatically connect to
your Linux distribution when it starts up, saving the need to type ubuntu
everytime you fire up a command line prompt.
Seamless workflow
The new terminal, coupled with VS Code and the Remote plugin, gets me an
experience on Windows 10 that’s pretty much identical to my Mac workflow:
- Fire up a terminal.
- Navigate into the project directory.
- Run
code .
to load VS Code with that directory active. - Let the VS Code Remote plugin connect (this is normally quick so doesn’t
cause any delays). - Start coding!
Everything within VS Code works perfectly; if I pop open a terminal there it
will be in my Ubuntu WSL, I can use the Git UI without any fuss, and extensions
run just fine too. I’ve yet to hit any snags with this workflow.
The frustrations
The above might make it sound completely plain sailing but there have been
teething issues along the way that are worth considering if you’re thinking of
trying the swap to Windows:
- It’s a known problem that file reading/writing via WSL is much slower than it
should be. This is due to a limitation of how WSL works. The great news is
that WSL2 will fix this, but it’s not out yet (unless you run an “Insiders”
build of Windows 10 that is slightly less stable). In practice I don’t find
slow read/writes to be much of an issue but you can notice it, particularly if
you’re npm installing. - This is more on me than on Windows but having used OS X exclusively for so
long it’s taking some time to get used to Windows and its keyboard shortcuts.
It was definitely a few weeks before I felt comfortable and had found some 3rd
party apps that helped replicate some apps from OS X that I was missing. If
you take the plunge be prepared for a bit of frustration as you and your
muscle memory adapts. - I miss the Mac trackpad. The Dell one is perfectly good, but it’s not quite as
nice to use. That said the keyboard is so much nicer! so this one evens
itself out. - Because I’m using this laptop for side projects and mostly frontend work I
don’t hit upon any limitations of WSL but there are plenty of apps or
libraries that can cause issues when run within WSL. If you’re expecting WSL
to just work with everything I would taper your expectations slightly. That
said, WSL2 supposedly fixes a lot of this (I saw a video where someone runs
Docker via WSL2, which is quite cool!) so this might get better once WSL2 is
out.
In conclusion
I’ve been pleasantly surprised with my journey into Windows 10 so far and it’s
gone much better than expected! With WSL2 and further improvements to the
developer workflow on Windows I’m excited to see where we are in another 6-12
months time. It’s really exciting to see Microsoft shift and take this stuff
more seriously – and they are doing an excellent job!
Frontend tech choices I’m making in 2020
Happy New Year! The world of frontend web development is continually changing
with new technologies, ideas and frameworks springing up all the time. Whilst
this can get overwhelming, it’s also an exciting space to be in with so much
opportunity to try new things. Today I’ve picked out a few libraries, languages
or ideas that I’m looking foward to trying in 2020. Some of these aren’t
necessarily the new shiny thing – TypeScript has been around for a while now –
but they are all things that I think might make a big impact on the community in
the coming months.
I’d love to hear what you’re excited to work with or try in 2020!
Tweet @Jack_Franklin and let me know
😊
TypeScript
In 2019 I had some mixed experiences with TypeScript. I started rebuilding
test-data-bot in it (and did some screencasts of the
process) but on another React project ended up removing
TypeScript completely, which you can hear more about on Episode 8 of Fish and
Scripts.
Where I’ve landed with my opinions for now is that TypeScript for me is going
to be very beneficial on standalone JavaScript libraries, like test-data-bot,
but the trade off of TypeScript’s compiler catching errors compared to the
amount of hard debugging of obscure error messages when working on a large
application with many dependencies is not worth it. In my large React project
where I eventually removed TypeScript I spent more time debugging odd type
issues with React and Apollo and other dependencies than I did writing actual
application code.
I know the TypeScript team are aware that sometimes TypeScript’s errors aren’t
the most readable so work in this area may well make TypeScript an even more
compelling choice.
Svelte
Hardily a controversial choice, Svelte 3 has picked up a lot of well
deserved interest since its release. If you’ve not come across it I recommend
Rich Harris’ talk at YGLF as a great taster.
What I really like about Svelte is that it’s a compiler. This means that when
you hit save in your editor the compiler runs and converts your Svelte
components into JavaScript code that is then executed in the browser. This isn’t
what a framework like React does – in React you write JavaScript (or sometimes
JSX that is converted to JavaScript) and execute that in the browser.
Being a compiler, Svelte is able to spot potential issues at compile time and
let you know about them, aiding developer debugging. It’s also really good at
shipping the smallest amount of JavaScript possible because Svelte is able to
take your components and intelligently compile them down into the smallest, most
performant JavaScript that it can.
I also love some of the defaults that Svelte ships with, primarily that CSS is
entirely scoped to each component by default. This is my preferred way of
writing CSS and it’s refreshing to work with a tool that ships this out of the
box. It’s a small thing but it’s refreshing to not have to configure a build
tool to enable CSS Modules and instead just have the Svelte compiler do all the
work.
Rollup
Doing some reading into Svelte also leads naturally into Rollup, a JavaScript
module bundler written by Rich Harris who is the creator of Svelte. I like
Rollup because it feels very approachable; it’s very easy to create your first
bundle and very easy to add a plugin to solve a common problem such as bundling
CSS or using Babel.
What’s really impressed me with Rollup recently is how easy writing your own
plugins is. This has always felt like something far beyond my capabilities in
other tools – Webpack has felt like this black box to me and I would never
consider writing a plugin for that. Rollup on the other hand has good
documentation but also the Rollup plugins you find online (many of them written
by the core team) are very easy to look at and follow. The prospect of using a
bundler that I can manipulate and customise fully to suit my specific needs is
very exciting.
working with Rollup has been really fun – and is incredibly easy to customise with plugins. Checkout the source code if you’re interested – it’s very straight forward and way easier than you might think.
— Jack Franklin (@Jack_Franklin) 30 December 2019
I’m excited to work with Rollup on some projects in 2020 and see how it
develops.
Cloud databases
I have worked as and still can build backend applications but these days for
side projects I’m often keen to shift as much of the work as possible to other
tools to let me focus on the bits that I enjoy doing the most, and make it more
likely that this side project will ever see the light of day! I’ve always
defaulted in the past to Firebase because I’m familiar with it and it’s fairly
easy to work with once you’re used to the core concepts, but I’ve always had a
bit of a gripe in that the JavaScript libraries you need to use are quite large
in file size. This is definitely an area where I’d like to find other tools that
solve this problem and make it easy to host a frontend app that requires an API
/ database without having to build and host it myself. Recommendations welcome!
Letting tools make choices for me
I’ve noticed a trend in the tools that I like: they make choices for me. I’m a
fan of Svelte (or at least, a fan enough to want to get more familiar with it)
in part because it makes nice choices out the box and decreases the amount of
thought required in getting a Svelte project running. I continue to be a strong
advocate of Elm because the language makes decisions for me and helps prevent
silly bugs from creeping in. I maintain that Prettier has been the most
productive change to my toolset in the last couple of years because it makes so
many formatting decisions for me.
I don’t miss spending hours configuring Babel and all the myriad of plugins
required to get the exact set of features I want to have supported (to be fair,
@babel/preset-env
has made this much easier). I don’t miss trying to decide
what variant of CSS to use on this project. I’ve become a fan of putting more of
that burden onto the technologies I’m chosing such that I can focus in on the
actual application. I would be surprised if the tools that catch my eye in 2020
aren’t ones that follow this pattern.
What tech are you excited about in 2020?
Let me know! It’s so hard to narrow down to just a few and I’m sure there’s many
that I’ve missed. All suggestions are welcome and I’d love to discuss with you.
Drop me a tweet!
A case for weak dependencies in JavaScript
|
Flash to live on forever at the Internet Archive
|
Happy 25th birthday, JavaScript
|
Making JavaScript executables with Deno
|
The Spearhead Theme: A Minimal Design and Clean Slate for All Content Creators
When AngelList and Venture Hacks co-founder Babak Nivi came to us and wanted to donate a theme, our team was excited to work on the design to make it available to everyone on WordPress.com for free. Designed by Cece Yu and originally developed for the Spearhead podcast, the new Spearhead theme is fully block-powered and the first among our themes to support dark mode.
Spearhead works seamlessly with the block editor, supporting a wide range of blocks — Audio, Video, Image, TikTok, Loom, and many more — so you can customize posts and pages as you like and showcase various types of content, from podcast episodes to video tutorials and more. And while Spearhead shines as a theme for media, its sparse design also displays long-form writing and text and images beautifully.
Spearhead comes with some block patterns, or collections of predefined blocks, to give you a boost as you start building your site. There are a couple of patterns you can use to show a list of places where people can listen to your podcast, as well as a custom archive page.
Being the first theme on WordPress.com to support dark mode, Spearhead’s default color scheme has a white background, but if your operating system shifts into dark mode, the theme will change and display a dark background with light text.
Our team especially loves the theme’s clean design, which lets the content you create shine through. Your listeners and readers can sit back with their cup of coffee — headphones on — and enjoy your latest episode and read along with the transcript!
Explore the Spearhead demo site to see the design in action, and then visit the Spearhead page to activate the theme.
Learn from the experts: Create a successful blog with our brand new course
WordPress.com is excited to announce our newest offering: a course just for beginning bloggers where you’ll learn everything you need to know about blogging from the most trusted experts in the industry. We have helped millions of blogs get up and running, we know what works, and we want you to to know everything we know. This course provides all the fundamental skills and inspiration you need to get your blog started, an interactive community forum, and content updated annually.
How it works: Upon registering, you will receive access to review the lessons at your own pace. Our curriculum includes:
- Foundations of blogging
- Getting started with block basics
- Building your blog
- Understanding audiences
- Designing your blog
- Writing for the internet
- Branding and growing your blog
- Earning money with your blog
You’ll also be able to connect with WordPress.com experts and other aspiring bloggers, who will create content alongside you. Beyond the modules, this course provides:
- Monthly office hours with WordPress experts to answer your questions
- A certificate of completion
- Access to a private blogging community online
- Virtual meetups scheduled quarterly
Cost: A $49 annual subscription gives you access to all of these on-demand blogging resources, community events, and course updates. That way, you won’t have to waste time looking for answers all over the web—you’ll be able to get started right away.
Join by Thursday, December 10th and enjoy 50% off with code WPCOURSES50.
We are looking forward to reading your new blogs soon!
Join Us in Honoring Transgender Day of Remembrance
Today, November 20th, people around the world pause to bear witness to Transgender Day of Remembrance, a day dedicated to honoring the memory of those murdered because of anti-transgender prejudice. Transgender Day of Remembrance reminds us to fight against forces that devalue transgender lives every day. To bring awareness to this important day, we want to pause to share a few stories of transgender people who have found their voice on WordPress.com. We posed a question: “What does Transgender Day of Remembrance mean to you?” Below, we’ve shared a few responses from creators on our platform.
We welcome you to share your own response on your site. In the meantime, read slowly and soak in the hard-fought words of the brave voices who are willing to share their experiences.
Dr. SA Smythe (They/Them) of essaysmythe.com:
Some of us have been counted, but most of us are counted out—unthought and unthinkable. And so we do it ourselves. We account for Tony McDade. We are accountable to Muhlaysia Booker. We recall Riah Milton. We recollect the fierce life of one of our greatest contemporary remembrancers, the trans griot Monica Roberts. We name the nonbinary people who continue to be treated as unnameable as we slip through the matrix of binary gender. The competing racialized pandemics of our time continues to be intensified for trans people, especially Black trans women, in this year as with any other. We live with that reality and demand non-trans people do the same because our resilience is nothing without their reckoning for the violence they allow to continue against us. Trans Day of Remembrance is not only about how trans people have been stolen from us too soon, but how we continue to survive and thrive and persist against all odds. Has there ever been anything as beautiful as that?
Laura Kate Dale (She/Her) of laurakbuzz.com:
Going and spending some time in the company of other trans people was wonderful. I got to see trans people from a variety of backgrounds, some who had grown old and found love, and see proof that I could live a long and happy life as a trans woman. But the tone of the evening was contrasted by sitting with the knowledge of why we were all gathered, the knowledge of far too many lives cut far too short. I was surrounded by the trans people who had survived and thrived, as well as the memories of those who had not.
Nicole Eldridge (She/Her) of transgendersupport.org:
My name is Nicole Eldridge. I’ve been transgender since third grade. As I started to transition, I would read stories online about transgender people dying. This is absolutely terrifying if you want to do what they did. I never gave up and transitioned. Transgender Day of Remembrance means to me that we remember the transgender people that have died and carry out their goal of an equal future for all transgender people. Every time I listen to a Transgender Day of Remembrance speech, it brings me back to Martin Luther King’s speech, “I Have a Dream.” What King said about everyone being equal and having equal opportunities is so true when I hear the transgender people’s names who have died. It breaks my heart to hear all of the transgender people that died for the year. In spite of the hatred toward transgender people, I rise above it all and help transgender people all over the world with my website transgendersupport.org. This is what Transgender Day of Remembrance means to me.
Tallulah Ker-Oldfield (She/Her) of transrites.wordpress.com
Trans people are nothing new. Gender and its expressions have been changing throughout cultures, and trans people have existed throughout history with notable examples in the many ancient pantheons, including deities. There’s nothing new to consider, no trans question – we’ve been here all along, and the only terrible things that happened because of it happened to us…
***
And so I’m remembering trans lives lost this year, and trans lives filled with trauma, and everything that trans people have to do to simply… be. If you ever thought this year was scary, oppressive, isolating, challenging to get through and potentially fatal to be around people… you’ve been living a lot of the worst parts of the trans experience. Yet I’m remembering the powerful joy of my community, how our bonds through the pandemic have been strong, how well accustomed we immediately became to 2020, having lived our own version of it for most of our lives, creating found families, love, laughter, understanding and sometimes rainbows out of the unforgiving raw material of compromise.
To read more writing by transgender people, explore these sites on WordPress.com:
We pride ourselves on being a platform where anyone can share their perspective, and we’re honored to be able to create a space for the personal stories of transgender-identifying individuals. Take the time to read their words and remember that it’s not enough to honor transgender people just one day each year. What we do matters every day. Follow these sites and others you come upon and, as a result, show your support in the days to come.
Run With Us! Join the 2020 wwwp5K Movement
If you’re like us, you’re eager to send 2020 off to the dustbin of history. So grab your running/walking/yoga shoes and join us as we resurrect the historic #wwwp5K and celebrate reaching the 2020 finish line! As an added incentive and in the spirit of the season, we’ve also created a special wwwp5K Givz page, where participants can make a donation to three of our favorite charities: Black Girls Code, Internet Archive, and the WordPress Foundation. Automattic will match every dollar donated to any organization through the Givz page, up to $50,000.
What’s a 5K?
A 5K is the equivalent of about 3.1 miles. The virtual run will work on the honor system, but if you want to be accurate, apps like Strava, Garmin Connect, Runkeeper, Fitbit, and many others can help you measure the right distance.
Sounds awesome! How do I participate?
The virtual wwwp5K officially kicks off tomorrow, December 1, and will be open through December 31st. You can run, skip, walk, hop, walk backwards, or even swim the equivalent distance in an indoor pool — as long as you’re practicing appropriate safety precautions given local conditions and staying healthy, your activity counts.
Everyone is welcome! WordPress fans, friends, and family, as well as Automatticians around the world.
When you’re done, don’t forget to post a selfie on your WordPress site and tag it with “wwwp5k” so that we can share the love and others can read about your experience. Of course, you can also blog about your journey preparing for the wwwp5K, but most of all, we’d love to see your smiling face and happy shoes as you complete the 5K.
Is there swag?
What would a virtual run be without swag with a custom logo? To commemorate the 2020 run, we’ve created a limited edition technical shirt featuring the official wwwp5K Wapuu!
They’ll be available for purchase in the WordPress Swag Store starting tomorrow until supplies last, so don’t forget to place your order.
Will you be joining us? Let us know in the comments!
Subscribe to MarketingSolution.
Receive web development discounts & web design tutorials.
Now! Lets GROW Together!