Best practices for modern web development

Overview

Web Fundamentals on DevSite

Build Status License

Welcome to the new WebFundamentals! An effort to showcase best practices and tools for modern Web Development.

What's changed?

  • We're now using the DevSite infrastructure
    • New style guide
    • New widgets allow inline JavaScript, common links, related guide and more
  • Jekyll has been eliminated. Instead, pages are rendered at request time
  • Front-matter has been eliminated from the markdown, but files now require a simple set of tags

What stays the same?

Cloning the repo

If you have a high-bandwidth connection, I recommend starting with a fresh clone of the repo.

git clone https://github.com/google/WebFundamentals.git

Getting set up

The new DevSite infrastructure simplifies the dependencies a lot. Ensure that you have Python, Node 10-12, and the Google Cloud SDK already installed.

Login to Google Cloud via command line.

  1. Run npm install (needed for the build process)

Building the auto-generated files

Some files (contributors includes, some pages for updates, showcases, etc.) are automatically generated. The first time you clone the repo and run npm install, this is done for you. However, when you add a case study, update, etc., you'll need to re-build those files using:

npm run build

Starting Local Server

To view the site locally, just run:

npm start

Note: The first time you start the server, you may need to run start-appengine.sh and answer any prompts provided by dev_appserver.py.

Updating the code labs

To update the Code Labs, you'll need the claat tool and access to the original Doc files. This will likely only work for Googlers.

  1. Download the claat tool and place it in your tools directory
  2. Run tools/update-codelabs.sh
  3. Check the latest changes into GitHub

Starting the development server

  1. Run npm start in the terminal.

Testing your changes before submitting a PR

Please run your changes through npm test before submitting a PR. The test looks for things that may cause issues with DevSite and tries to keep our content consistent. It's part of the deployment process, so PRs will fail if there are any errors! To run:

