Comments (5)
This is a pretty good read on arrow functions and I can get behind the How Much Use Is There for Arrow Functions? section (it also happens to match with how we've used them so far).
https://www.sitepoint.com/es6-arrow-functions-new-fat-concise-syntax-javascript/
from development.
Arrow Functions
It'd be cool if we could use them everywhere they outline in @jimmynotjim 's link above, but I think it makes sense that we consider this a transition period, since we're still writing ES5 in most places (right?), which means "I think we can encourage it without making it a must-do for now."
I'm more interested in pushing for us to use class
for functions which are class objects, which I think actually makes code clearer. I'm torn on whether =>
makes code clearer or not (when applied in the "use it everywhere else" way described in the article). I do think they make code cleaner when used in callbacks of other functions, however.
But...
As mentioned in the original post, I'm not sure where and when we're using ES6.
from development.
We chatted about constants in mattermost 11/8 and I added:
I would generally view the ALL_CAPS as being for simple concrete values that get passed around in a program and wouldn't make sense to replace with var, like const NUM_OF_PLANETS = 8.
I would avoid caps for complex objects or at least consider that carefully, since those can be changed. So for imported modules I would const gulp = require( 'gulp' ); or creating instances, const notification = new Notification(). Also, a local variable within a method, where it would work fine as a var too, I would probably leave it without caps:function thisDoesGreatStuff() { const msg = 'it worked'; return msg; }
In the above msg could easily be marked as var, it's just an efficiency thing (I presume) internally that it's const, but it's not a concrete value that's passed around, it's just used in that single method.
Anyway, that's loosy goosy guidance not really backed up but much more than my coding preferences.I realize I'm violating that in const COMMON_UGLIFY_CONFIG = new UglifyWebpackPlugin(…) too
But the intention there is the UglifyWebpackPlugin instance is not to be modified or have its methods accessed after it is created
from development.
what @mistergone said
As mentioned in the original post, I'm not sure where and when we're using ES6.
would be cool if folks who've written es6 can post links to the code here so we can see what we're working with. for example i know cfgov-refresh uses es6 in gulp tasks:
https://github.com/cfpb/cfgov-refresh/tree/master/gulp/tasks
from development.
Completed in #177
from development.
Related Issues (20)
- Knowledge sharing for writing browser tests - with Protractor, to run in Sauce Labs, good docs and examples, etc HOT 1
- Automate every test which is possible to automate HOT 2
- Define what features and accessibility requirements to test. Automate them. HOT 1
- Make it easy to test quickly in browsers we say we support, so that we test all the browsers we claim to support! HOT 3
- When should we minify front-end assets? HOT 4
- Polyfill approach HOT 1
- Standardize our supported browser list config format HOT 1
- Document browser usage from Google Analytics of key sites/apps HOT 7
- Audit and optimize gulp scripts and styles tasks in cfgov-refresh related to browser bundles HOT 1
- Create policy for exceptions to our browser support standards HOT 4
- Auto format CSS and JS syntax HOT 2
- Manual testing with Sauce Labs pairing sessions + getting started docs HOT 1
- Add link to browser testing checklist to Browser support guide
- Best practices for package-lock.json files on Travis HOT 5
- bring back gulp watch to cfgov-refresh HOT 1
- Spacing and issues with credit card regulation expression in git-secrets patterns
- Supported versions of Python and other dependencies in applications and libraries HOT 8
- Update from Capital Framework to Design System
- Work out use of underscore in JS in this repo and document in front-end standards
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from development.