SlideShare a Scribd company logo
https://flic.kr/p/m9738v
Learn JS in Kanazawa
kakenai.js ver.1.0
https://flic.kr/p/npvsQJ
@pocotan001
Hayato Mizuno
"今" 使えるJavaScriptのトレンド
"今" 使えるJavaScriptのトレンド
https://frontendweekly.tokyo/
http://blocsapp.com/
http://electron.atom.io/
http://electron.atom.io/
https://flic.kr/p/9gpNkP
"今" 使えるJavaScriptのトレンド
"今" 使えるJavaScriptのトレンド
"今" 使えるJavaScriptのトレンド
https://flic.kr/p/dSuxV1
Choose JS Tools Today
EditorConfig
http://editorconfig.org/
root = true
!
[*]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
!
[*.md]
trim_trailing_whitespace = false
.editorconfig
"今" 使えるJavaScriptのトレンド
黒い画面
command -options arguments
sh
command -options arguments
!
coffee -wc a.coffee
sh
command -options arguments
!
coffee -wc a.coffee
# coffee -w -c a.coffee
# coffee --watch --compile a.coffee
sh
パッケージ
マネージャー
&
npm i -g xxx
# npm install —-global xxx
https://goo.gl/2Uq21X
その他
56%
grunt

4%
pm2

4%
gulp