npm test
Comments
  • Add new Understanding Resource Timing documentation.

    Add new Understanding Resource Timing documentation.

    Adding a new page specifically for resource timing. Moving the data from the existing network page to it and expanding upon it.

    Sorry @kaycebasques, you know I can't test locally. So please let me know what is needed to make sure this is linked properly from places like the DevTools landing page's Network tab. If it isn't automatically done.

    cla: yes 
    opened by Garbee 29
  • Web Performance Optimization with webpack

    Web Performance Optimization with webpack

    What's changed, or what was fixed?

    • Added an article on front-end performance with webpack

    Target Live Date: Probably January?

    • [x] This has been reviewed and approved by @addyosmani
    • [x] I have run gulp test locally and all tests pass. (There’re a few <script>-related warnings, but these <script> blocks are code examples)
    • [x] I have added the appropriate type-something label. (Not sure what’s this and haven’t found related info)
    • [x] I've staged the site and manually verified that my content displays correctly.

    R: @petele


    I also have a few formatting-related questions:

    1. For some reason, “Note:” blocks were recognized during one server launch and weren’t recognized during another. Probably that’s my local buggy installation, but IDK. Could we check this on the proper environment?

    2. Locally, {: .hide-from-toc } wasn’t hiding “Further reading” headers from TOC (see e.g. decrease-frontend-size.md. Could you please check if I’m using them properly?

    3. Is there a way to enable diff-like formatting (see below) for specific code blocks? I use it in a few code examples.

    - const a = 5;
    + const b = 5;
    
    1. I’d like to add “Next section” arrows like in “Optimizing Content Efficiency”. How to I do this? I haven’t found any related markup, and the “Optimizing Content Efficiency” article in my local build didn’t have them.

    image

    cla: yes type-Content 
    opened by iamakulov 22
  • Added

    Added "How to Think About Speed Tools" article.

    This PR contains new content mocked up for /web in the performance section entitled "How to Think About Speed Tools" requested by @addyosmani.

    cla: yes DevSite:Live 
    opened by malchata 21
  • Webpack guide updates for webpack 4

    Webpack guide updates for webpack 4

    What's changed, or what was fixed?

    • Updated the guide for webpack 4
    • Fixed a few wording/formatting issues

    Target Live Date: 2018-02-24 (webpack 4 release)

    • [x] This has been reviewed and approved by (Addy)
    • [x] I have run gulp test locally and all tests pass. (I’m on windows, and it’s hard here, sorry.)
    • [X] I have added the appropriate type-something label.
    • [x] I've staged the site and manually verified that my content displays correctly.

    Please don’t merge this yet. I was unable to test some plugins with webpack 4 because they weren’t made compatible yet. Here’s what left to do:

    • [x] Test the InlineChunkWebpackPlugin instructions and update them if necessary
    • [x] Test the WebpackManifestPlugin instructions and update them if necessary

    I’ll re-check the status of these plugins on the next week.

    Feel free to review the remaining text meanwhile, it should be stable.

    CC: @petele @addyosmani

    cla: yes type-Content section-fundamentals DO NOT MERGE DevSite:Live 
    opened by iamakulov 18
  • [Translation it] Performance > Optimizing content efficiency > Automating-image-optimization

    [Translation it] Performance > Optimizing content efficiency > Automating-image-optimization

    Italian translation of Performance > Optimizing Content Efficiency > Automating-image-optimization.

    Please review by @carlaofarrell

    Check out a review request at GitLocalize

    cla: no type-Content-Translation DevSite:Live 
    opened by lucab85 18
  • Add media video preload article

    Add media video preload article

    This is my WIP (not ready at all) article for video preload. Let's use it to get feedback.

    Live preview at https://pr-4744-dot-web-central.appspot.com/web/fundamentals/media/fast-playback-with-video-preload

    cla: yes 
    opened by beaufortfrancois 18
  • Update guidance on RAIL

    Update guidance on RAIL

    What's changed, or what was fixed?

    This is an update to our RAIL guidance including affordances for our newer loading metrics. It also introduces a more explicit call out for goals and guidelines for each area.

    The goals and guidelines call outs are something the Chrome Speed Metrics team felt would make for a more clear framing of RAIL.

    Fixes: #5464 with more details on what changed

    Target Live Date: December 15th

    • [ X] I have run gulp test locally and all tests pass.
    • [ X] I have added the appropriate type-something label.

    R: @petele @Meggin @kaycebasques

    Notes: This is my last day in the office for this year. If anyone would like to take on directly editing/addressing further changes before the new year, I'm more than happy for them to do so :)

    cla: yes type-Content DO NOT MERGE 
    opened by addyosmani 16
  • Make the homepage look more like the documentation page

    Make the homepage look more like the documentation page

    • Reduce the height and prominent of the link to "Get Started"
    • Include links to articles within sections
    • Use the card layout design that's currently on the documentation page
    opened by maxh 16
  • Feedback for: /fundamentals/getting-started/web-starter-kit/setting-up.html

    Feedback for: /fundamentals/getting-started/web-starter-kit/setting-up.html

    Under the Sass section you say that once you install Gulp globally that Sass will be available to you. I am pretty sure that the gulp-ruby-sass still relies on ruby and sass, so you still need to install ruby and sass separately for Windows Os. Otherwise nice articles!

    See gulp-ruby-sass page

    opened by delebash 15
  • [EN] Feedback for: /web/tools/chrome-devtools/profile/evaluate-performance/performance-reference?hl=en

    [EN] Feedback for: /web/tools/chrome-devtools/profile/evaluate-performance/performance-reference?hl=en

    It seems that the following guides:

    Are completely out of date, as far as I can tell. The Timeline view that I have in Version 47.0.2526.80 (64-bit) looks like: screen shot 2015-12-11 at 8 51 39 am

    Which doesn't seem to correspond at all to the view those articles use:

    image

    It wouldn't be a big deal if it was just a small UI update, but it seems that the feature set described in those articles have been replaced, or at least obscured. Things like Events/Frames mode seem to be gone, and I can't find any newer posts with updated information on the Timeline view.

    At the very least, if there is a post I'm missing, this article should note that the view is out of date.

    section-tools 
    opened by aweary 14
  • Localization Support: Quick questions before translating WebFundamentals

    Localization Support: Quick questions before translating WebFundamentals

    Hi

    I just try to translate WebFundamentals into Korean with some developers, and have some quick questions before diving it. :)

    Q. Is it possible to commit translated pages one by one?

    For example, when I translated article in HTML5Rocks, I added the directory 'ko' in same level of place of source tree, and then translated it. If users visit an article without its translation, H5R shows a sorry message and delivery its default version. I think that it's available at WebFundamentals as I can see from Translation Guide. I just want to confirm it again before arranging our translation plan. :)

    Q. How can we track changes of documents?

    WebFundamentals' articles have been updating frequently. This means translator have to track these changes like below:

    1. Being aware of update.
    2. Finding the latest source version of translation.
    3. Comparing it and its new history for knowing where it have been changed.
    4. Updating translations.
    5. Repeat these works.

    Suggestion: support workflow tools for translation

    I think the most simple solution is that adding current source hash to the translation. However, human can take mistakes easily, I hope some utilities for initialization of translation and searching out-dated documents like below:

    Initializing structure or page for the translation

    Before translating article(s), Translator initialize structure or page. I guess this can be ignored on working process. I just suggest this to avoid copying unnecessary resources.

    $ translate _en/fundamentals/getting-started/your-first-multi-screen-site/ -l ko
    Create files at _ko/fundamentals/getting-started/your-first-multi-screen-site/
    [1] content.markdown
    [2] index.markdown
    [3] responsive.markdown
    
    Finding outdated translations
    $ find-outdated -l ko
    Find 1 outdated translation(s)...
    
    [1] _ko/fundamentals/getting-started/your-first-multi-screen-site/index.markdown
    Source: _en/fundamentals/getting-started/your-first-multi-screen-site/index.markdown
    Latest source version: 3a4e67bf - 7 commit(s) after translation
    ...
    

    Then translator can update the translation according to its history.

    Update hashes

    This will add the version of source hash to the translation, when translator want to update it.

    $ update-hash _ko/fundamentals/getting-started/your-first-multi-screen-site/
    Update hash information in translations...
    
    [1] content.markdown has updated as 1286eab3 of _en/fundamentals/getting-started/your-first-multi-screen-site/content.markdown
    [2] index.markdown has updated as 3a4e67bf of _en/fundamentals/getting-started/your-first-multi-screen-site/index.markdown
    

    Then commit translation and send Pull Request or Update hash before update.

    Of course, above things are just sketchy imaginations. If you have any suggestion, It helps us. Thanks. :)

    opened by cwdoh 14
  • [Remote Debugging]

    [Remote Debugging]

    Welcome! Please use this template for reporting documentation issues on https://developers.google.com/web/.

    For questions about Chrome DevTools, checkout the google-chrome-devtools tag on StackOverflow. For questions about Chrome, check the google-chrome tag. If you think you've found a Chrome bug, check out our feedback page for more details on how to file it.

    Page Affected: https://developers.google.com/web/TODO

    What needs to be done?

    Please provide description of what's needs to be done here. Please be sure to include the link to the original page and any supporting links/data.

    • [ ] Appropriate type-something label has been added.
    • [ ] Appropriate section-something label has been added.
    opened by rabbit2190 0
  • [Remote Debugging]

    [Remote Debugging]

    Welcome! Please use this template for reporting documentation issues on https://developers.google.com/web/.

    For questions about Chrome DevTools, checkout the google-chrome-devtools tag on StackOverflow. For questions about Chrome, check the google-chrome tag. If you think you've found a Chrome bug, check out our feedback page for more details on how to file it.

    Page Affected: https://developers.google.com/web/TODO

    What needs to be done?

    Please provide description of what's needs to be done here. Please be sure to include the link to the original page and any supporting links/data.

    • [x] Appropriate type-something label has been added.
    • [x] Appropriate section-something label has been added.
    opened by Nicolebogeng 0
  • Verbal fix on documentation's blue

    Verbal fix on documentation's blue "activation" note section

    Page Affected: https://developers.google.com/web/ilt/pwa/introduction-to-service-worker#activation

    What needs to be done?

    Typo fix on blue "activation" note section: Remove the double the on sentence: ... because the new page will be requested before the the current page is unloaded ...

    image
    opened by menepet 0
  • PageSpeed Insights can't realize CSS Cascade Layers.

    PageSpeed Insights can't realize CSS Cascade Layers.

    Hi,

    I use PageSpeed Insights to check web page. I found my CLS score is ugly then I realize CSS losing (from preview). I use CSS Cascade Layers for web page. I wonder can't PageSpeed Insights realize CSS Cascade Layers ?

    image

    Here comes my style code.

    <style>
    @layer reset, defaults, patterns, components, utilities, overrides;
    
    @import url('css/auction/reset.css') layer(reset.reset);
    @import url('css/auction/defaults.css') layer(defaults.vars);
    @import url('css/auction/header.css') layer(components.header);
    @import url('css/auction/footer.css') layer(components.footer);
    @import url('css/auction/buttons.css') layer(components.buttons);
    @import url('css/auction/carousel.css') layer(components.carousel);
    @import url('css/auction/shortcuts.css') layer(components.shortcuts);
    @import url('css/auction/heros.css') layer(components.heros);
    </style>
    

    Thank you for reading.

    opened by meistudioli 0
