ïŒrecycle ïŒïŒ recycle ïŒïŒ recycleïŒãã®Githubã®åé¡ãå°å·ããåã«ãç°å¢ãèæ ®ããŠãã ããã ïŒrecycle ïŒïŒ recycle ïŒïŒ recycleïŒ
@wycatsãšç§ïŒããã³ãã®
ããã¯htmlbarã®ãã©ãŒã¯ãšããŠå§ãŸããŸããããå ã®ã°ãªããŒãããžã§ã¯ããªã©ïŒã®æ§ç¯ããåŸããããã¹ãŠã®ç¥èãæœåºããEmberã®ãŠãŒã¹ã±ãŒã¹ã«ããé©ããã¢ãŒããã¯ãã£ãå®çŸããŸããããå°æ¥ã®æ¡åŒµã«ãæè»ã«å¯Ÿå¿ã§ããããã«ãªããŸãããããã³ãã®ä»ã®Ember以å€ã®ãŠãŒã¹ã±ãŒã¹ã
codezã¯https://github.com/tildeio/glimmerã«ãããŸãã TypeScriptã§ïŒåïŒæžãããŠããŠãããªããã£ããããšæããŸãã ãšã«ãããããã«ã€ããŠã¯EmberConfã§
ãšã³ãžã³ã§ããããäœæ¥ïŒäž»ã«æé©åïŒã¯ãŸã ãããããããŸãããEmberã®åºæ¬çãªãŠãŒã¹ã±ãŒã¹ããã¹ãŠã«ããŒããã®ã«ååãªå®è£ ãã§ããŠãããšæããŸãã ãã®ãããçŽ2ãæåã«ãæ°ãããšã³ãžã³ãEmberæ¬äœã«çµ±åãå§ããŸããã ãããŸã§ã®é²æç¶æ³ã«ã€ããŠã¯ããã®ã¡ã¿åé¡ããã©ããŒã§ããŸãã
æ°ãããšã³ãžã³ãå®éã®ã¢ããªã§äœ¿çšããããšã¯ãŸã äžå¯èœã§ãããäœæ¥ã¯æ¯èŒçæ©ãå®äºãããšäºæ³ãããŸãã å®è£ ãå®äºãããšãå ã®ãã³ãã«ããŒããHTMLBarãžã®ç§»è¡ãšåãããã«ãã¢ããªã®æ¯èŒçç°¡åãªããããã€ã³ã¢ããã°ã¬ãŒãã«ãªãããšãæåŸ ãããŸãã
ïŒæ©èœãã©ã°ãåãæ¿ããæ©èœã¯ãæ¢åã®ãã¹ãŠã®æ©èœãå®è£ ãããåã«å®è¡ãããå¯èœæ§ããããããæåããã¢ããªãšã·ãŒã ã¬ã¹ã«æ©èœããªãå¯èœæ§ãããããšã«æ³šæããŠãã ãããïŒ
ã ãããããªãã¯ãã©ãããã°æäŒãããšãã§ããã®ãããšçåã«æããããããŸããã
ãããããé¡ãããŸãïŒ ïŒboom ïŒïŒ sparkles ïŒïŒ fireworks ïŒïŒ tadaïŒ
ãã®æç¹ã§ãæ¯æŽããããã«ã§ããæ倧ã®äŸ¡å€ã¯ãæ¢åã®ãã¹ãã®ç§»æ€ãæ¯æŽããããšã§ãïŒãããŠããããã®PRã®ã¬ãã¥ãŒãæ¯æŽããããšã§ãïŒã ã芧ã®ãšãããEmberã«ã¯ãããã¥ãŒã¬ã€ã€ãŒãã®åäœããã¹ãããéåžžã«åºç¯ãªãã¹ãã¹ã€ãŒãããããŸãã åé¡ã¯ããããã®ãã¹ãã®å€ãããæ¢åã®å®è£
ãšå®å
šã«çµåãããæ¹æ³ã§èšè¿°ãããŠãããããµããŒããããªããªã£ãã¬ã¬ã·ãŒã»ãã³ãã£ã¯ã¹ïŒ {{view.foo}}
ïŒã䜿çšããŠããããšã§ãã
ãªã°ã¬ãã·ã§ã³ãçºçããŠããªãããšã確èªããããã«ãçŸåšã®ã¬ã³ããªã³ã°ãšã³ãžã³ïŒãhtmlbarsãïŒãšGlimmer2ã®äž¡æ¹ã«å¯ŸããŠãã¹ãã¹ã€ãŒãå šäœãå®è¡ã§ããããã«ããããšæããŸãã
ãããå¯èœã«ããæ°ãããã¹ãããŒãã¹ãäœæããŸããã 以äžã§æè¡çãªè©³çŽ°ã«ã€ããŠèª¬æããŸãããåºæ¬çãªèãæ¹ã¯ã2ã€ã®ãšã³ãžã³ã®éããã«ãã»ã«åããæœè±¡åã¬ã€ã€ãŒã«å¯ŸããŠãã¹ãã±ãŒã¹ãèšè¿°ãããã¹ãã±ãŒã¹å ã®åãã³ãŒããäž¡æ¹ã®å®è£ ã«å¯ŸããŠå®è¡ã§ããããã«ããããšã§ãã
ãã®éçšã§ãããã»ã¹å ã®æ¢åã®ãã¹ãããææ°åãããŠãã¬ã¬ã·ãŒã»ãã³ãã£ã¯ã¹ã«äŸåããªãããã«ããŸãïŒãããã®ã»ãã³ãã£ã¯ã¹ãæ瀺çã«ãã¹ãããŠããããã«èŠããå Žåãé€ãããã®å Žåã¯ãã®ãŸãŸã«ããŠãããŸãïŒã ãŸããæ°ãããã¹ãããŒãã¹ã䜿çšãããšãããããªãã¯ã¹ã¹ã¿ã€ã«ãã®ãã¹ããã¯ããã«ç°¡åãã€å¿«é©ã«è¡ãããšãã§ããŸãã ããã«ã€ããŠã¯ä»¥äžã§è©³ãã説æããŸãããããã«é«ã¬ãã«ã®ã¢ãŒããã¯ãã£å³ããããŸãã
æçµçãªçµæãšããŠããã¹ãã®èªã¿ããããšæšè«ãã¯ããã«ç°¡åã«ãªãã察象ç¯å²ãå€§å¹ ã«æ¡å€§ããŸããã ããã¯èª°ã«ãšã£ãŠãçŽ æŽãããçµæã§ããããŸã ãŸã å€ãã®ãã¹ããæ®ã£ãŠããããã¹ãŠã移æ€ãããªãéãããšã³ãžã³ãåºè·ããèªä¿¡ã¯ãããŸããã ãã ãããã¹ããã¡ã€ã«ããããã移æ€ããã®ãæäŒã£ãŠããã人ãããã°ãæ¥é±ã®ãã®æéãŸã§ã«éåžžã«è¯ãç¶æ ã«ãªããŸãã
ç§ãã¡ã䜿çšããå®éã®ã¡ã«ããºã ã¯ããªãããŒãã¯ã§ãã èããããšããããããããŸããããã·ã³ããªãã¯ãªã³ã¯ãšåŒã°ããŠã
ãã¹ããã©ã«ãå
ã«ember-glimmer
ããã±ãŒãžã«ã¯ããã¡ã€ã«ãšåŒã°ããã§ãããabstract-test-case.js
ãã·ã³ããªãã¯ãªã³ã¯ãããŠãããåãå Žæå
ã®ember-htmlbars
ããã±ãŒãžã ãã®ãã¡ã€ã«ã¯ããã¹ãã±ãŒã¹ã®äœæã«äœ¿çšããAPIãå®çŸ©ããŸãã ãã®ãã¡ã€ã«ã¯äž¡æ¹ã®ããã±ãŒãžéã§å
±æïŒã·ã³ããªãã¯ãªã³ã¯ïŒãããŠããããã2ã€ã®å®è£
ã«åºæã®æ
å ±ã¯å«ãŸããŠããŸããã
代ããã«ããã¹ãŠã®éãã¯ãåããã±ãŒãžã«ãã£ãŠæäŸããããã¡ã€ã«ïŒ 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
ããã±ãŒãžã«ã·ã³ããªãã¯ãªã³ã¯ããŸãïŒäžèšã®é£çµãã¹ãã®ããã«ïŒãã¹ãã±ãŒã¹ãæ¹åããããã«åŸãããšãã§ããããã€ãã®äžè¬çãªãã³ã/ã«ãŒã«ã次ã«ç€ºããŸãã
åãã¹ãã§ãINURããµã€ã¯ã«ãå®è¡ããå¿ èŠããããŸãã
éžæããåæå€ïŒ this.render(..., { ... })
ïŒã䜿çšããŠããã¹ããããã³ãã¬ãŒããã¬ã³ããªã³ã°ããçµæãæåŸ
ã©ããã§ããããšãè¡šæããŸãã ïŒäŸïŒ
å€ãå€æŽããã«this.runTask(() => this.rerender());
ãåŒã³åºããçµæãåããŸãŸã§ããããšãè¡šæããŸãã ïŒäŸïŒ
ãã³ãã¬ãŒãã§äœ¿çšããå€ãæŽæ°ããŸãã ïŒäŸïŒ
次ã®ããšãè©ŠããŠãã ããã
this.runTask
+ã¢ãµãŒã·ã§ã³ïŒã«åå²ããŸãã ããã«ãããå€ã®_some_ãæŽæ°ãããšããã³ãã¬ãŒãã®å¥ã®ç¡é¢ä¿ãªéšåããå¹ãé£ã°ãããããããã®ä»ã®æãŸãããªã圱é¿ãçºçããããããç Žå£ããã°ããã£ããããå¯èœæ§ãé«ããªããŸããpushObject
ã¢ã€ãã ã®åé€ãªã©ïŒãéåžžã¯è€æ°ã®æ¹æ³ãè©Šãããšããå§ãããŸãã ïŒäŸïŒãã¹ãŠã®å€æ°ã眮ãæããŠãå ã®éå§æ¡ä»¶ã«ãªã»ããããŸãã
ãã¹ãã±ãŒã¹ãæ°åã³ããŒããŠãåããã®ã®ãããã«ç°ãªãããªãšãŒã·ã§ã³ããã¹ãããã®ã¯ç°¡åã§ãïŒããšãã°ãtrueãšfalseã§å§ãŸã{{#if foo}}
ããŸãã¯ãPOJOããšEmber.Object
ã®éãïŒ ïŒããããŠæ¢åã®ãã¹ãã§ãããããããè¡ããŸããã
ãããæåã®æ¹æ³ã§ããå ŽåããããŸãããããã«ã¯å€ãã®åé¡ããããŸãã ãŸãããã¡ã€ã«å ã«ç©ççã«å€§éã®ãã¹ããçæããããããç©ãèŠã€ããã®ãå°é£ã«ãªããŸãã ãŸãã誰ããæ°ãããã¹ããè¿œå ããå¿ èŠããããšãã圌ãã¯éåžžãããã€ãã®ããªã¢ã³ãã®1ã€ãã©ã³ãã ã«éžæããæ°ããã·ããªãªã«ã¯ããŸãæå³ã®ãªã詳现/ééããåŒãç¶ããŸãã ã³ããŒã®1ã€ã§ãã°ãä¿®æ£ãããšãæ®ãã®éšåã¯ããããå¿ããŠããŸããŸãã
éåžžãéè€ãåé¿ããæ¹æ³ããããŸãã ããšãã°ãç°ãªãéå§æ¡ä»¶ïŒ {{#if foo}}
true
ããã³false
ã«å¯ŸããŠ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ãåç §ããŠãã ããã
移æ€ãããã¹ããGlimmer2ã§ãHTMLBarã§ãæ©èœããªãå ŽåããããŸãã ïŒã©ã¡ãã®ãšã³ãžã³ã§ãæ©èœããªãå Žåã¯ãããããäœãåé¡ããããŸããïŒ
Glimmer 2ã§æ©èœããªãå Žåã¯ããã®æ©èœããŸã å®å
šã«å®è£
ãããŠããªãããšãåå ã§ããå¯èœæ§ããããŸãã ïŒããšãã°ãåºæ¬çãªã³ã³ããŒãã³ãã®ãµããŒããå®è£
ããŸããããçŸæç¹ã§ã¯attributeBindings
ãå®è£
ããŠããŸãããïŒ
ãã®å Žåã§ãããã¹ããæ°ããã¹ã¿ã€ã«ã«ç§»æ€ããŠãæ©èœã®å®è£
æã«ç°¡åã«æå¹ã«ã§ããããã«ããããšããå§ãããŸãã Glimmer 2ã®ãã¹ããäžæçã«ç¡å¹ã«ããã«ã¯ãã¡ãœããåã®@test
ãã¬ãã£ãã¯ã¹ã@htmlbars
ã«çœ®ãæããã ãã§ãïŒã€ãŸããããããHTMLBarsã®ã¿ã§å®è¡ãããïŒã moduleFor
ååã®åã«@htmlbars
ä»ããããšã§ãã¢ãžã¥ãŒã«å
šäœãç¡å¹ã«ããããšãã§ããŸãã
ãŸãã«ããã¹ãã¯Glimmer 2ã§æ£ããæ©èœããŸãããHTMLBarã§ã¯åæ ŒããŸããã ãã¹ãããŠããã»ãã³ãã£ã¯ã¹ãæ£ããããšãå確èªããå¿ èŠããããŸãããHTMLBarã®çŸåšã®å®è£ ã«åã«ãã°ãããå¯èœæ§ãååã«ãããŸãã ïŒããã¯éåžžãäžéšã®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ïŒïŒscissorsïŒåŸæ¥ã®ã¢ããªã³ã®ãµããŒãã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
ãã«ããŒ]ïŒ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ïŒïŒã¯ãã¿ïŒ 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ïŒðby @ JoelkangThis 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 @ GavinJoyceïŒ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ã®èª¬æã§ãã®åé¡ãåç §ããŠãã ããã確èªããŸãã
ã§ããã ãæ©ãå€ãã®ãã¹ãã移æ€ããããšèããŠããŸãã çæ³çã«ã¯ããã¹ãŠã§ã¯ãªãã«ããŠããã»ãšãã©ã®ãã¹ãã1ã2é±é以å ã«ç§»æ€ããå¿ èŠããããŸãã
ãããããé¡ãããŸãïŒ ïŒheart ïŒïŒ yellow_heart ïŒïŒ green_heart ïŒïŒ blue_heart ïŒïŒ purple_heartïŒ
if/unless tests
ãåé€/移æ€ããŸãïŒPRïŒ https ïŒ ãwillDestroyElementããã¹ããèŠãŠãããŸãã
éèŠãªã®ã¯ãdidInsertElementã®éã§ãããšæ³å®ãããŠãããããDOMãã£ã¢ããŠã³ã®åã«å®è¡ããããããDOMãã£ã¢ããŠã³åŸã«éåæã§ããwillDestroyã§ã«ããŒãããå¯èœæ§ã¯äœããšããããšã§ãã ãŸããdidInsertElementããã¯ãå®è¡ãããå Žåã«ã®ã¿å®è¡ãããããšã«ãªã£ãŠããŸãã
@GavinJoyce htmlbarsã«ã¯çŸåšã®ãã°ãããããã®ã©ã€ããµã€ã¯ã«ããã¯ã®èµ·åãã³ã³ããŒãã³ããã«ããŒã§é ãããŸãã https://github.com/emberjs/ember.js/issues/13028
ãŸããçŸåšã®each / elsehttps ïŒ//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
ãåãããšãã§ããŸãïŒlockïŒ
each-in
ãã¹ãã移æ€ããŸãã
@chancancode - debug tests
ã¢ã€ãã ããã§ãã¯/åé€ã§ãããšæããŸãã
custom-helper-tests
ãhttps://github.com/emberjs/ember.js/issues/13139ã¯ãæªäœ¿çšã®glimmer-component
ãã¹ããã©ã«ããŒãåé€ããŸã
ãåºæ¬çãªã³ã³ãã³ãã¬ã³ããªã³ã°ãã¹ãããåããŠããŸãïŒãããŠGlimmerã§ã®å®è£ ãä¿®æ£ããŠããŸãïŒ
ã select
ãã¹ãïŒã¯ãã¿ïŒããåã£ãŠããŸã
5c12157ã§å°å ¥ãããã¹ã¿ã€ã«ã«äžèŽããããã«æŽæ°
collection
ãã¹ãïŒã¯ãã¿ïŒãã®ååŸhttps://github.com/emberjs/ember.js/pull/13161input
èŠçŽ ã®ãã¹ãããŸã ããã¯ãããŠããªããã©ããã調ã¹ãŠããŸãã
èŠãŠã¿ãŸã
ç§ã¯ãŸã Glimmer2ã«ç²ŸéããŠããŸããã ãšã«ããïŒ13103ãããŒãžãããã®ã§ããããå®è£ ããæ¹æ³ãèŠã€ããããšããŸãã
ã¯ããŒãžã£ãŒã³ã³ããŒãã³ãã®ãã°ã«åãçµãå¿
èŠãããã®ã§ã closure component
ã®ãã¹ããåããŸã
ã©ã€ããµã€ã¯ã«ããã¯ãå®è£ ããŠããŸãïŒ lockïŒ-ãã¹ããå®è¡ããŠããŸãïŒok_handïŒ
ããã€ããšã¬ã¡ã³ãããã¹ãïŒ13187ïŒã¯ãã¿ïŒ
block params
ãã¹ãïŒ13189
ïŒwaveïŒç§ãåãïŒ
{{input}} tests
ïŒPRïŒ https ïŒ æ©çãŸããã¹ããè¡ããŸã
ãŸããå
ã«é²ãã§attrs_lookup
ãã¹ããè¡ããŸãïŒPRïŒ13203
partial
ãã«ããŒãã¹ãçšã«ïŒ13199ãéããŸããã
binding integration
ãã¹ããåããŸã
{{yield}}
ãã¹ãã®ããã«éããŠããŸãclosure component
ãã¹ãã®ããã«ïŒ13214ãéããŸãã
{{tesxtarea}}
ãã¹ãã®å Žåã¯13215view
ãã«ããŒãã¹ããšããã«è§Šãããã¹ãŠã®ãã®ãåãäžããŸãã
ãã é£ã³èŸŒãã§ãç§ãã¡ãå©ããŠãããã¿ããªã«æè¬ãããã§ãïŒ ðé 延ã«ã€ããŠãè©«ã³ããŸãâç§ãã¡ã¯ããã¯ãã°ãããã£ãããšèªåèªèº«ãæãäžããŠããŸãã ïŒ lockïŒedã¢ã€ãã ã®å€ãã«ã¯ãã¬ãã¥ãŒãåŸ ã£ãŠããPRããã§ã«ãããããGithubã®ããã°ã¬ã¹ããŒã«è¡šç€ºããããããè¿ãã«ãããŸãð
{{#each}}
ãã¹ããåããŸãïŒïŒ13349
ãããŒã«ã«ã«ãã¯ã¢ããããã¹ããè¡ããŸã
system/lookup-helper_test.js
ãã¡ã€ã«ãå®éã®findHelper
ã¡ãœããããã¹ãããŠããããã«èŠããŸãããããã¯integration/helpers/custom-helper-tests.js
ã§ã«ããŒãããŠããããã«èŠããŸãã å®éã®ember-glimmer
libããŠããããã¹ãããŠããããã«ã¯æããªãã®ã§ãããããâïžïŒ @chadhietala @asakusumaãµãããšããã«ããŒã«ãã¯ã¢ããé¢é£ã®ãã¹ãã«è§Šããã®ã§ç¢ºèªã§ããŸããïŒ
@Joelkangããªãã®è³ªåã«é¢é£ãããã®ã¯äœãæãåºããŸããããç§ã觊ããæ£ç¢ºãªãã¡ã€ã«ã®ãã¡ãé¢é£ãããã®ã¯äœã§ããïŒ è§Šããå Žæã®gitcommitãèŠãããšãã§ããã°ãèšæ¶ãæºãã¶ãå¯èœæ§ããããŸãã
@asakusumaãããç§ã¯ããªããããŒã«ã«ã«ãã¯ã¢ãããã¹ãã«åãçµãã§ããã®ã§ãããã«å ±éç¹ããããã©ããã確èªããããšãæå³ããŸãã
integration/helpers/custom-helper-tests.js
ã¯ããŒã«ã«ã«ãã¯ã¢ããããã¹ãããŠããªãããã§ãã ãŸããããŒã«ã«ã«ãã¯ã¢ããã¯çŸåšã°ãªããŒã§æ©èœããŠããŸãããããã¯ä¿®æ£ã«åãçµãã§ããŸãã
ã¬ã³ããªã³ã°ç°å¢ãã¹ãã¯çç¥ãããŸãã ããã§ãããŒãã¹ãã©ããããã¹ããèŠããšããã®å€ãã¯æ©èœãšãšãã«ç§»æ€ããå¿
èŠããããŸãïŒ <script type="text/x-handlebars" data-template-name="foo">
ïŒã
ããã§mutable bindings
åçŽãªç§»è¡ãè¡ããŸããïŒ https ïŒ
ã¯ããŒãžã£ãŒã³ã³ããŒãã³ãã®ãã¹ãã¯ãæ°é±éåã«ãã§ã«ããŒãžãããŠããŸãã
ããã§é 匵ã£ãŠãããŠããããšãïŒ æŽæ°ããããªã¹ã/åé¡ãæ¯æããŠãããéããŸãïŒïŒ13644ã
æãåèã«ãªãã³ã¡ã³ã
ãã é£ã³èŸŒãã§ãç§ãã¡ãå©ããŠãããã¿ããªã«æè¬ãããã§ãïŒ ðé 延ã«ã€ããŠãè©«ã³ããŸãâç§ãã¡ã¯ããã¯ãã°ãããã£ãããšèªåèªèº«ãæãäžããŠããŸãã ïŒ lockïŒedã¢ã€ãã ã®å€ãã«ã¯ãã¬ãã¥ãŒãåŸ ã£ãŠããPRããã§ã«ãããããGithubã®ããã°ã¬ã¹ããŒã«è¡šç€ºããããããè¿ãã«ãããŸãð