7%
bower
11%
grunt-cli
18%
~/…lib # npm root -g
node_modules
coffee-script
npm i -g coffee-script
coffee …
sh
your-project
node_modules
coffee-script
npm i coffee-script
coffee …
# command not found: coffee
sh
your-project
node_modules
coffee-script
npm i -D coffee-script
sh
—save-dev
package.json
{
…
"dependencies": { … },
"devDependencies": {
"coffee-script": "^1.9.2"
}
}
package.json
your-project
node_modules
coffee-script
npm i -S jquery
sh
—save
package.json
jquery
{
…
"dependencies": {
"jquery": "^2.1.4"
},
"devDependencies": {
"coffee-script": "^1.9.2"
}
}
package.json
https://plugins.jquery.com/
https://plugins.jquery.com/
We recommend moving to npm,
using "jquery-plugin" as the
keyword in your package.json.
http://blog.npmjs.org/post/101775448305/npm-and-front-end-packaging
https://speakerdeck.com/watilde/npm-update-g-npm
モジュールローダー
http://browserify.org/
var $ = require('jquery');
!
console.log($.fn.jquery); // 2.1.4
a.js
npm i -g browserify
browserify a.js -o bundle.js
# your-project/bundle.js
sh
Browserify WebPack
https://gist.github.com/substack/68f8d502be42d5cd4942
タスクランナー
"今" 使えるJavaScriptのトレンド
npm i -g grunt-cli
npm i –D grunt grunt-contrib-coffee
grunt build
sh
npm i -g gulp
npm i –D gulp gulp-coffee
gulp build
module.exports = function(grunt) {
grunt.initConfig({
coffee: {
compile: {
files: {
'./a.js': './a.coffee'
}
}
}
});
!
grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.registerTask('build', ['coffee']);
};
Gruntfile.js
var gulp = require('gulp');
var coffee = require('gulp-coffee');
!
gulp.task('coffee', function() {
return gulp.src(['./a.coffee'])
.pipe(coffee())
.pipe(gulp.dest('./'));
});
!
gulp.task('build', ['coffee']);
Gulpfile.js
gulp.src(['./a.coffee'])
.pipe(coffee())
.pipe(uglify())
.pipe(rename('a.min.js'))
.pipe(gulp.dest('./'));
Gulpfile.js
https://github.com/greypants/gulp-starter
"今" 使えるJavaScriptのトレンド
{
…
"scripts": {
"build": "coffee -c a.coffee"
}
}
package.json
sh
npm i -D coffee-script
npm run build
http://blog.keithcirkel.co.uk/how-to-use-npm-as-a-build-tool/
altJS,
トランスパイラ
http://coffeescript.org/
greeting = -> "Hello"
alert greeting()
!
// var greeting;
//
// greeting = function() {
// return "Hello";
// };
//
// alert(greeting());
a.coffee
https://babeljs.io/
let greeting = () => 'Hello';
alert( greeting() );
!
// 'use strict';
//
// var greeting = function greeting() {
// return 'Hello';
// };
//
// alert(greeting());
a.js
http://browserify.org/
var $ = require('jquery');
!
console.log($.fn.jquery); // 2.1.4
a.js
import $ from 'jquery';
!
console.log($.fn.jquery); // 2.1.4
a.js
npm i browserify babelify
browserify a.js -t babelify -o bundle.js
sh
http://codemix.com/blog/why-babel-matters
http://havelog.ayumusato.com/develop/javascript/e665-ts_jsx_flux.html
Lint
http://eslint.org/
"今" 使えるJavaScriptのトレンド
.eslintrc
{
"parser": "babel-eslint",
"rules": {
"quotes": [1, "single"],
"no-var": 2,
...
},
"env": {
"browser": true,
...
}
}
https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb
https://github.com/feross/eslint-config-standard
npm -D eslint eslint-config-airbnb
sh
.eslintrc
{
"extends": "airbnb"
...
}
http://jscs.info/
https://github.com/jscs-dev/node-jscs/tree/master/presets
https://medium.com/dev-channel/auto-formatting-javascript-code-style-fe0f98a923b8
ユニットテスト
console.assert(1 + 1 == 2);
test.js
console.assert(
1 + 1 == 2,
'1 + 1 は 2 であること'
);
test.js
console.assert(
1 + 1 == 3,
'1 + 1 は 2 であること'
);
!
Assertion failed: 1 + 1 は 2 であること
test.js
http://mochajs.org/
describe('足し算のテスト', function() {
!
it('1 + 1 は 2 であること', function() {
console.assert(1 + 1 == 2);
})
!
});
test.js
mocha test.js
sh
足し算のテスト
✓ 1 + 1 は 2 であること
!
1 passing
mocha test.js
sh
足し算のテスト
1) 1 + 1 は 2 であること
!
0 passing
1 failing
https://nodejs.org/api/assert.html
var assert = require('assert');
!
describe('足し算のテスト', function() {
!
it('1 + 1 は 2 であること', function() {
assert.equal(1 + 1, 2);
})
!
});
test.js
assert.equal();
assert.notEqual();
!
assert.deepEqual();
assert.notDeepEqual();
!
assert.throws();
…
mocha test.js // console.assert
sh
…
AssertionError: false == true
+ expected - actual
!
-false
+true
mocha test.js // node.js assert
sh
…
AssertionError: 2 == 3
+ expected - actual
!
-2
+3
mocha test.js // power-assert
sh
…
# test.js:6
!
assert(1 + 1 === 3)
| |
2 false
!
[number] 3
=> 3
[number] 1 + 1
=> 2
https://github.com/power-assert-js
http://dev.classmethod.jp/testing/10_errors_about_unit_testing/
MVなんたら
http://www.slideshare.net/ginpei_jp/js-modelview
https://goo.gl/2J3ZCr
https://facebook.github.io/flux/docs/overview.html
Flux?
https://medium.com/@milankinen/good-bye-flux-welcome-bacon-rx-23c71abfb1a7
コンポーネント
- Custom Elements

- HTML Imports

- Template

- Shadow DOM
http://webcomponents.org/
http://webcomponents.org/articles/interview-with-joshua-peek/
https://customelements.io/
https://www.polymer-project.org/1.0/
https://facebook.github.io/react/
- Just the UI

- Virtual DOM

- Data Flow
https://facebook.github.io/react/
var Button = React.createClass({
render: function() {
return (
<button type={this.props.type}>
{this.props.children}
</button>
);
}
});
!
React.render(
<Button type="submit">Hello</Button>,
document.getElementById('example')
);
a.jsx
"今" 使えるJavaScriptのトレンド
setState()
setState()
再描画
再描画
http://blog.500tech.com/is-reactjs-fast/
…
The most dangerous thought you can have as a creative person is to
think you know what you re doing. Learn tools, and use tools, but
don t accept tools. Always distrust them; always be alert for
alternative ways of thinking.
“想像的であり続けるために避けなければならないことは、
自分がやっていることを知っていると思い込むことです。
ツールを学び、ツールを使いこなす。しかし、ツールの全
てを受け入れてはなりません。
どんな時でも別の視点で考えるようにするべきです。
- Victor, Bret. “The Future of Programming.”
http://quote.enja.io/post/the-most-dangerous-thought-you-can-have.../
https://flic.kr/p/m9738v
QUESTION?