Releases(0.3)
Owner
Google
Google ❤️ Open Source
Google
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
An IoT bottle that tracks water consumption. Winner of Best Health Hack, MLH's Best Hardware Hack, and QB3's Best Big Data for the Improvement of Health Care Winner at CruzHacks 2022.

An IoT bottle that tracks water consumption. Winner of Best Health Hack, MLH's Best Hardware Hack, and QB3's Best Big Data for the Improvement of Health Care Winner at CruzHacks 2022.

Nathanael Garza 2 Jan 21, 2022
An easy-to-read, quick reference for JS best practices, accepted coding standards, and links around the Web

Feel free to contribute! Where? http://www.jstherightway.org Why? Today we have a bunch of websites running JavaScript. I think we need a place to put

BrazilJS 8.5k Jan 1, 2023
:white_check_mark: The Node.js best practices list (March 2021)

Node.js Best Practices Follow us on Twitter! @nodepractices Read in a different language: CN, BR, RU, PL, JA, EU (ES, FR, HE, KR and TR in progress! )

Yoni Goldberg 85k Jan 9, 2023
A set of best practices for JavaScript projects

中文版 | 日本語版 | 한국어 | Русский | Português Project Guidelines · While developing a new project is like rolling on a green field for you, maintaining it is

Elsewhen 28.4k Jan 1, 2023
Enforcing best practices for Effector

