๋ง์คํฐ ๋ธ๋์น๋ฅผ ๊ตฌ์ถํ๋ ๊ฒ์ ๋ถ๊ฐ๋ฅํด ๋ณด์ ๋๋ค.
git clone https://github.com/Polymer/polymer.git
cd polymer
npm install
bower install
npm run build
์ค๋ฅ ์์
> @polymer/[email protected] build /media/Data/polymer
> gulp
[13:58:14] Using gulpfile /media/Data/polymer/gulpfile.js
[13:58:14] Starting 'build-bundled'...
[13:58:14] Starting 'build-steps'...
[13:58:14] 'build-steps' errored after 129 ฮผs
[13:58:14] Error: Task print-size is not configured as a task on gulp. If this is a submodule, you may need to use require('run-sequence').use(gulp).
at /media/Data/polymer/node_modules/run-sequence/index.js:20:10
at Array.forEach (native)
at verifyTaskSets (/media/Data/polymer/node_modules/run-sequence/index.js:13:11)
at runSequence (/media/Data/polymer/node_modules/run-sequence/index.js:92:2)
at Gulp.<anonymous> (/media/Data/polymer/gulpfile.js:262:3)
at module.exports (/media/Data/polymer/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/media/Data/polymer/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/media/Data/polymer/node_modules/orchestrator/index.js:214:10)
at Gulp.Orchestrator.start (/media/Data/polymer/node_modules/orchestrator/index.js:134:8)
at runNextSet (/media/Data/polymer/node_modules/run-sequence/index.js:86:16)
[13:58:14] 'build-bundled' errored after 2.13 ms
[13:58:14] Error in plugin 'run-sequence(build-steps)'
Message:
Task print-size is not configured as a task on gulp. If this is a submodule, you may need to use require('run-sequence').use(gulp).
Stack:
Error: Task print-size is not configured as a task on gulp. If this is a submodule, you may need to use require('run-sequence').use(gulp).
at /media/Data/polymer/node_modules/run-sequence/index.js:20:10
at Array.forEach (native)
at verifyTaskSets (/media/Data/polymer/node_modules/run-sequence/index.js:13:11)
at runSequence (/media/Data/polymer/node_modules/run-sequence/index.js:92:2)
at Gulp.<anonymous> (/media/Data/polymer/gulpfile.js:262:3)
at module.exports (/media/Data/polymer/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/media/Data/polymer/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/media/Data/polymer/node_modules/orchestrator/index.js:214:10)
at Gulp.Orchestrator.start (/media/Data/polymer/node_modules/orchestrator/index.js:134:8)
at runNextSet (/media/Data/polymer/node_modules/run-sequence/index.js:86:16)
npm ERR! Linux 4.10.0-20-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "build"
npm ERR! node v7.9.0
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @polymer/[email protected] build: `gulp`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @polymer/[email protected] build script 'gulp'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the @polymer/polymer package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! gulp
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs @polymer/polymer
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls @polymer/polymer
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/nazar-pc/.npm/_logs/2017-04-25T10_58_14_261Z-debug.log
nodejs --version
v7.9.0
npm --version
4.2.0
bower --version
1.8.0
gulp --version
[14:15:43] CLI version 3.9.1
[14:15:43] Local version 3.9.1
๋ฌธ์ ๋ฅผ ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค. gulpfile์ ์ ๋ฆฌํด์ผ ํ๋ค๋ ๋ฐ ๋์ํ์ต๋๋ค. gulp ์์ ์ ์ฃผ๋ก ์ถ์๋ ํด๋ฆฌ๋จธ์ ํฌ๊ธฐ๋ฅผ ํ์ธํ๊ณ ํด๋ก์ ์ปดํ์ผ๋ฌ ๋น๋/๋ฆฐํธ ํ ์คํธ๋ฅผ ์ํ ๊ฒ์ด์ง๋ง ์ค์ ๋ก ์ ๊ธฐ์ ์ผ๋ก ์ฌ์ฉํ์ง ์๊ธฐ ๋๋ฌธ์ ํ์ ์ํ์ ์ด๋ฅด๋ ์ต๋๋ค.
์๋ง๋ ๊ทํ๊ฐ ์์ฒญํ ๊ฒ๋ณด๋ค ๋ ๋ง์ ์ ์์ง๋ง ๋ค์์ ๋ฆด๋ฆฌ์ค/๋ฐฐํฌ ๊ณํ์ ๋ํ ๋ฐฐ๊ฒฝ์ ๋๋ค.
์ด๊ธฐ Polymer 2.0 ๋ฆด๋ฆฌ์ค์ ๋ํ ๊ณํ์ ์ค์ ๋ก ์ฝ์ด ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์์ ES6 ์์ค๋ก ๋ฐฐํฌํ๊ณ (unbundled/untranspiled/unminified, ๋ฐ๋ผ์ gulpfile์ ๋ฆด๋ฆฌ์ค ์ํฌํ๋ก์ ์ค์ ๋ก ํฌํจ๋์ง ์์) ์ฌ์ฉ์๊ฐ ๋ฐฐํฌ ๋จ๊ณ์์ ์ด๋ฌํ ์์ ์ ์ํํ ์ ์๋๋ก ํ๋ ๊ฒ์ ๋๋ค. ์กฐ๊ฑด์ ๋ฐ๋ผ ์๋ฅผ ๋ค์ด Polymer CLI๋ฅผ ์ฌ์ฉํฉ๋๋ค.
์ด ์ ๊ทผ ๋ฐฉ์์๋ ๋ช ๊ฐ์ง ๋ค๋ฅธ ์ด์ ๊ฐ ์์ต๋๋ค.
lib/mixins/property-accessors.html
๋๋ template-stamp.html
๋ง ์ฌ์ฉํ์ฌ) ๋ฒ๋ค ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ํ์ด๋ก๋ ๋น์ฉ ์์ด Polymer 2.0์ ๊ตฌ์ฑ ๋นํธ(๊ตฌ์ฑ ๊ฐ๋ฅํ ๋ฏน์ค์ธ์ผ๋ก ๊ตฌ์ถ๋จ)๊ฐ ์๋น ๊ฐ๋ฅํ ์๋ผ์นด๋ฅดํธ๊ฐ ๋๊ธฐ๋ฅผ ์ํฉ๋๋ค. ๋น์ ์ ๋จ์ง ๋ช kb์ ๋ํ ๋ง์ ํ)์ฐ๋ฆฌ๋ ๋ํ "๋ชจ๋ ์์ฝ์์คํ "์ ์ฐ๊ฒฐํ๋ ๋ฐ์๋ ๋งค์ฐ ๊ด์ฌ์ด ์์ต๋๋ค. ๋ฐ๋ผ์ Polymer๋ฅผ ๋ณด๋ค ์ ํต์ ์ธ ํ์์ผ๋ก ๋ฐฐ์กํ๊ฒ ๋ ์๋ ์์ง๋ง(๊ทธ๋ฆฌ๊ณ ๊ทธ์ ์ ํฉํ ๋น๋ ์ถ๋ ฅ์ ์ํด gulpfile์ ์ ์ฉํ ์๋ ์์ต๋๋ค), ์์ง ์์ ํ ์ฐฉ๋ฅํ์ง ์์์ต๋๋ค. ์์ง ๊ทธ ์ต์ข ํํ์. ๊ทธ ๋์์๋ ์ง์ ํ์ ๋๋ก gulpfile์ด ํญ๋ฐํ์ง ์๋๋ก ์์ ํด์ผ ํฉ๋๋ค.
๊ทธ ์ธ๋ถ ์ฌํญ์ ๋ํด ๋๋จํ ๊ฐ์ฌํฉ๋๋ค. ์๋ฏธ๊ฐ ์์ต๋๋ค!
์ฐธ๊ณ ๋ก Chromium, Firefox, Edge ๋ฐ Safari๋ ์ค๋ ํ์ฌ 2๊ฐ์ ์ต์ ๋ฆด๋ฆฌ์ค์์ Polymer์ ํ์ํ ๋ชจ๋ ES2015 ๊ธฐ๋ฅ์ ์ง์ํฉ๋๊น(ํธ๋์คํ์ผ ํ๋ก์ธ์ค๋ฅผ ์์ ํ ์ ๊ฑฐํ๊ณ ์ถ์ต๋๋ค)?
@nazar-pc ๋ง์ต๋๋ค. 4๊ฐ์ง ์ฃผ์ ๋ธ๋ผ์ฐ์ ๋ชจ๋์ ์ต์ ๋ฆด๋ฆฌ์ค์๋ ๋ณํ์ด ํ์ํ์ง ์์ต๋๋ค. CLI๋ฅผ ์ฌ์ฉํ๊ธฐ๋ก ์ ํํ ๊ฒฝ์ฐ polymer serve
UA๋ ๋ ์ฝ๊ฒ ํ๊ธฐ ์ํด IE(๋ฐ ๋ค๋ฅธ ๋ธ๋ผ์ฐ์ ์ ์ด์ ๋ฒ์ )์์ ํ
์คํธํ๊ธฐ ์ํด ์ฆ์์์ ์ค๋ํํ๊ณ ๋ณํํฉ๋๋ค.
polymer build
๋ ๋ฐฐํฌ๋ฅผ ์ํ ๋ณ๋์ ES5 ๋ฐ ES6 ๋น๋๋ฟ๋ง ์๋๋ผ ๋ฒ์ฉ ES5 ๋น๋๋ฅผ ์ง์ํฉ๋๋ค.
Edge 14์๋ ES6 impl์ ๋ช ๊ฐ์ง ๋ฒ๊ทธ๊ฐ ์์ผ๋ฏ๋ก(ES6 ํด๋์ค๋ฅผ ๋๋ฌด ์ฌ๋ฌ ๋ฒ ๊ตฌ์ฑํ๋ ๊ฒ์ด ํนํ ๋์ ๊ฒฝ์ฐ) CLI ๋๊ตฌ์์ Edge๋ฅผ ๋ณํํ๊ณ ๊ธฐ๋ณธ์ ์ผ๋ก ๊ทธ๋ ๊ฒ ํ๋ ๊ฒ์ด ์ข์ต๋๋ค(Edge 15๋ผ๊ณ ์๊ฐํ์ง๋ง ์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์ต๋๋ค).
gulpfile์ด https://github.com/Polymer/polymer/pull/4565 ์์ ์ ๋ฆฌ๋์์ผ๋ฏ๋ก ๋ซ์ต๋๋ค
๋ค์ ๊ฟ๊บฝ ๊ฟ๊บฝ ๋ง์๊ธฐ ์์
์ด ๊ตฌํ๋ฉ๋๋ค( default
์์
์ ๊ฑฐ๋จ).
clean
- dist dir ์ ๊ฑฐestimate-size
- ์ถ์๋ polymer.html
๋ฒ๋ค์ ํฌ๊ธฐ๋ฅผ ์ถ์ ํฉ๋๋ค.lint
- eslint ์คํlint-closure
- ํด๋ก์ ์ปดํ์ผ๋ฌ๋ฅผ ์คํํ๊ณ ํด๋ก์ ๊ฒฝ๊ณ ๊ฐ ์๋ ๋ก๊ทธ ํ์ผ์ ์ถ๋ ฅํฉ๋๋ค(์ ์ฒด ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ํด๋ก์ ์ ํ์ WIP์).closure
- ํด๋ก์ ์ปดํ์ผ๋ฌ "๊ณ ๊ธ ์ปดํ์ผ" ๋ชจ๋๋ฅผ ์คํํ๊ณ polymer.html
๋น๋๋ฅผ ์ถ๋ ฅํฉ๋๋ค(๋ฐ๋ ์ฝ๋ ์ ๊ฑฐ๋ก ์ธํด ์ต์ข
์ฌ์ฉ์์๊ฒ ํนํ ์ ์ฉํ์ง ์์ง๋ง ์ปดํ์ผ ๊ฐ๋ฅ์ฑ ํ
์คํธ์๋ ์ ์ฉ).
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
๋ฌธ์ ๋ฅผ ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค. gulpfile์ ์ ๋ฆฌํด์ผ ํ๋ค๋ ๋ฐ ๋์ํ์ต๋๋ค. gulp ์์ ์ ์ฃผ๋ก ์ถ์๋ ํด๋ฆฌ๋จธ์ ํฌ๊ธฐ๋ฅผ ํ์ธํ๊ณ ํด๋ก์ ์ปดํ์ผ๋ฌ ๋น๋/๋ฆฐํธ ํ ์คํธ๋ฅผ ์ํ ๊ฒ์ด์ง๋ง ์ค์ ๋ก ์ ๊ธฐ์ ์ผ๋ก ์ฌ์ฉํ์ง ์๊ธฐ ๋๋ฌธ์ ํ์ ์ํ์ ์ด๋ฅด๋ ์ต๋๋ค.
์๋ง๋ ๊ทํ๊ฐ ์์ฒญํ ๊ฒ๋ณด๋ค ๋ ๋ง์ ์ ์์ง๋ง ๋ค์์ ๋ฆด๋ฆฌ์ค/๋ฐฐํฌ ๊ณํ์ ๋ํ ๋ฐฐ๊ฒฝ์ ๋๋ค.
์ด๊ธฐ Polymer 2.0 ๋ฆด๋ฆฌ์ค์ ๋ํ ๊ณํ์ ์ค์ ๋ก ์ฝ์ด ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์์ ES6 ์์ค๋ก ๋ฐฐํฌํ๊ณ (unbundled/untranspiled/unminified, ๋ฐ๋ผ์ gulpfile์ ๋ฆด๋ฆฌ์ค ์ํฌํ๋ก์ ์ค์ ๋ก ํฌํจ๋์ง ์์) ์ฌ์ฉ์๊ฐ ๋ฐฐํฌ ๋จ๊ณ์์ ์ด๋ฌํ ์์ ์ ์ํํ ์ ์๋๋ก ํ๋ ๊ฒ์ ๋๋ค. ์กฐ๊ฑด์ ๋ฐ๋ผ ์๋ฅผ ๋ค์ด Polymer CLI๋ฅผ ์ฌ์ฉํฉ๋๋ค.
์ด ์ ๊ทผ ๋ฐฉ์์๋ ๋ช ๊ฐ์ง ๋ค๋ฅธ ์ด์ ๊ฐ ์์ต๋๋ค.
lib/mixins/property-accessors.html
๋๋template-stamp.html
๋ง ์ฌ์ฉํ์ฌ) ๋ฒ๋ค ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ํ์ด๋ก๋ ๋น์ฉ ์์ด Polymer 2.0์ ๊ตฌ์ฑ ๋นํธ(๊ตฌ์ฑ ๊ฐ๋ฅํ ๋ฏน์ค์ธ์ผ๋ก ๊ตฌ์ถ๋จ)๊ฐ ์๋น ๊ฐ๋ฅํ ์๋ผ์นด๋ฅดํธ๊ฐ ๋๊ธฐ๋ฅผ ์ํฉ๋๋ค. ๋น์ ์ ๋จ์ง ๋ช kb์ ๋ํ ๋ง์ ํ)์ฐ๋ฆฌ๋ ๋ํ "๋ชจ๋ ์์ฝ์์คํ "์ ์ฐ๊ฒฐํ๋ ๋ฐ์๋ ๋งค์ฐ ๊ด์ฌ์ด ์์ต๋๋ค. ๋ฐ๋ผ์ Polymer๋ฅผ ๋ณด๋ค ์ ํต์ ์ธ ํ์์ผ๋ก ๋ฐฐ์กํ๊ฒ ๋ ์๋ ์์ง๋ง(๊ทธ๋ฆฌ๊ณ ๊ทธ์ ์ ํฉํ ๋น๋ ์ถ๋ ฅ์ ์ํด gulpfile์ ์ ์ฉํ ์๋ ์์ต๋๋ค), ์์ง ์์ ํ ์ฐฉ๋ฅํ์ง ์์์ต๋๋ค. ์์ง ๊ทธ ์ต์ข ํํ์. ๊ทธ ๋์์๋ ์ง์ ํ์ ๋๋ก gulpfile์ด ํญ๋ฐํ์ง ์๋๋ก ์์ ํด์ผ ํฉ๋๋ค.