More Related Content

PDF
"Augmented reality in your browser", Alina Karpelceva
PPTX
"Your script just killed my site" by Steve Souders
KEY
Requirejs
PDF
Efficient JavaScript Development
PDF
Web-Performance
PDF
하루프레스
PDF
6주 javaScript 시작하며
PDF
"Augmented reality in your browser", Alina Karpelceva
"Your script just killed my site" by Steve Souders
Requirejs
Efficient JavaScript Development
Web-Performance
하루프레스
6주 javaScript 시작하며

What's hot (20)

PPT
PDF
Node.js 기반 정적 페이지 블로그 엔진, 하루프레스
PDF
우리가 모르는 노드로 할 수 있는 몇가지
PDF
Browserify
KEY
Fake it 'til you make it
PDF
Profiling PHP with Xdebug / Webgrind
PDF
The Dojo Build System
PDF
Node.js & Twitter Bootstrap Crash Course
PPT
Sxsw 20090314
PPT
Google在Web前端方面的经验
PDF
Performance monitoring measurement angualrjs single page apps with phantomas
PPTX
Transients are good for you - WordCamp London 2016
PDF
Mojolicious, real-time web framework
PDF
Nette &lt;3 Webpack
PDF
Detecting headless browsers
PDF
javascript for backend developers
PPT
AngularJS for Legacy Apps
PDF
Requirejs
PDF
Sinatra
PDF
Webpack packing it all
Node.js 기반 정적 페이지 블로그 엔진, 하루프레스
우리가 모르는 노드로 할 수 있는 몇가지
Browserify
Fake it 'til you make it
Profiling PHP with Xdebug / Webgrind
The Dojo Build System
Node.js & Twitter Bootstrap Crash Course
Sxsw 20090314
Google在Web前端方面的经验
Performance monitoring measurement angualrjs single page apps with phantomas
Transients are good for you - WordCamp London 2016
Mojolicious, real-time web framework
Nette &lt;3 Webpack
Detecting headless browsers
javascript for backend developers
AngularJS for Legacy Apps
Requirejs
Sinatra
Webpack packing it all
Ad

More from Hayato Mizuno (10)

PDF
レスポンシブWebデザインでうまくやるための考え方
PDF
メンテナブルPSD
PDF
赤い秘密
PDF
なんでCSSすぐ死んでしまうん
PDF
フロントエンドの求めるデザイン
PDF
Hello jQuery - 速習jQuery +綺麗なコードを書くためのヒント -
PDF
レンダリングを意識したパフォーマンスチューニング
PDF
jQuery Performance Tips – jQueryにおける高速化 -
PDF
CoffeeScriptってなんぞ?
PDF
ノンプログラマーのためのjQuery入門
レスポンシブWebデザインでうまくやるための考え方
メンテナブルPSD
赤い秘密
なんでCSSすぐ死んでしまうん
フロントエンドの求めるデザイン
Hello jQuery - 速習jQuery +綺麗なコードを書くためのヒント -
レンダリングを意識したパフォーマンスチューニング
jQuery Performance Tips – jQueryにおける高速化 -
CoffeeScriptってなんぞ?
ノンプログラマーのためのjQuery入門
Ad

Recently uploaded (20)

PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
cuic standard and advanced reporting.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Empathic Computing: Creating Shared Understanding
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Encapsulation theory and applications.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Approach and Philosophy of On baking technology
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
cuic standard and advanced reporting.pdf
Network Security Unit 5.pdf for BCA BBA.
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Chapter 3 Spatial Domain Image Processing.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Empathic Computing: Creating Shared Understanding
Building Integrated photovoltaic BIPV_UPV.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Advanced methodologies resolving dimensionality complications for autism neur...
Encapsulation theory and applications.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Approach and Philosophy of On baking technology
Programs and apps: productivity, graphics, security and other tools
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...

"今" 使えるJavaScriptのトレンド