eslint-plugin-effector Enforcing best practices for Effector This plugin uses TypeScript for more precise results, but JavaScript is supported too. In

effector ☄️ 89 Dec 15, 2022
Some HTML, CSS and JS best practices.

Frontend Guidelines HTML Semantics HTML5 provides us with lots of semantic elements aimed to describe precisely the content. Make sure you benefit fro

Benjamin De Cock 8.1k Jan 1, 2023
📗🌐 🚢 Comprehensive and exhaustive JavaScript & Node.js testing best practices (August 2021)

?? Why this guide can take your testing skills to the next level ?? 46+ best practices: Super-comprehensive and exhaustive This is a guide for JavaScr

Yoni Goldberg 19.9k Jan 2, 2023
A solid create-remix app, that applies best practices into a clean, batteries included template. SQLite version. Deploys to Fly.io

Remix Barebones Stack npx create-remix --template dev-xo/barebones-stack A solid create-remix app, that follows community guidelines and applies best

Dev XO 97 Dec 30, 2022
Algorithms and Data Structures implemented in TypeScript for beginners, following best practices.

The Algorithms - TypeScript TypeScript Repository of TheAlgorithms, which implements various algorithms and data structures in TypeScript. These imple

The Algorithms 166 Dec 31, 2022
In this project, I implement a Simple To Do List with the CRUD (create, read, update, delete) methods. I followed the JavaScript, CSS, HTML, DRY, KISS and YAGNI Best practices.

To Do list: add & remove In this project, I implement a Simple To Do List with the CRUD (create, read, update, delete) methods. All the elements of th

Olivier 6 Nov 20, 2022
In this project, I built a to-do list app, which is inspired by the minimalist website. Build withHTML/CSS & JavaScript best practices: Correct use of tags, elements, properties and syntax.

Webpack Exercise In this project, I built a to-do list app, which is inspired by the minimalist website. Built With HTML/CSS & JavaScript best practic

Vanessa Oliveros 3 Oct 11, 2022
Do i follow JS best practices?

To-Do-List-code-review Do i follow JS best practices? Built With HTML CSS JavaScript ES6 Webpack Live Demo (https://kelvin-ben.github.io/To-Do-list/)

Kelvin Benjamin 3 Oct 10, 2022
Dynamic-web-development - Dynamic web development used CSS and HTML

Dynamic-web-development ASSISNMENT I just used CSS and HTML to make a mobile int

null 1 Feb 8, 2022
vota.dev - Vote the best web development trends of the year

vota.dev Welcome to vota.dev! This is a work in progress! Development GitHub - Set-Up an OAuth Application Using Railway Development Install the proje

Miguel Ángel Durán 97 Dec 28, 2022
A Big Picture, Thesaurus, and Taxonomy of Modern JavaScript Web Development

Spellbook of Modern Web Dev A Big Picture, Thesaurus, and Taxonomy of Modern JavaScript Web Development This document originated from a bunch of most

Dexter Yang 15.6k Dec 31, 2022
The best UI framework out there 🦆 In development 🚀

Noia UI Getting Started | Community | Creators | ?? Noia UI ?? in development... ?? Getting Started # First clone this repository $ git clone https://

Foton 18 Mar 10, 2022