: recycle : : recycle : : recycle : ์ด Github ๋ฌธ์ ๋ฅผ ์ธ์ํ๊ธฐ ์ ์ ํ๊ฒฝ์ ๊ณ ๋ คํ์ญ์์ค. : recycle : : recycle : : recycle :
@wycats ์ I (๊ทธ๋ฆฌ๊ณ ๊ทธ ๊ณผ์ ์์ ๋์์ ์ค ๋ง์ ์ฌ๋๋ค)์ ์ง๋ 6 ๊ฐ์ ๋์ ์ฝ๋ ๋ช "Glimmer 2"๋ผ๋ ๋ ๋๋ง ์์ง์ ์ฌ ๊ตฌ์ถ ์์ ์ ํด์์ต๋๋ค.
๊ทธ๊ฒ์ htmlbar ์ ํฌํฌ๋ก ์์๋์์ง๋ง ๊ฑฐ์ ๋ชจ๋ ์ฝ๋ ์ค์ด ์ง๊ธ๊น์ง (๋๋ก๋ ์ฌ๋ฌ ๋ฒ) ๋ค์ ์์ฑ๋์์ต๋๋ค. ์ฐ๋ฆฌ๋ ์ด์ ์ธ๋์ ๋ ๋๋ง ํ์ดํ ๋ผ์ธ (ํธ๋ค ๋ฐ, htmlbars, ์๋์ glimmer
https://github.com/tildeio/glimmer์์ codez๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค. TypeScript๋ก (์ฌ) ์์ฑ๋์์ผ๋ฉฐ ๊ฝค ๋ฉ์ง๋ค๊ณ ์๊ฐํฉ๋๋ค. ์ด์จ๋ EmberConf ์์ ๋ ์์ธํ
์์ง์์ํ๊ณ ์ถ์ ๋ง์ ์์ (๋๋ถ๋ถ ์ต์ ํ)์ด ์์ง ๋ง์ด ๋จ์ ์์ง๋ง ๋ชจ๋ ๊ธฐ๋ณธ Ember ์ฌ์ฉ ์ฌ๋ก๋ฅผ ํฌํจ ํ ์์์๋งํผ ์ถฉ๋ถํ ๊ตฌํํ๋ค๊ณ ์๊ฐํฉ๋๋ค. ๊ทธ๋์ ์ฝ ๋ ๋ฌ ์ ์ ์ฐ๋ฆฌ๋ ์๋ก์ด ์์ง์ Ember๋ก ํตํฉํ๊ธฐ ์์ํ์ต๋๋ค. ์ง๊ธ๊น์ง์ ์งํ ์ํฉ์ ์ํด์ด ๋ฉํ ๋ฌธ์ ๋ฅผ ๋ฐ๋ฅผ ์ ์์ต๋๋ค.
์์ง ์ค์ ์ฑ์์ ์ ์์ง์ ์ฌ์ฉํ ์๋ ์์ง๋ง ์์ ์ด ๋น๊ต์ ๋นจ๋ฆฌ ์๋ฃ ๋ ๊ฒ์ผ๋ก ์์๋ฉ๋๋ค. ๊ตฌํ์ด ์๋ฃ๋๋ฉด ์๋ Handlebars์์ HTMLBars๋ก ๋ง์ด๊ทธ๋ ์ด์ ํ๋ ๊ฒ์ฒ๋ผ ์๋์ ์ผ๋ก ์ฝ๊ฒ ์ฑ์์ํ ๋๋กญ ์ธ ์ ๊ทธ๋ ์ด๋๊ฐ ๋ ๊ฒ์ ๋๋ค.
(๊ธฐ๋ฅ ํ๋๊ทธ๋ฅผ ์ ํํ๋ ๊ธฐ๋ฅ์ ๊ธฐ์กด ๊ธฐ๋ฅ์ด ๋ชจ๋ ๊ตฌํ๋๊ธฐ _ ์ ์ _ ์์๋ ๊ฒ์ด๋ฏ๋ก, ์ฒ์๋ถํฐ ์ฑ์์ ์ํํ๊ฒ ์๋ํ์ง _ ์์ _ ๊ฒ์ ๋๋ค.)
๋ฐ๋ผ์ "์ด๋ป๊ฒ ๋์ ๋๋ฆด๊น์?"๋ผ๊ณ ๊ถ๊ธํดํ์ค ์ ์์ต๋๋ค.
๋ฌผ์ด๋ด์ ๊ธฐ๋ป์! : ๋ถ : : ์คํํด ์ค : : ๋ถ๊ฝ ๋์ด : : ํ๋ค :
์ด ์์ ์์ ๋์์ด ๋ ์์๋ ๊ฐ์ฅ ํฐ ๊ฐ์น๋ ๊ธฐ์กด ํ
์คํธ๋ฅผ ์ด์ํ๊ณ ์ด๋ฌํ PR์ ๊ฒํ ํ๋ ๋ฐ ๋์์ด๋๋ ๊ฒ์
๋๋ค. Ember์๋ "๋ทฐ ๋ ์ด์ด"๋์์ ํ
์คํธํ๋ ๋งค์ฐ ๊ด๋ฒ์ํ ํ
์คํธ ์ค์ํธ๊ฐ ์์ต๋๋ค. ๋ฌธ์ ๋ ์ด๋ฌํ ํ
์คํธ์ ๋๋ถ๋ถ์ด ๊ธฐ์กด ๊ตฌํ๊ณผ ์๋นํ ๊ฒฐํฉ ๋ ๋ฐฉ์์ผ๋ก ์์ฑ๋๊ฑฐ๋ ๋ ์ด์ ์ง์๋์ง ์๋ ๋ ๊ฑฐ์ ์๋ฏธ ์ฒด๊ณ (์ : {{view.foo}}
)๋ฅผ ์ฌ์ฉํ๋ค๋ ๊ฒ์
๋๋ค.
ํ๊ท๊ฐ ๋ฐ์ํ์ง ์์๋์ง ํ์ธํ๊ธฐ ์ํด ํ์ฌ ๋ ๋๋ง ์์ง ( "htmlbars")๊ณผ Glimmer 2 ๋ชจ๋์ ๋ํด ์ ์ฒด ํ ์คํธ ์ค์ํธ๋ฅผ ์คํํ ์ ์๊ธฐ๋ฅผ ์ํฉ๋๋ค.
์ฐ๋ฆฌ๋ ๊ทธ๋ ๊ฒ ํ ์์๋ ์๋ก์ด ํ ์คํธ ๋๊ตฌ๋ฅผ ์์ฑํ์ต๋๋ค. ์๋์์ ๊ธฐ์ ์ ์ธ ์ธ๋ถ ์ฌํญ์ ์ดํด ๋ณด ๊ฒ ์ง๋ง ๊ธฐ๋ณธ ์์ด๋์ด๋ ๋ ์์ง ๊ฐ์ ์ฐจ์ด์ ์ ์บก์ํํ๋ ์ถ์ํ ๊ณ์ธต์ ๋ํด ํ ์คํธ ์ผ์ด์ค๋ฅผ ์์ฑํ์ฌ ํ ์คํธ ์ผ์ด์ค์ ๋์ผํ ์ฝ๋๊ฐ ๋ ๊ตฌํ ๋ชจ๋์ ๋ํด ์คํ๋ ์ ์๋๋กํ๋ค๋ ๊ฒ์ ๋๋ค.
๊ทธ ๊ณผ์ ์์ ๋ ๊ฑฐ์ ์๋งจํฑ์ ์์กดํ์ง ์๋๋ก ํ๋ก์ธ์ค์ ๊ธฐ์กด ํ ์คํธ๋ฅผ "ํ๋ํ"ํ๊ณ ์์ต๋๋ค (์ด ์๋งจํฑ์ ๋ช ์ ์ ์ผ๋ก ํ ์คํธํ๋ ๊ฒ์ฒ๋ผ ๋ณด์ด์ง ์๋ ํ,์ด ๊ฒฝ์ฐ์๋ ๊ทธ๋๋ก ๋ก๋๋ค). ์ฐ๋ฆฌ์ ์๋ก์ด ํ ์คํธ ์ฅ์น๋ ๋ํ "๋งคํธ๋ฆญ์ค ์คํ์ผ"ํ ์คํธ๋ฅผ ํจ์ฌ ๋ ์ฝ๊ณ ์ฆ๊ฒ๊ฒ ๋ง๋ค์ด์ค๋๋ค. ์๋์์ ๋ ์์ธํ ์ค๋ช ํ์ง๋ง ์ฌ๊ธฐ์ ์์ ์์ค ์ํคํ ์ฒ ๋ค์ด์ด๊ทธ๋จ์ด ์์ต๋๋ค.
๊ฒฐ๊ณผ์ ์ผ๋ก ํ ์คํธ๋ฅผ ํจ์ฌ ์ฝ๊ฒ ์ฝ๊ณ ์ถ๋ก ํ ์ ์์ผ๋ฉฐ ์ ์ฉ ๋ฒ์๋ ํฌ๊ฒ ์ฆ๊ฐํ์ต๋๋ค. ์ด๊ฒ์ ๋ชจ๋์๊ฒ ํ๋ฅญํ ๊ฒฐ๊ณผ์ด์ง๋ง ์์ง ๋ ๋ง์ ํ ์คํธ๊ฐ ๋จ์ ์์ผ๋ฉฐ ๋ชจ๋ ํ ์คํธ๊ฐ ํฌํ ๋์ง ์์ ์ํ์์ ์์ง ์ถํ์ ๋ํ ํ์ ์ ๊ฐ์ง ์ ์์ต๋๋ค. ๊ทธ๋ฌ๋ ์ฌ๋ฌ๋ถ ์ค ๋ช ๋ถ์ด ๊ฐ๊ฐ ํ ์คํธ ํ์ผ์ ์ด์ํ๋ ๋ฐ ๋์์ ์ฃผ์๋ฉด ๋ค์ ์ฃผ ์ด๋ง๋๊น์ง ์ข์ ์ํ๊ฐ ๋ ๊ฒ์ ๋๋ค!
์ฐ๋ฆฌ๊ฐ ์ฌ์ฉํ ์ค์ ๋ฉ์ปค๋์ฆ์ ๋งค์ฐ ๋ฎ์ ๊ธฐ์ ์ ๋๋ค. ๋ค์ด ๋ณด์ จ์ ๊ฒ์ ๋๋ค.์ด๋ฅผ ์ฌ๋ณผ๋ฆญ ๋งํฌ ๋ผ๊ณ
ember-glimmer
ํจํค์ง์ ํ
์คํธ ํด๋ ์์ abstract-test-case.js
๋ผ๋ ํ์ผ์ด ์์ต๋๋ค.์ด ํ์ผ์ ember-htmlbars
ํจํค์ง ๋ด์ ๋์ผํ ์์น์ ์ฌ๋ณผ๋ฆญ ๋งํฌ๋์ด ์์ต๋๋ค. ์ด ํ์ผ์ ํ
์คํธ ์ผ์ด์ค ์์ฑ์ ์ฌ์ฉ๋๋ API๋ฅผ ์ ์ํฉ๋๋ค. ์ด ํ์ผ์ ๋ ํจํค์ง๊ฐ์ ๊ณต์ (symlinked)๋๊ธฐ ๋๋ฌธ์ ๋ ๊ตฌํ์ ๋ํ ๊ตฌ์ฒด์ ์ธ ๋ด์ฉ์ ํฌํจํ์ง ์์ต๋๋ค.
๋์ ๊ฐ ํจํค์ง์์ ์ ๊ณตํ๋ ํ์ผ (์ : import ... from './helpers'
)์ ๊ฐ์ ธ ์์ ๋ชจ๋ ์ฐจ์ด์ ์ ์ถ์ํํฉ๋๋ค. ๋๋ ๊ฐ ํจํค์ง๋ test-case.js
์ "์ถ์"ํด๋์ค์์ ํน์ ๋ฉ์๋๋ฅผ ์ฌ์ ์ ํ ์๋ ์์ต๋๋ค ( ember-glimmer
๋ ember-htmlbars
๋ฒ์ ์ฐธ์กฐ).
(๋๋ถ๋ถ์ ๊ฒฝ์ฐ ์ด๋ฌํ ํ์ผ์ ์ ํ ์์ ํ ํ์๊ฐ ์์ ์๋ ์์ง๋ง ์ด๊ฒ์ด ์๋ ๋ฐฉ์ / ์์ ์ด ๋ด๋ถ์์ ๋ฐ์ํ๋ ์์น๋ฅผ ์๋ ๊ฒ์ด ๋ฌธ์ ๊ฐ ๋ฐ์ํ๋ ๊ฒฝ์ฐ ์ฌ์ ํ ๋์์ด ๋ ์ ์์ต๋๋ค.)
์์ง์ ์ค์ ์ฑ์ ๋ํ ๋๋กญ ์ธ ์ ๊ทธ๋ ์ด๋๋ฅผ์ํ ๊ฒ์ด๊ธฐ ๋๋ฌธ์ ํ ์คํธ๊ฐ ์ค์ ๋ก ์ด๋ฌํ ๊ธฐ๋ฅ์ด ์ค์ ์ธ๊ณ์์ ์ฌ์ฉ๋๋ ๋ฐฉ์์ ํ ์คํธํ๋ ํ ํ ์คํธ๊ฐ ์คํ๋์ง ์์ ์ด์ ๊ฐ ์์ต๋๋ค. ๋ ์์ง.
๊ทธ๊ฒ์ด ์ง๊ธ๊น์ง ์ฐ๋ฆฌ์ ์ด์ ์ด์์ต๋๋ค. ์ฌ๊ธฐ์์ ์ ๋ฅผ ๋ณผ ์ ์์ต๋๋ค.
์ด ํ
์คํธ๋ ๋ฌผ๋ฆฌ์ ์ผ๋ก ember-glimmer
๋๋ ํฐ๋ฆฌ์ ์์ง๋ง ember-htmlbars
๋๋ ํฐ๋ฆฌ ์ ๋์ผํ ์์น ์
๋ณด์๋ค์ํผ ํ
์คํธ๋์ด ํจํค์ง ๋ณ test-case.js
๋ฅผ ๊ฐ์ ธ ์ค์ง๋ง, ๊ทธ๋ ์ง ์์ผ๋ฉด ๋ ๋๋ง ์์ง ๊ตฌํ์ ๋ํด ๋ถ๊ฐ์ง๋ก ์ ์
๋๋ค.
์ผ๋ฐ์ ์ผ๋ก ์์ ์์ค์์ ํ๋ก์ธ์ค๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
ember-htmlbars
์ด๋๊ฐ์์๋ ๊ธฐ์กด ํ
์คํธ ํ์ผ).ember-glimmer/tests/integration/...
์ด๋๊ฐ์ ์ ํ์ผ์ ๋ง๋ญ๋๋ค.moduleFor
๋ฐ ES6 ํด๋์ค ํ์ ์ฌ์ฉember-htmlbars
์ ์ฌ๋ณผ๋ฆญ ๋งํฌ ์ธ ๊ฒฝ์ฐ๊ฐ ์๋๋ฉด ํ
์คํธ๋ฅผ ember-htmlbars
ํจํค์ง๋ก ๋ค์ ์ฌ๋ณผ๋ฆญํฉ๋๋ค (์์์ ๋ณด์ฌ์ค concat ํ
์คํธ์ ์ ์ฌ ํจ).๋ค์์ ํ ์คํธ ์ฌ๋ก๋ฅผ ๊ฐ์ ํ๊ธฐ ์ํด ๋ฐ๋ฅผ ์์๋ ๋ช ๊ฐ์ง ์ผ๋ฐ์ ์ธ ํ / ๊ท์น์ ๋๋ค.
๊ฐ ํ ์คํธ๊ฐ "INUR"์ฃผ๊ธฐ๋ฅผ ๊ฑฐ์น๊ธฐ๋ฅผ ๋ฐ๋๋๋ค.
์ ํํ ์ด๊ธฐ ๊ฐ ( this.render(..., { ... })
)์ผ๋ก ํ
์คํธ ํ ํ
ํ๋ฆฟ์ ๋ ๋๋งํ๊ณ ๊ฒฐ๊ณผ๊ฐ ์์ ํ๋๋ก์์ ์ฃผ์ฅํฉ๋๋ค. ( ์ )
๊ฐ์ ๋ณ๊ฒฝํ์ง ์๊ณ this.runTask(() => this.rerender());
๋ฅผ ํธ์ถ ํ ๋ค์ ๊ฒฐ๊ณผ๊ฐ ๋์ผํ๋ค๊ณ ์ฃผ์ฅํฉ๋๋ค. ( ์ )
ํ ํ๋ฆฟ์์ ์ฌ์ฉํ๋ ๊ฐ์ ์ ๋ฐ์ดํธํฉ๋๋ค. ( ์ )
๋ค์์ ์๋ํด์ผํฉ๋๋ค.
this.runTask
+ ์ด์ค ์
). ์ด๋ ๊ฒํ๋ฉด _some_ ๊ฐ์ ์
๋ฐ์ดํธํ๋ฉด ํ
ํ๋ฆฟ์ ๋ค๋ฅธ ๊ด๋ จ๋์ง ์์ ๋ถ๋ถ์ด "๋ ์๊ฐ๊ฑฐ๋"๋ค๋ฅธ ๋ฐ๋์งํ์ง ์์ ํจ๊ณผ๊ฐ ๋ฐ์ํ๋ "ํด๋ก๋ฒ ๋ง"๋ฒ๊ทธ๋ฅผ ์ก์ ๊ฐ๋ฅ์ฑ์ด ๋์์ง๋๋ค.pushObject
vs ํญ๋ชฉ ์ ๊ฑฐ ๋ฑ)๊ฐ์๋ ๊ฒฝ์ฐ ์ผ๋ฐ์ ์ผ๋ก ๋ ์ด์์ ๋ฐฉ๋ฒ์ ์๋ํ๋ ๊ฒ์ด ์ข์ต๋๋ค. ( ์ )๋ชจ๋ ๋ณ์๋ฅผ ๊ต์ฒดํ์ฌ ์๋ ์์ ์กฐ๊ฑด์ผ๋ก ์ฌ์ค์ ํ์ญ์์ค.
๋์ผํ ๊ฒ์ ์ฝ๊ฐ ๋ค๋ฅธ ๋ณํ์ ํ
์คํธํ๊ธฐ ์ํด ํ
์คํธ ์ผ์ด์ค๋ฅผ ๋ช ๋ฒ ๋ณต์ฌํ๋ ๊ฒ์ ์ฝ์ต๋๋ค (์ : {{#if foo}}
๋ true์ false๋ก ์์ํ๊ฑฐ๋ "POJO"์ Ember.Object
), ์ฐ๋ฆฌ๋ ๊ธฐ์กด ํ
์คํธ์์ ๋ง์ด ์ํํ์ต๋๋ค.
๋๋ก๋ ์ด๊ฒ์ด ์ต์ ์ ๋ฐฉ๋ฒ์ด์ง๋ง ์ฌ๊ธฐ์๋ ๋ง์ ๋ฌธ์ ๊ฐ ์์ต๋๋ค. ๋จผ์ ํ์ผ์์ ๋ฌผ๋ฆฌ์ ์ผ๋ก ๋ง์ ์์ ํ ์คํธ๋ฅผ ์์ฑํ์ฌ ํญ๋ชฉ์ ์ฐพ๊ธฐ ์ด๋ ต๊ฒ ๋ง๋ญ๋๋ค. ๋ํ ๋๊ตฐ๊ฐ๊ฐ ์ ํ ์คํธ๋ฅผ ์ถ๊ฐํด์ผ ํ ๋ ์ผ๋ฐ์ ์ผ๋ก ๋ช ๊ฐ์ง ๋ณํ ์ค ํ๋๋ฅผ ๋ฌด์์๋ก ์ ํํ์ฌ ์ ์๋๋ฆฌ์ค์ ์ ํฉํ์ง ์์ ์ธ๋ถ ์ ๋ณด / ์ค์๋ฅผ ์ ๋ฌํฉ๋๋ค. ๋ณต์ฌ๋ณธ ์ค ํ๋์์ ๋ฒ๊ทธ๋ฅผ ์์ ํ๋ฉด ๋๋จธ์ง๋ ์์ด ๋ฒ๋ฆด ๊ฒ์ ๋๋ค.
์ผ๋ฐ์ ์ผ๋ก ์ค๋ณต์ ํผํ๋ ๋ฐฉ๋ฒ์ด ์์ต๋๋ค. ์๋ฅผ ๋ค์ด, ๋ค๋ฅธ ์์ ์กฐ๊ฑด์ ํ
์คํธํ๋ ๊ฒฝ์ฐ ( {{#if foo}}
true
๋ฐ false
) ๋์ผํ ํ
์คํธ์์ ๋ ์์ ์กฐ๊ฑด์ ๋ชจ๋ ํ
์คํธ ํ ์ ์์ต๋๋ค.
["<strong i="5">@test</strong> if"]() {
this.render(`{{#if cond1}}T{{else}}F{{/if}}{{#if cond2}}T{{else}}F{{/if}}`, { cond1: true, cond2: false });`
... // follow the usual I-N-U-R cycle
}
๋ค๋ฅธ ๊ฒฝ์ฐ์๋ ์ผ๋ถ ๊ณต์ ์ํผ ํด๋์ค๋ฅผ ์ถ์ถํ์ฌ (์ค์ ํ ์คํธ ์ผ์ด์ค๋ฅผ ์ํผ ํด๋์ค์ ๋ฃ์) ๊ณต์ ๋์์ ์ ์ํ๊ณ ํ์ ํด๋์ค์์ ๋ค๋ฅธ ๋ถ๋ถ์ ๊ตฌ์ฑ ํ ์์์์ต๋๋ค. ์ด๋ฅผ ํตํด ํ ์คํธ ์ผ์ด์ค๋ฅผ ํ ๋ฒ๋ง ์์ฑํ๋ฉด ์๋์ผ๋ก ๋ค์ํ ์๋๋ฆฌ์ค ( "๋งคํธ๋ฆญ์ค ์คํ์ผ"ํ ์คํธ)๋ฅผ ์คํํ ์ ์์ต๋๋ค.
๊ฐ์ฅ ์ข์ ์๋ ์กฐ๊ฑด๋ถ ํ
์คํธ ( if
, unless
๋ฑ) ์ผ ๊ฒ์
๋๋ค. ์ค์ ํ
์คํธ ํ์ผ ์ ํ
ํ๋ฆฟ ํธ์ถ ์คํ์ผ๊ณผ ํ์ ํด๋์ค TogglingSyntaxConditionalsTest
( shared-conditional-tests.js
)๋ฅผ ์ ์ํ๊ณ ์๋์ผ๋ก ๋ง์ ๊ณต์ ํ
์คํธ๋ฅผ ๊ฐ์ ธ์ต๋๋ค.
"์ธ๋ผ์ธ if / unless"ํ ์คํธ ๋ 11 (!) ๊ฐ์ ์๋ก ๋ค๋ฅธ ํธ์ถ ์๋๋ฆฌ์ค์ ๋ํด ๋์ผํ ํ ์คํธ ์ผ์ด์ค ์ธํธ๋ฅผ ์คํํ์ฌ์ด ์์ ์ ๋์ฑ ํ์ฅํฉ๋๋ค.
๊ณต์ ์ ์ค์ ๊ตฌ์กฐ๋ ๋๋ฌํ๊ธฐ๊ฐ ๋ค์ ์ด๋ ค์ ๊ณ ์ฑ์ํ๊ณ ์ ๋๋ก๋๋ ๋ฐ ์๊ฐ์ด ์ข ๊ฑธ๋ ธ์ง ๋ง ๊ทธ์ ๋ฐ๋ฅธ ๊ฒฐ๊ณผ๋ ์์ฒญ๋ฌ์ต๋๋ค (๊ธฐ๋ณธ ์๋๋ฆฌ์ค๋ ์ด์ {{#with}}
์ {{#each}}
์ฌ์ด์์ ๊ณต์ ๋ฉ๋๋ค. ๊ฒ๋ค๊ฐ).
๊ธฐ์กด์ ๋ง์ ํ
์คํธ๋ ๋ทฐ, {{view.foo}}
, {{#view}}
, context
, ์ปจํธ๋กค๋ฌ ๋ฑ๊ณผ ๊ฐ์ ๋ ๊ฑฐ์ ์๋ฏธ ์ฒด๊ณ๋ฅผ ์ฌ์ฉํฉ๋๋ค. ๋๋ถ๋ถ์ ๊ฒฝ์ฐ ์ด๊ฒ์ ์์ ํ ๋ถ์์ ์ด๋ฉฐ ๊ทธ ์์์ ์์๊ฐ ์ผ์ ์ํํ๋ ์ฃผ์ ๋ฐฉ๋ฒ์ด์๋ ์๋์ ์์ฑ๋ ํ
์คํธ์ ๊ฒฐ๊ณผ. ์ด๋ฌํ ๊ฒฝ์ฐ ์ผ๋ฐ์ ์ผ๋ก ๋ฌธ์ ์์ด ์ ํ๋ค์ค (๋์ ๊ตฌ์ฑ ์์๋ฅผ ์ฌ์ฉ)๋ก ์ด์ ํ ์ ์์ต๋๋ค.
์์ฌ์ค๋ฌ์ด ๊ฒฝ์ฐ PR์ ์ฒซ ๋ฒ์งธ ๋ฐ๋ณต์์ ์ด์๋์ง ์์ ํ ์คํธ๋ฅผ ์ํํ๊ณ ์ค ์ฃผ์์ผ๋ก ์ง๋ฌธ ํ ์๋ ์์ต๋๋ค.
attrs
๋๋ attrs
์ฐ๋ฆฌ๋ ๋ฅ๊ทผ ๊ตฌ์ฑ ์์ (๊ฑฐ์ ๋ชจ๋ ๊ตฌ์ฑ ์์)๋ฅผ ์ฌ์ฉํ๋ ํ
์คํธ์์ {{attrs.foo}}
๋ฅผ ์ฌ์ฉํ์ง ์๊ณ ๋์ผํ ์ด๋ฆ (์ฆ, {{foo}}
๊ฐ์ง ์์ฑ์ ๋ฐ์๋๋ ์์ฑ์๋ง ์์กดํ๊ธฐ๋ก ๊ฒฐ์ ํ์ต๋๋ค. attrs.*
(๋ชจ๋ ๊ฐ์ ํ์ผ์ ์์ด์ผ ํจ)๊ฐ ์๋๋ฉด ์ผ๋ฐ์ ์ผ๋ก ์ผ๊ด์ฑ์ ์ํด {{attrs.foo}}
๋ณด๋ค๋ {{foo}}
์ ํธํด์ผํฉ๋๋ค. ๋ช
ํํ ํ ํ์๊ฐ ์๋ค๊ณ ์๊ฐ๋๋ฉด innerFoo
๋ outerFoo
์ ๊ฐ์ ์ด๋ฆ์ ์ธ์ ๋ ์ง ์ง์ ํ ์ ์์ต๋๋ค.
@locks์ https://locks.svbtle.com/to-attrs-or-not-to-attrs๋ ์ฐธ์กฐํ์ญ์์ค.
ํฌํ ํ ํ ์คํธ๊ฐ Glimmer 2 ๋๋ HTMLBar์์ ์๋ํ์ง ์๋ ๊ฒฝ์ฐ๊ฐ ์์ต๋๋ค. (๋ ์์ง ๋ชจ๋์์ ์๋ํ์ง ์์ผ๋ฉด ๋ญ๊ฐ ์๋ชปํ ๊ฒ์ ๋๋ค.)
Glimmer 2์์ ์๋ํ์ง ์๋ ๊ฒฝ์ฐ ํด๋น ๊ธฐ๋ฅ์ ์์ง ์์ ํ ๊ตฌํํ์ง ์์๊ธฐ ๋๋ฌธ์ผ ์ ์์ต๋๋ค. (์๋ฅผ ๋ค์ด ๊ธฐ๋ณธ ๊ตฌ์ฑ ์์ ์ง์์ ๊ตฌํํ์ง๋ง ํ์ฌ attributeBindings
๋ ๊ตฌํํ์ง ์์์ต๋๋ค.)
์ด ๊ฒฝ์ฐ์๋ ํ
์คํธ๋ฅผ ์๋ก์ด ์คํ์ผ๋ก ์ด์ํ๋ ๊ฒ์ด ์ข์ต๋๋ค. ๊ทธ๋์ผ ๊ธฐ๋ฅ์ด ๊ตฌํ ๋ ๋ ๊ฐ๋จํ ํ์ฑํ ํ ์ ์์ต๋๋ค. Glimmer 2์ ๋ํ ํ
์คํธ๋ฅผ ์ผ์์ ์ผ๋ก ๋นํ์ฑํํ๋ ค๋ฉด ๋ฉ์๋ ์ด๋ฆ์ @test
์ ๋์ฌ๋ฅผ @htmlbars
๋ก ๋ฐ๊พธ๋ฉด๋ฉ๋๋ค ( "HTMLBars์์๋ง ์คํ"์ ์๋ฏธ ํจ). ๋น์ ์ ๋ํ ์ ๋์ฌ์ ์ํด ์ ์ฒด ๋ชจ๋์ ํด์ ํ ์ ์์ต๋๋ค moduleFor
์ ์ด๋ฆ์ @htmlbars
.
๋๋ฌธ ๊ฒฝ์ฐ์ง๋ง ํ ์คํธ๋ Glimmer 2์์ ์ ๋๋ก ์๋ํ์ง๋ง HTMLBar์์๋ ํต๊ณผํ์ง ๋ชปํฉ๋๋ค. ํ ์คํธ์ค์ธ ์๋ฏธ๊ฐ ์ฌ๋ฐ๋ฅธ์ง ๋ค์ ํ์ธํด์ผํ์ง๋ง ํ์ฌ HTMLBars ๊ตฌํ์ ๋จ์ํ ๋ฒ๊ทธ๊ฐ์์ ์๋ ์์ต๋๋ค. (์ด๊ฒ์ ์ผ๋ฐ์ ์ผ๋ก ์๋ก์ด "๋งคํธ๋ฆญ์ค ์คํ์ผ"์ ์ฌ์ฉํ์ฌ ์ผ๋ถ HTMLBars ๊ธฐ๋ฅ์ ํ ์คํธ ํ ๋ ๋ฐ์ํ๋ฉฐ, ์ผ๋ถ ๊ฒฝ์ฐ์๋ ๊ฐ์ด ์ฌ๋ฐ๋ฅด๊ฒ ์ ๋ฐ์ดํธ๋์ง ์์ต๋๋ค.)
์ด ๊ฒฝ์ฐ ์ ์ฌํ๊ฒ ๊ฐ๋ณ ํ
์คํธ ์ผ์ด์ค ๋๋ ์ ์ฒด ๋ชจ๋์ @glimmer
๋ก ํ๋๊ทธ ์ง์ ํ ์ ์์ต๋๋ค. ์ด๊ฒ์ ๋งค์ฐ ๋๋ฌผ๊ฒ ์์๋๊ธฐ ๋๋ฌธ์ (๋ฒ๊ทธ ์์ ์ด ํ์ํ ์ ์์), ์ค ์ฃผ์์ ๋ฐ์ํ ๋ฌธ์ ์ ๋ํ ๊ฐ๋ตํ ์ค๋ช
์ ํฌํจ ํ ์ ์์ผ๋ฉด ๋์์ด ๋ ๊ฒ์
๋๋ค.
๋ค์์ ์ปค๋ฎค๋ํฐ ๊ตฌ์ฑ์์ด ๊ธฐ์กด ํ ์คํธ๋ฅผ ์ด์ํ๋ ๋ฐ ๋์์ ์ค ํ๋ฅญํ ์์ ๋๋ค.
{{if}}
๋์ฐ๋ฏธ{{#with}}
{{unless}}
(hash)
๋์ฐ๋ฏธ๋ณด์๋ค์ํผ ์ด๊ธฐ ๋ฐ๋ณต์ ๋ ์ด๋ ค์ ์ง๋ง (์ฐ๋ฆฌ๋ ์ฌ์ ํ ๊ณต์ ๋ ํ ์คํธ ์ผ์ด์ค ์คํ ๋ฆฌ๋ฅผ ํ์ ํ๊ณ ์์์ต๋๋ค) ํ์์ ์๋๋ ๋น๊ต์ ๊ฐ๋จํ์ต๋๋ค. ๊ธธ์ ์ด์ด ์ค @GavinJoyce ์ @chadhietala ์๊ฒ ๊ฐ์ฌ๋๋ฆฝ๋๋ค!
๋ค์์ ์ข์ ์ถ๋ฐ์ ๋ชฉ๋ก์ ๋๋ค. ์ด ์ค ํ๋์ ๋ํด ์ง์งํ๊ฒ ์์ ํ๋ ๊ฒฝ์ฐ ๋ค๋ฅธ ์ฌ๋๋ค์ด ์์ ํ์ง ์๋ ๊ฒ์ ์ ์ ์๋๋ก ์๋์ ์๊ฒฌ์ ๋จ๊ธฐ๊ณ ์ถ์ ๊ฒ์ ๋๋ค. (์๊ฐ์ด ๋ถ์กฑํ๊ฑฐ๋ ํฐ ์ด๋ ค์์ ๊ฒช์ ๊ฒฝ์ฐ "์ ๊ธ ํด์ "๋ก ๋์ ์ค๊ฑฐ๋ WIP ์์ ์ ๋ฐ์ด ๋ค๋ฅธ ์ฌ๋์ด ์ ํํ ์ ์๋๋กํ์ญ์์ค!)
์ด๊ฒ์ด ์ด๋ฏธ ์กด์ฌํ๋์ง ๋ชจ๋ฅด๊ฒ ์ต๋๋ค. ๊ทธ๊ฒ์ด ์๋ค๋ฉด ๊ทธ๊ฒ์ ์ฐพ์์ ํฌํธํ์ญ์์ค. ๊ทธ๋ฌ๋ ๊ทธ๋ ์ง ์์ผ๋ฉด ์ ํ์ผ์ ๋ง๋์ญ์์ค (์ด๋ฏธ https://github.com/emberjs/ember.js/blob/master/packages/ember-glimmer/tests/integration/content-test.js์์ ์์ํ์ต๋๋ค) . ์์ด๋์ด๋ "DOM์ ์ด์ํ ๊ฒ์ ๋ฃ์ผ๋ฉด ์ด๋ป๊ฒ๋๋์ง"ํ
์คํธํ๋ ๊ฒ์
๋๋ค. ์ : {{foo}}
, ์ฌ๊ธฐ์ foo
๋ undefined
, null
, ๋ฐ ๊ฐ์ฒด ๋ฑ. ์ด๊ฒ์ "๋งคํธ๋ฆญ์ค ์คํ์ผ"ํ
์คํธ์ ์ฃผ์ ๋์์ด๋ฏ๋ก ํ
์คํธ ๋๊ตฌ๊ฐ ์๋ํ๋ ๋ฐฉ์์ ์ฐ๊ตฌํ๊ณ ์กฐ๊ฑด๋ถ ํ
์คํธ์์ ์์ด๋์ด๋ฅผ ๋์ถํ๋ ๊ฒ์ด ์ข์ต๋๋ค.
๋ํ https://github.com/emberjs/ember.js/blob/master/packages/ember-htmlbars/tests/hooks/text_node_test.js๋ ํก์ํด์ผํฉ๋๋ค.
attr_nodes
ํ
์คํธ] (https://github.com/emberjs/ember.js/tree/master/packages/ember-htmlbars/tests/attr_nodes) (: lock : @chancancode ๋ฐ @ wycats)์ด๋ฌํ ํ ์คํธ๋ฅผ ์์ธํ ์ดํด๋ณด๊ณ ์๊ตฌ ์ฌํญ์ ์ดํดํ๊ณ ์ถ์ต๋๋ค. ์ง๊ธ์ ์ ๊ธ๋๋ค.
compat
ํ
์คํธ] (https://github.com/emberjs/ember.js/tree/master/packages/ember-htmlbars/tests/compat) : ๊ฐ์ :2.6๊น์ง ๋ ๊ฑฐ์ ์ ๋์จ์ ๋ํ ์ง์์ ์ข ๋ฃํ๋ค๊ณ ๋ฐํ ํ์ผ๋ฏ๋ก Glimmer 2์์ ์ด๋ฌํ ๊ธฐ๋ฅ์ ์ง์ํ ํ์๊ฐ ์์ต๋๋ค. PR์ ์ด์ด ๋ง์คํฐ์ ํ ์คํธ ๋ฐ ๊ธฐ๋ฅ์ ์ ๊ฑฐํ์ญ์์ค. (์ด๊ฒ์ ์๋ง๋ ์ฝ๋๋ฒ ์ด์ค์ ๋ํ ์๋์ ์ผ๋ก ๊น์ ์ง์์ด ํ์ํ ๊ฒ์ ๋๋ค.)
glimmer-component
ํ
์คํธ] (https://github.com/emberjs/ember.js/tree/master/packages/ember-htmlbars/tests/glimmer-component) : scissors : ์ด ํด๋๋ ์ฌ์ฉ๋์ง ์์ต๋๋ค. ์ ๊ฑฐํ๋ ค๋ฉด PR์ ๋ณด๋ด์ญ์์ค.
tests/integration/helpers
๋ก ์ฎ๊ฒจ์ผํ๋ค๊ณ ์๊ฐํฉ๋๋ค)-html-safe
] (https://github.com/emberjs/ember.js/blob/master/packages/ember-htmlbars/tests/helpers/-html-safe-test.js) : lock :I'm not sure if this is needed for Glimmer 2. Locking for now.
closure component
] (https://github.com/emberjs/ember.js/blob/master/packages/ember-htmlbars/tests/helpers/closure_component_test.js) (: lock : by @ ์ธ๋ผ ๋ฒ )I am pretty sure this will have to be `@htmlbars` for now.
collection
ํ
์คํธ] (https://github.com/emberjs/ember.js/blob/master/packages/ember-htmlbars/tests/helpers/collection_test.js) : ๊ฐ์ : This is legacy. Please open a PR to remove the test and any code you could find that implements the feature.
#component
helper] (https://github.com/emberjs/ember.js/blob/master/packages/ember-htmlbars/tests/helpers/component_test.js) Basic support for the feature has landed in #13057 and we already wrote some basic tests. Please port the rest of the tests into the new file (keep an eye for things that are already tested in the new file). I expect most of them to pass except position params which is not yet implemented in Glimmer 2 (you can make them `@htmlbars` for now).
Basic support for the feature has landed in #12910/#13087 and we already wrote some basic tests. Please port the rest of the tests into the new file (keep an eye for things that are already tested in the new file). I expect most of them to pass with the exception of the lifecycle stuff (destroy, etc) for class-based helpers (you can make them `@htmlbars` for now).
debug
ํ
์คํธ] (https://github.com/emberjs/ember.js/blob/master/packages/ember-htmlbars/tests/helpers/debug_test.js) : scissors : This is a duplicate of `log` as far as I can tell. See notes on `log` tests below.
#each-in
ํ
์คํธ] (https://github.com/emberjs/ember.js/blob/master/packages/ember-htmlbars/tests/helpers/each_in_test.js) This should be ported to `test/intergration/syntax/...`. (In general, what was previously known as "block helpers" are now implemented as "syntax" in Glimmer 2.)
This helper is not implemented in Glimmer 2 and will be pretty difficult for a new contributor to implement it. However, it is still important to port the tests asap (and make the module `@htmlbars`).
For bonus points, you might want to think about how to share the basic tests with the rest of the conditional matrix (i.e. testing when we need to go into the "default" branch and when we need to go into the "inverse"/`{{else}}` branch). See #13048 for some inspiration.
#each
ํ
์คํธ] (https://github.com/emberjs/ember.js/blob/master/packages/ember-htmlbars/tests/helpers/each_test.js) ๐ @Joelkang ์ ๊ณตThis should be ported to `test/intergration/syntax/...`. (In general, what was previously known as "block helpers" are now implemented as "syntax" in Glimmer 2.)
Basic support for the feature has landed in #13048 and we already wrote some basic tests. Please port the rest of the tests into the new file (keep an eye for things that are already tested in the new file). I expect most of them to pass with the exception of the lifecycle stuff (destroy, etc) for class-based helpers (you can make them `@htmlbars` for now).
For bonus points, you might want to think about how to share the basic tests with the rest of the conditional matrix (i.e. testing when we need to go into the "default" branch and when we need to go into the "inverse"/`{{else}}` branch). I _think_ we already did that part in #13048, but if you see other ways to improve it or do more sharing please feel free to suggest them.
get
ํ
์คํธ] (https://github.com/emberjs/ember.js/blob/master/packages/ember-htmlbars/tests/helpers/get_test.js) This helper is not implemented in Glimmer 2 and will be pretty difficult for a new contributor to implement it. However, it is still important to port the tests asap (and make the module `@htmlbars`).
(Actually, it's not _that_ hard โ the implementation will likely not take more than 10-20 lines, but you would need to be quite familiar with how Glimmer 2 works to do it. Once #13103 is completed it might give you some ideas.)
I believe this is already ported by @GavinJoyce. The rest are probably just legacy stuff that we can remove. <strong i="23">@GavinJoyce</strong> can you confirm?
{{input}}
ํ
์คํธ] (https://github.com/emberjs/ember.js/blob/master/packages/ember-htmlbars/tests/helpers/input_test.js) (: lock : by @ ๊ฐ๋น ์กฐ์ด์ค)This helper is a not implemented in Glimmer 2 and will be pretty difficult for a new contributor to implement it. However, it is still important to port the tests asap (and make the module `@htmlbars`).
(More precisely, the helper uses component features that are not yet implemented, such as attribute bindings. Once they are implemented the tests will probably Just Passโข.)
loc
ํ
์คํธ] (https://github.com/emberjs/ember.js/blob/master/packages/ember-htmlbars/tests/helpers/loc_test.js) The helper is not implemented in Glimmer 2, but should be trivial if you want to do it. (See #12910 or #13093) Otherwise you can always mark the module as `@htmlbars`.
log
ํ
์คํธ] (https://github.com/emberjs/ember.js/blob/master/packages/ember-htmlbars/tests/helpers/log_test.js) The helper is not implemented in Glimmer 2, but should be trivial if you want to do it. (See #12910 or #13093) Otherwise you can always mark the module as `@htmlbars`. As mentioned above, I think `debug_test.js` is just a duplicate of this, please verify and delete that file. **As an exception**, we only want to test initial render here, not the usual "I-N-U-R" cycle.
partial
ํ
์คํธ] (https://github.com/emberjs/ember.js/blob/master/packages/ember-htmlbars/tests/helpers/partial_test.js) This functionality is not implemented in Glimmer 2 and will be pretty difficult for a new contributor to implement it. However, it is still important to port the tests asap (and make the module `@htmlbars`). Please consider adding some abstractions like `this.registerPartial`.
text_area
ํ
์คํธ This helper is a not implemented in Glimmer 2 and will be pretty difficult for a new contributor to implement it. However, it is still important to port the tests asap (and make the module `@htmlbars`).
(More precisely, the helper uses component features that are not yet implemented, such as attribute bindings. Once they are implemented the tests will probably Just Passโข.)
unbound
ํ
์คํธ] (https://github.com/emberjs/ember.js/blob/master/packages/ember-htmlbars/tests/helpers/unbound_test.js) This helper is not implemented in Glimmer 2 and will be pretty difficult for a new contributor to implement it. However, it is still important to port the tests asap (and make the module `@htmlbars`).
(Actually, it's not _that_ hard โ the implementation will likely not take more than 10-20 lines, but you would need to be quite familiar with how Glimmer 2 works to do it. Once #13103 is completed it might give you some ideas.)
view
ํ
์คํธ] (https://github.com/emberjs/ember.js/blob/master/packages/ember-htmlbars/tests/helpers/view_test.js) (: lock : by @chadhietala)We announced we will end support for the legacy addons by 2.6, so we won't need to support these features in Glimmer 2. Please carefully review these tests and see if there are anything that doesn't look like deprecated/legacy functionality. Otherwise, please open PRs to remove the tests and the features on master. (This would probably require relatively deep knowledge of the codebase.)
with
ํ
์คํธ] (https://github.com/emberjs/ember.js/blob/master/packages/ember-htmlbars/tests/helpers/with_test.js)I believe this is already ported by @chadhietala. The rest are probably just legacy stuff that we can remove. <strong i="5">@chadhietala</strong> can you confirm?
yield
ํ
์คํธ] (https://github.com/emberjs/ember.js/blob/master/packages/ember-htmlbars/tests/helpers/yield_test.js) (: lock : by @kiwiupover)The feature should work in Glimmer 2 (as <strong i="12">@chadhietala</strong> pointed out in https://github.com/emberjs/ember.js/pull/13093#discussion_r55926094). Please port the rest of the tests into a new file. I expect most of them to pass. There are a lot of legacy stuff in there, so please try to understand the spirit of the test and see if they are still needed (vs they are testing a legitimate thing but just happen to use legacy semantics to test them, in which case, you should port them using non-legacy semantics).
The actual `attributeBindings` feature on components is not yet implemented, but this file doesn't seem to be testing that at all. In fact, I cannot tell what this file is testing at all. Please do investigate! (I suspect this is something we already tested, perhaps <strong i="24">@GavinJoyce</strong> or <strong i="25">@chadhietala</strong> will know.)
This is probably the one place where it makes sense to test `{{attrs.foo}}` vs `{{foo}}`. I expect them to already work in Glimmer 2. However, components lifecycle hooks (e.g. `didReceiveAttrs`) is not yet implemented, so you would have to either port the test without using them, or tests that needs them as `@htmlbars` for now.
Some of these tests belongs in other files (e.g. helper without parameters should be tested inside helper tests, undefined property probably belongs in the "Basic content rendering tests". The `Binding` and computed property tests are fine here, and they should Just Workโข on Glimmer to with some modernizing. (We might want to be want to be a little bit more through with CPs if this turns out to be the only place that tests them โ like updating a dependent key updates the output, etc.) The view stuff seems largely incidental, you should be able to rewrite them without the legacy semantics, but there does seem to be one or two tests that are just testing legacy semantics (based on a quick scan). Please do investigate!
I _think_ we should be able to find a better home the stuff tested in here (like in the helpers and components files), but even just straight porting them would be helpful.
elementId
ํ
์คํธ] (https://github.com/emberjs/ember.js/blob/master/packages/ember-htmlbars/tests/integration/component_element_id_test.js) This should be tested in https://github.com/emberjs/ember.js/blob/master/packages/ember-glimmer/tests/integration/components/curly-components-test.js and I think it should just work in Glimmer 2. It probably doesn't make sense to test updating for this test โ I don't think we support updating the `elementId`, but please do investigate!
(If we start adding more tests for components, it probably makes sense to start splitting them up into different modules/files.)
This is the monster file that tests all things components. It should probably be tested in https://github.com/emberjs/ember.js/blob/master/packages/ember-glimmer/tests/integration/components/curly-components-test.js, but as I said above, we probably want to start breaking things up. Some of the features are not implemented Glimmer 2 yet, so feel free to use `@htmlbars` liberally.
Most of these functionality are not yet implemented in Glimmer 2, so you might have to `@htmlbars` the entire module.
I _think_ we should be able to find a better home the stuff tested in here (like in the content tests file), but even just straight porting them would be helpful.
I think this must already be tested in the helpers test? Please do investigate and open a PR to remove if true.
This is testing the `<input>` HTML element, not the `{{input}}` helper. I won't be surprised if a lot of them doesn't work in Glimmer 2 yet, but it would be very helpful to know. Please port the test cases and flag with `@htmlbars` as needed.
I'm not sure if this is implemented in Glimmer 2 yet. Please port the test cases and flag with `@htmlbars` as needed.
The Glimmer 2 implementation might change the story a bit, locking for now.
select
ํ
์คํธ] (https://github.com/emberjs/ember.js/blob/master/packages/ember-htmlbars/tests/helpers/select_in_template_test.js) : ๊ฐ์ : This is legacy. Please open a PR to remove the test and any code you could find that implements the feature.
I'm pretty sure this is already tested somewhere in the `if/each` tests. (The concept "tagless views" doesn't make any sense because even in htmlbars they are not implemented as views anymore.) If I am wrong, please port them into the `if/each` test files as appropriate and :scissors: this.
I'm pretty sure this is already tested in the components test. (`tagName` is not implemented yet, but it doesn't seem important for the test.) If I am wrong, please port them into the curly component test files as appropriate and :scissors: this.
I don't think the `willDestroyElement` hook is implemented in Glimmer 2, but the `willDestroy` hook is (and we already have tests for them in https://github.com/emberjs/ember.js/blob/master/packages/ember-glimmer/tests/integration/components/curly-components-test.js#L202). ~~Please investigate if there are any semantic differences (ordering, etc) between the two hooks. If they have the same semantics, we might just want to merge the two tests and test it "matrix style" (please check if the two tests are actually testing the same thing, if not, it's perfectly fine to have > 1 test).~~ Otherwise please port it with `@htmlbars`.
The `{{view}}` part is obviously legacy, if there are something that we didn't otherwise cover in the `{{#with}}` tests, please port them there, otherwise :scissors: /cc <strong i="13">@chadhietala</strong>
ViewNodManager
์ ๊ตฌํ์ ์๋ง๋ ์ฝ๊ฐ ๋ ์ค๋ ๋จธ๋ฌด๋ฅผ ํ์๊ฐ์์ ๊ฒ์
๋๋ค. ์๋ํ๋ฉด ๋ด๋ถ์ ์ธ ๊ฒ๋ค์ ์ฌ์ ํ โโhtmlbar์์ ๋ทฐ๋ก ๊ตฌํ๋๊ธฐ ๋๋ฌธ์
๋๋ค. ๊ทธ๋ฌ๋ ์ด๊ฒ์ ์ค์ํ ๊ฒ์ ํ
์คํธํ๋ ๊ฒ ๊ฐ์ง ์์ต๋๋ค. ๊ทธ๋์ ์ฐ๋ฆฌ๋ ์๋ง๋ : scissors : ๊ทธ๊ฒ? @rwjblue ํ์ธํ ์ ์์ต๋๊น?
This is likely legacy. Please do investigate!
This seems to be testing `Ember.TEMPLATES`. I don't know if this is legacy, locking for now. <strong i="11">@rwjblue</strong> can you confirm and update this item? If it's legacy, we can just :scissors: this and the implementation. If it's not, I assume it's already handled at the container/resolver level and they should Just Workโข in Glimmer 2 after porting.
Please do investigate what this is testing, and see if it could be merged into the helpers integration tests.
This seems to be testing 'view.env`. I don't know if this is legacy, locking for now. @rwjblue/<strong i="22">@wycats</strong> can you confirm and update this item?
ํฌํ ํด์ผ ํ ๋ค๋ฅธ ํ ์คํธ๋์์ ๊ฒ์ ๋๋ค. ๋ด๊ฐ ๋์น ๊ฒ์ ๋ฐ๊ฒฌํ๋ค๋ฉด ๋๊ธ์ ์ธ๊ธํ์ญ์์ค.
PR์ ์ ์ถํ ์ค๋น๊ฐ ๋์์ผ๋ฉด (WIP PR์ ์ ์ถํด๋๋ฉ๋๋ค!) PR ์ค๋ช ์์์ด ๋ฌธ์ ๋ฅผ ์ฐธ์กฐํ์ฌ ๊ฒํ ํ ์ ์๋๋กํ์ญ์์ค.
๊ฐ๋ฅํ ํ ๋นจ๋ฆฌ ๋ง์ ํ ์คํธ๋ฅผ ์ด์ํ๋ ค๊ณ ํฉ๋๋ค. ์ด์์ ์ผ๋ก๋ ๋ค์ ์ฃผ ๋๋ 2 ์ฃผ ๋ด์ ๋๋ถ๋ถ์ (๋ชจ๋๋ ์๋์ง๋ง) ํ ์คํธ๋ฅผ ์ด์ํ๊ณ ์ถ์ต๋๋ค.
๋น์ ์ ๋์์ ๋ฏธ๋ฆฌ ๊ฐ์ฌ๋๋ฆฝ๋๋ค! : heart : : yellow_heart : : green_heart : : blue_heart : : purple_heart :
if/unless tests
๋ ์ ๊ฑฐ / ์ด๋ํ๊ฒ ์ต๋๋ค. PR : https://github.com/emberjs/ember.js/pull/13159"willDestroyElement"ํ ์คํธ๋ฅผ ์ดํด ๋ณด๊ฒ ์ต๋๋ค.
ํต์ฌ์ didInsertElement์ ์ญ์ผ๋ก โโ๊ฐ์ฃผ๋๋ฏ๋ก DOM ๋ถํด ์ด์ ์ ์คํ๋๋ฏ๋ก DOM ๋ถํด ํ ๋น๋๊ธฐ ์ธ willDestroy์ ์ํด ์ฒ๋ฆฌ ๋ ๊ฐ๋ฅ์ฑ์ด ๊ฑฐ์ ์์ต๋๋ค. ๋ํ didInsertElement ํํฌ๊ฐ ์คํ ๋ ๊ฒฝ์ฐ์๋ง ์คํ๋์ด์ผํฉ๋๋ค.
@GavinJoyce ๊ตฌ์ฑ ์์ ๋์ฐ๋ฏธ์์ ๋๋ฌด ๋ฆ๊ฒ ๋ฐ์ํ๋์ด ์๋ช ์ฃผ๊ธฐ ํํฌ์ ํจ๊ป htmlbars์ ํ์ฌ ๋ฒ๊ทธ๊ฐ ์์ต๋๋ค. https://github.com/emberjs/ember.js/issues/13028
๋ํ ํ์ฌ each / else https://github.com/emberjs/ember.js/issues/12716์ ๋ฒ๊ทธ๊ฐ
๋ํ 1.13์์ ์ฌ์ฉํ ์์๋ parentView๋ฅผ ํ๊ทํ์ง๋ง ๊ทธ๊ฒ์ ๊ฐ์ธ API์ด๋ฉฐ ์ฌ๋๋ค์ด ๋งํ๋ ์ด์ ์ธ์ง ํ์คํ์ง ์์ ํ๋์ ๊ทธ๋ฌ์ต๋๋ค.
ํฌ๋ฏธํ ์๋ช ์ฃผ๊ธฐ๋ฅผ ๋ค๋ฃจ๋ ๋ค๋ฅธ ํ ์คํธ๊ฐ ์์ต๋๊น? ๊ตฌ์ฑ ์์๋ฅผ ์ถ๊ฐ / ์ ๊ฑฐํ๋ ๋ชจ๋ ํ ์คํธ์ ์ถ๊ฐํด์ผ ํ ๊ฒ์ ๋๋ค. / cc @wycats @chancancode
loc
ํ
์คํธ] (https://github.com/emberjs/ember.js/blob/master/packages/ember-htmlbars/tests/helpers/loc_test.js) ( # 13129 )์ด์๋์ง ์์ #with
ํ
์คํธ๋ฅผ ์ญ์ ํ ์ ์๋์ง ํ์ธํ์ต๋๋ค.
#with
ํ
์คํธ ์ ๊ฑฐ # 13130log
ํ
์คํธ] (https://github.com/emberjs/ember.js/blob/master/packages/ember-htmlbars/tests/helpers/log_test.js)debug
ํ
์คํธ] (https://github.com/emberjs/ember.js/blob/master/packages/ember-htmlbars/tests/helpers/debug_test.js)๋๋ unbound
์ทจํ ์ ์์ต๋๋ค : ์ ๊ธ :
each-in
ํ
์คํธ๋ฅผ ์ด์ํ๊ฒ ์ต๋๋ค.
@chancancode- debug tests
ํญ๋ชฉ๋ ํ์ธ / ์ ๊ฑฐ ํ ์ ์๋ค๊ณ ์๊ฐํฉ๋๋ค.
custom-helper-tests
https://github.com/emberjs/ember.js/issues/13139 ๋ ์ฌ์ฉํ์ง ์๋ glimmer-component
ํ
์คํธ ํด๋๋ฅผ ์ ๊ฑฐํฉ๋๋ค.
"๊ธฐ๋ณธ ์ฝํ ์ธ ๋ ๋๋ง ํ ์คํธ"๋ฅผ ๋ฐ๊ณ ์์ต๋๋ค (๊ทธ๋ฆฌ๊ณ Glimmer์์ ๊ตฌํ ์์ ).
๋๋ " select
test : scissors :"๋ฅผ ๋ฐ๊ณ ์์ต๋๋ค.
5c12157์ ๋์ ๋ ์คํ์ผ๊ณผ ์ผ์นํ๋๋ก ์ ๋ฐ์ดํธ
collection
ํ
์คํธ : ๊ฐ์ :" https://github.com/emberjs/ember.js/pull/13161์์ง ์ ๊ฒจ ์์ง ์์ ๊ฒฝ์ฐ input
์์ ํ
์คํธ๋ฅผ ์ดํด๋ณด๊ณ ์์ต๋๋ค.
๋ด๊ฐ ์ดํด๋ณผ ๊ฒ
์์ง Glimmer2์ ์ต์ํ์ง ์์ต๋๋ค. ์ด์จ๋ # 13103์ ์ด์ ๋ณํฉ๋์์ผ๋ฏ๋ก ๊ตฌํ ๋ฐฉ๋ฒ์ ์์ ๋ณด๊ฒ ์ต๋๋ค.
ํด๋ก์ ๊ตฌ์ฑ ์์์ ๋ํ ๋ฒ๊ทธ๋ฅผ ์์ ํด์ผํ๋ฏ๋ก closure component
์ ํ
์คํธ๋ฅผ ๋ณด๊ฒ ์ต๋๋ค.
์ฐ๋ฆฌ๋ ์๋ช ์ฃผ๊ธฐ ํํฌ๋ฅผ ๊ตฌํํ๊ณ ์์ต๋๋ค. : lock : -ing the tests : ok_hand :
"๋ฌดํจ ์์"ํ ์คํธ # 13187 : ๊ฐ์ :
block params
ํ
์คํธ # 13189
: ์จ์ด๋ธ : ๋ด๊ฐ ํ ๊ฒ :
{{input}} tests
: PR : https://github.com/emberjs/ember.js/pull/13194์์จ ํ ์คํธ๋ฅผ ํ ๊ฒ์
์ ๋ ๊ณ์ํด์ attrs_lookup
ํ
์คํธ๋ฅผํ๊ฒ ์ต๋๋ค. PR # 13203
partial
๋์ฐ๋ฏธ ํ
์คํธ๋ฅผ ์ํด # 13199๋ฅผ ์ด์์ต๋๋ค.
binding integration
์ํ ์์
{{yield}}
ํ
์คํธ๋ฅผ ์ํด ์ด๋ ค ์์ต๋๋ค.closure component
ํ
์คํธ๋ฅผ ์ํด # 13214๋ฅผ ์ฝ๋ ๋ค.
{{tesxtarea}}
ํ
์คํธ์ ๊ฒฝ์ฐ 13215๋๋ view
๋์ฐ๋ฏธ ํ
์คํธ์ ๊ทธ๊ฒ์ด ๋ง์ง๋ ๋ชจ๋ ๊ฒ์ ๋ณผ ๊ฒ์
๋๋ค.
๊ทธ๋ฅ ๋ฐ์ด ๋ค๊ณ ์ฐ๋ฆฌ๋ฅผ ๋์ ์ฃผ์ ๋ชจ๋ ๋ถ๋ค๊ป ๊ฐ์ฌ๋๋ฆฝ๋๋ค! ๐ ์ง์ฐ์ ๋ํด ์ฌ๊ณผ๋๋ฆฝ๋๋ค. ์ฐ๋ฆฌ๋ ์ฒ์ฒํ ๋ฐฑ ๋ก๊ทธ์์ ์์ ์ ํํค ์น๊ณ ์์ต๋๋ค. ๋ง์ : lock : ed ํญ๋ชฉ์ ์ด๋ฏธ ๊ฒํ ๋๊ธฐ์ค์ธ PR์ด ์๊ธฐ ๋๋ฌธ์ Github์ ์งํ๋ฅ ํ์ ์ค์ ํ์๋๋ ๊ฒ๋ณด๋ค ๋ ๊ฐ๊น์ต๋๋ค ๐
{{#each}}
ํ
์คํธ : # 13349
"๋ก์ปฌ ์กฐํ"ํ ์คํธ๋ฅผํ๊ฒ ์ต๋๋ค.
system/lookup-helper_test.js
ํ์ผ์ด ์ค์ findHelper
๋ฉ์๋๋ฅผ ํ
์คํธํ๋ ๊ฒ ๊ฐ์ต๋๋ค.์ด ๋ฉ์๋๋ integration/helpers/custom-helper-tests.js
ํฌํจ ๋ ๊ฒ์ผ๋ก ๋ณด์
๋๋ค. ์ฐ๋ฆฌ๊ฐ ์ค์ ember-glimmer
lib๋ฅผ ๋จ์ ํ
์คํธํ๊ณ ์๋ ๊ฒ ๊ฐ์ง ์์ผ๋ โ๏ธ? @chadhietala @asakusuma ๋ ๋ถ ๋ชจ๋ ๋์ฐ๋ฏธ ์กฐํ ๊ด๋ จ ํ
์คํธ๋ฅผ ๋ง์ก
@Joelkang ๊ทํ์ ์ง๋ฌธ๊ณผ ๊ด๋ จ๋ ๊ฒ์ ๊ธฐ์ตํ ์ ์์ต๋๋ค. ๊ด๋ จ๋ ์ ํํ ํ์ผ์ ๋ฌด์์ ๋๊น? ๋ด๊ฐ ๋ง์ง git commit์ ๋ณผ ์ ์๋ค๋ฉด ๋ด ๊ธฐ์ต์ ํ๋ค ์ ์์ต๋๋ค.
@asakusuma ์ค, ๋๋ ๋น์ ์ด ๋ก์ปฌ ์กฐํ ํ ์คํธ๋ฅผ ์งํํ๊ณ ์๊ธฐ ๋๋ฌธ์ ๊ณตํต์ ์ด ์๋์ง ํ์ธํ๊ธฐ ์ํด ์๋ฏธํ์ต๋๋ค.
integration/helpers/custom-helper-tests.js
์ (๋) ๋ก์ปฌ ์กฐํ๋ฅผ ํ
์คํธํ์ง ์๋ ๊ฒ ๊ฐ์ต๋๋ค. ๋ํ ๋ก์ปฌ ์กฐํ๋ ํ์ฌ glimmer์์ ์๋ํ์ง ์์ผ๋ฉฐ ์์ ์์
์ค์
๋๋ค.
๋ ๋ ํ๊ฒฝ ํ
์คํธ๊ฐ ์ฐจ๋จ๋ฉ๋๋ค. ์ง๊ธ "๋ถํธ ์คํธ๋ฉ"ํ
์คํธ๋ฅผ ์ดํด๋ณด๋ฉด ๋ง์ ๋ถ๋ถ์ด ๊ธฐ๋ฅ์ผ๋ก ์ด์๋์ด์ผํฉ๋๋ค ( <script type="text/x-handlebars" data-template-name="foo">
).
mutable bindings
์ ๊ฐ๋จํ ๋ง์ด๊ทธ๋ ์ด์
: https://github.com/emberjs/ember.js/pull/13456
ํด๋ก์ ๊ตฌ์ฑ ์์ ํ ์คํธ๋ ์ด๋ฏธ ๋ช ์ฃผ ์ ์ ๋ณํฉ๋์์ต๋๋ค.
์ฌ๊ธฐ์ ์ด์ฌํ ์ผ ํด์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค! ์ ๋ฐ์ดํธ ๋ ๋ชฉ๋ก / ๋ฌธ์ ๋ฅผ ์ํด์ด ํญ๋ชฉ์ ์ข ๋ฃ : # 13644.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
๊ทธ๋ฅ ๋ฐ์ด ๋ค๊ณ ์ฐ๋ฆฌ๋ฅผ ๋์ ์ฃผ์ ๋ชจ๋ ๋ถ๋ค๊ป ๊ฐ์ฌ๋๋ฆฝ๋๋ค! ๐ ์ง์ฐ์ ๋ํด ์ฌ๊ณผ๋๋ฆฝ๋๋ค. ์ฐ๋ฆฌ๋ ์ฒ์ฒํ ๋ฐฑ ๋ก๊ทธ์์ ์์ ์ ํํค ์น๊ณ ์์ต๋๋ค. ๋ง์ : lock : ed ํญ๋ชฉ์ ์ด๋ฏธ ๊ฒํ ๋๊ธฐ์ค์ธ PR์ด ์๊ธฐ ๋๋ฌธ์ Github์ ์งํ๋ฅ ํ์ ์ค์ ํ์๋๋ ๊ฒ๋ณด๋ค ๋ ๊ฐ๊น์ต๋๋ค ๐