# Developer notes
-## Gitpod
+## Gitpod
+
This repository supports contribution using [gitpod](https://gitpod.io) which is online IDE using [Theia](https://github.com/eclipse-theia/theia).
To open-up the environment simple natigate on https://gitpod.io/#https://github.com/rstacruz/cheatsheets
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/rstacruz/cheatsheets)
### Preview built website
+
To preview the website you need to first build it then you can navigate to file that you are trying to contribute and preview directly.
<img src='_docs/images/gitpod_preview_tut.png' width=828 height=459/>
-
## Starting a local instance
-This starts Jekyll and Webpack. This requires recent versions of [Node.js], [Yarn], [Ruby] and [Bundler] installed.
+This starts Jekyll and Parcel. This requires recent versions of [Node.js], [Yarn], [Ruby] and [Bundler] installed.
```bash
yarn install
docker-compose build
# First-time setup
-docker-compose run --rm web bundle install && yarn
+docker-compose run --rm web bundle install && docker-compose run --rm web yarn install
```
Starting the server:
## JavaScript
-When updating JavaScript, be sure webpack is running (`yarn run dev` takes care of this).
+When updating JavaScript, be sure Parcel is running (`yarn dev` takes care of this).
-This auto-updates `/assets/packed/` with sources in `_js/`.
+This auto-updates `/assets/packed/` and `_includes/2017/critical/` with sources in `_parcel/`.
+
+Before committing, run `yarn parcel:build` first.
## JavaScript tests
```yml
---
title: React.js
-layout: 2017/sheet # 'default' | '2017/sheet'
+layout: 2017/sheet # 'default' | '2017/sheet'
# Optional:
category: React
-updated: 2017-08-30 # To show in the updated list
-ads: false # Add this to disable ads
-weight: -5 # lower number = higher in related posts list
-deprecated: true # Don't show in related posts
-deprecated_by: /enzyme # Point to latest version
-prism_languages: [vim] # Extra syntax highlighting
+updated: 2020-06-14
+ads: false # Add this to disable ads
+weight: -5 # lower number = higher in related posts list
+deprecated: true # Don't show in related posts
+deprecated_by: /enzyme # Point to latest version
+prism_languages: [vim] # Extra syntax highlighting
intro: |
This is some *Markdown* at the beginning of the article.
tags:
# Special pages:
# (don't set these for cheatsheets)
-type: home # home | article | error
-og_type: website # opengraph type
+type: home # home | article | error
+og_type: website # opengraph type
---
+
```
## Prism languages
category: Hidden
redirect_to: /es6
---
+
```
## Localizations
There are multiple ways to set meta description.
-### keywords (and intro)
+### Keywords (and intro)
Set `keywords` (and optionally `intro`). This is the easiest and the preferred
way for now.
JavaScript library for building web...
```
-### description (and intro)
+### Description (and intro)
Set `description` (and optionally `intro`)
building web user interfaces...
```
-### intro only
+### Intro only
If you left out `description` or `keywords`, a default description will be added.
-
-## Critical path CSS
-
-The critical path CSS is stored in:
-
-- `_includes/2017/critical/home.html`
-- `_includes/2017/critical/sheet.html`
-
-You'll need to update these every now and then when you change something in the CSS. Use this to update these snippets:
-
-```
-yarn run critical
-```
-
-You can temporarily disable critical path optimizations by loading it with `?nocrit=1`, eg, `https://devhints.io/?nocrit=1`.
-
-## Critical path JS
-
-There's JavaScript that's included inline in every page. It's entrypoint is:
-
-- `_js/critical.js`
-
-This is automatically compiled into the partial `_includes/2017/critical/critical.js`. Keep this bundle as small as possible.