visit
Setting up a development machine can be a tedious process. I once worked in a company where it was an achievement to complete the setting up of the development environment, for the custom shop system we were working on, in under two days (to be fair though, this was before Vagrant and Docker became a thing). And why’s that? Building software products relies heavily on things like your favorite editor or IDE to be productive, it depends on installed dependencies like databases, shell programs or servers to actually run and update your software. Is this still a necessity or could we ditch all of that and rely completely on cloud services today?
I recently gave a talk about the and had a look at how far you can get without placing a single file on your computer. As it turned out; you really can create websites, make them editable and later deploy them () from any computer using powerful online services today.
Earlier this year, I wrote an article and decided to give
a try. It doesn’t feel like my local editor (I’m using VSCode) — but it’s pretty close. In CodeSandbox you can start by forking one of the 500,000 (!) available user sandboxes, or choose to start from scratch using starter templates for React, Vue, Angular, and other frameworks. Looking at all the user-created sandboxes, you’ll see that the editor is used primarily for quick prototyping in the React ecosystem today. However, this doesn’t mean that you can’t use it to build something more complex inside or outside the React ecosystem.create-react-app is the base for CodeSandbox to create new React projects. For Preact, Vue and other frameworks similar CLI tools are available, and there’s even a “vanilla” starter template without heavy framework dependencies that uses (a new zero-config bundler — it’s fantastic, trust me!) under the hood to give you all the freedom you need.
When you decide to go the React route and initialize a new project, you’ll get a codebase that is ready to dive into React development.
cmd/ctrl+p to quickly access files and commands
There are a few things that I can not live without while doing web development — first, CMD+p
and CMD+Shift+p
. These two shortcuts let you jump to any file or execute any command available via a quick and easy-to-use fuzzy search. Programming is very often about productivity, and these two shortcuts help you to achieve anything without leaving the keyboard.
Dependency handling and automatic installation
But now you’re in a cloud environment, right? How does it work to install dependencies then? CodeSandbox provides a dialog which lets you choose dependencies from npm easily. When you install packages with this dialog, the package.json
will be automatically updated. Sweet!
Prettier included by default
When developing in CodeSandbox, is enabled by default, is configurable, and also runs very smoothly!Hot reloading in a separate window
Looking at the screenshot above, the editor provides you with an in-browser preview. The cool thing is that you can open the preview in a separate window, which is perfect for two monitor setups like mine. This way, the code is on one monitor and I can see the changes in near-realtime on the other one.Autocompletion for projects shipping with TypeScript type definitions
When I discovered that VSCode picks up type definition included in npm packages, I finally decided to go for TypeScript. As a JavaScript developer, I’m very used to working without great autocompletion but seeing my editor picking up TypeScript definitions is excellent. To see that CodeSandbox does the same is nice!
GitHub integration makes CodeSandbox a real tool to work with
The last feature that got me was GitHub integration, which lets you create a project in CodeSandbox, push it to GitHub, and then make commits from CodeSandbox directly to GitHub. Very cool stuff!
The only feature missing
Split-view mode for viewing multiple files at once is the only thing missing to make it my everyday application for development. Let’s hope that it’ll come soon! 🤞🏻
With Contentful you can define your needed data models in minutes and get the data back using JSON APIs. For the above example, you need an entity with individual fields for an image, a headline, and a paragraph respectively. This flexibility is where Contentful shines — create a content type portfolio
and define the three needed fields without any need to set up a server or something similar.
Later, you can use the provided to get the Contentful data edited by your friend.
// create the SDK client with the needed credentials// which you can get in the web appconst client = createClient({space: "...",accessToken: "..."});
function Portfolio() { /* … */ }
class App extends React.Component {constructor() {super();this.state = { isLoading: true, portfolio: null };// fetch the entry of your portfolio entry typeclient.getEntries({content_type: "portfolio"}).then(({ items }) => {this.setState({ isLoading: false, portfolio: items[0] });});}
<Portfolio {...this.state.portfolio.fields} />
). This connection makes Contentful .
Your next steps are to define a build command and public directory in which the static files will be present. In the case of create-react-app, the build command is npm run build
and the published directory will be build
. After submitting these two configurations, your first deploy will get up and running, and you’ll get a unique subdomain on netlify.com.
With a little bit more of webhook configuration, you can then set up a complete deployment pipeline without any local installation and configuration shipping static sites without loading spinners.
Webhooks and serverless functions give me the possibility to connect all these services and write quick connectors in the cloud in an easy and speedy manner. That’s very exciting because I can now focus on building things rather than setting things up and… I can even create and deploy websites on my friend’s computer while we’re sitting on his balcony.
Originally published at on August 7, 2018.