top | item 14629534

Google Web Starter Kit

255 points| lin0tune | 8 years ago |developers.google.com | reply

77 comments

order
[+] TheAceOfHearts|8 years ago|reply
I'd advocate most people avoid this if their intention is to write an app. As an alternative, I'd suggest evaluating create-react-app [0] or preact-cli [1] if you're looking for something lighter. The lack of testing setup and module support in this kit feels like a regression, although I'll concede that it really depends on your use-case.

I've been using webpack [2] for a few years and wouldn't willingly go back to this style of writing web apps. Once you learn how to use it, the world is your oyster. You can write a loader or plugin to achieve pretty much any kind of requirement that comes your way.

Consider replacing sass with cssnext [3], or even directly using postcss along with the few plugins you need. As an example, you can use native css variables during development and compile em away for production. Another great addition is the :matches selector, which makes for much cleaner selectors in certain cases. I never really found much value in most other sass features.

Instead of running imagemin as part of your build process, consider installing imagemin-cli [4] and applying optimizations before checking in images. That way it only has to done once, regardless of how many times someone checks-out your repo.

Even if you enable ES2015 compilation with babel, you don't get any polyfills. That means trying to use standard ES2015 globals like Map, Set, or Promise will not work on older browsers. If you're gonna tell people they can add ES2015 support by changing a single line, it would seem prudent to mention this gotcha.

[0] https://github.com/facebookincubator/create-react-app

[1] https://github.com/developit/preact-cli

[2] https://webpack.js.org

[3] http://cssnext.io

[4] https://github.com/imagemin/imagemin-cli

[+] deanCommie|8 years ago|reply
As someone who last web-dev'd in the day of ASP.NET MVC, GWT, jQuery, and backbone.js, this post reads like one of those modern JS development satires [0]

I know you meant well, and this is just the state of the world, but I can't help but feel like a dinosaur just because I spent the last 5 years focusing on server/cloud infrastructure.

Is there any hope for someone like me if I ever want to step back into it? I ask sincerely. It seems like every best-practice framework's compelling proposition these days is that it's "like XYZ, but fixes this obscure edge case", where XYZ is something that only came out 2 years ago, so I never used it, never mind understood properly.

[0] https://hackernoon.com/how-it-feels-to-learn-javascript-in-2...

[+] caludio|8 years ago|reply
I agree that this heavily opinionated "starter kit" might be not what you want to give to a beginner (also it feels quite obsolete nowadays), but I quite disagree that create-react-app is a better choice.

I think that CRA is either useless as it is too simple and confusing (in its first run, before you "eject"... what are those react scripts, for example?) or too far away down the road of "choose what technique is best for your project" once you "eject".

I rather consider using a "true" starter kit, with no helpers and not many applied opinions to it (like, no redux for example and/or no decision on how to handle CSS). With this principle in mind, I wrote my starter kit https://github.com/claudioc/react-with-typescript-starterkit (yes, there are many of them already, but I try for it to be a middle ground between something that you want to use to bootstrap an real new app and something you study to learn the _what_ you need to start and begin by yourself).

[+] tootie|8 years ago|reply
Isn't create-react-app something of a dead end? It's designed to not be modified. It also doesn't support SSR. I'd lean towards starting with Electrode.
[+] tauntz|8 years ago|reply
> Powered by Material Design Lite

That's a curious choice. MDL isn't being developed further and is being replaced by "Material Components for the web" https://github.com/material-components/material-components-w...

From https://github.com/google/material-design-lite:

  Limited support
  Material Design Lite is now in limited support, with development having moved to the Material Components for the web repository.
  No further development is taking place in MDL by the core team, but we are happy to review PRs, fix critical bugs and push out new releases. No breaking changes will be accepted.
[+] philtar|8 years ago|reply
Looking at this page, and reading the comments here on HN, I'm glad I'm not a web developer. What a mess.
[+] degenerate|8 years ago|reply
The 'mess' is like trying to buy a car. Once you get through all the annoying sales pitches, conflicting opinions, dealer gotchas, options, and mental monthly payments... you're finally in your new car and happily rolling along, learning how it works and making it fit with your life. Then as time passes you see all your friends and strangers driving X, you hear about Y, and you really wish you could get your hands on Z, and all of a sudden your car feels inadequate so you hate it and complain about it until you can get your new car... or maybe you'll build your own car... hmm.

The mess of Web development is choosing what to use. It's pretty fun once you get behind the wheel.

[+] pier25|8 years ago|reply
Nothing stops you from sticking with PHP and jQuery if you think that's better.
[+] FabianBeiner|8 years ago|reply
Am I missing something? This thing came out like three years ago. If this is news: EVERYONE, CHECK OUT THIS AMAZING THING CALLED BOOTSTRAP!!1!

scnr

[+] mrisoli|8 years ago|reply
I had the same question, repo has no commits since April 4 and only one release dating back to December last year, and, as another comment pointed out, it uses MDL which has been discontinued in favor of Material Components.
[+] davedx|8 years ago|reply
An opinionated Web Starter Kit with no libraries or frameworks included? What is Google's opinion on which way to build a web application, roll your own?
[+] sotojuan|8 years ago|reply
> What is Google's opinion on which way to build a web application

Angular! Wait, Angular 2. No wait, Polymer. Sorry, how could I be so rude - Progressive Web App with no framework.

[+] SquareWheel|8 years ago|reply
I'd say that's pretty situational, depending on the type of site you want to build. Including tools like SASS, gulp, etc should be applicable to most sites, though.
[+] mattacular|8 years ago|reply
Nobody new to web is going to understand this stuff and people who would really understand this advice could already give it themselves. Not sure who the target audience for this is supposed to be but why do we need yet-another-web-boilerplate
[+] andrewstuart|8 years ago|reply
The right amount of configuration is zero.

create-react-app gets it.

This does not.

[+] js4all|8 years ago|reply
Hmm, interestingly I got the foobar challenge when I visited the site.
[+] ableton|8 years ago|reply
I'm glad to see they are using gulp. I know webpack is the hot new technology, but in my limited experience with webpack, gulp is easier to use and is more intuitive. Webpack has a lot of loaders, but I feel like gulp gives more flexibility out of the box. When I want to do something with gulp that I don't know how to do, I feel like it is easier to implement with gulp, because gulp seems to be a bit lower level. I noticed that they updated the docs for webpack since I last visited, so maybe I will try again.
[+] xg15|8 years ago|reply
> .gitignore: node_modules

Wait, did I miss something? Wasn't it google who started the "vendor everything" philosophy in the first place?

[+] scrollaway|8 years ago|reply
Vendoring packages doesn't mean vendoring in git. Vendoring in git is a terrible idea (which for some absurd reason the golang community has decided isn't...). It pollutes your tree, your history, your blames, your searches, makes your git repository massive, etc etc.

Node would be even worse.

[+] milankragujevic|8 years ago|reply
Aren't people supposed to just require the dependencies in package.json and not distribute the large blob of code? And you run "npm install"? Isn't that the current web dev "way" of life...?
[+] sidmkp96|8 years ago|reply
So? What's wrong with this? Why would someone check-in all the 3rd party code, when same can be described in package.json & downloaded again.