Octane ๋ง์ด๊ทธ๋ ์ด์ ๋ชจํ ์ค์ ์ด ์ค๋ฅ๋ฅผ ๋ฐ๊ฒฌํ์ต๋๋ค.
index.js:172 Uncaught Error: Assertion Failed: You attempted to generate a link
for the "cashbook" route, but did not pass the models required for generating
its dynamic segments. Assertion Failed: The <strong i="6">@action</strong> decorator must be
applied to methods when used in native classes
"๋งํฌ ์์ฑ"์ ์ฒซ ๋ฒ์งธ ๋ถ๋ถ์์ ํผ๋์ค๋ฌ์ํ์ง๋ง ์ฃผ์ ๋ฌธ์ ๋ " @action ๋ฐ์ฝ๋ ์ดํฐ"์ ์์ต๋๋ค. ์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๋ฉด "์บ์ฌ๋ถ ๊ฒฝ๋ก" ์ค๋ฅ๊ฐ ์ฌ๋ผ์ก์ต๋๋ค.
DX๋ฅผ ๊ฐ์ ํ๋ ๋ ๊ฐ์ง ๋ฐฉ๋ฒ์ด ์๋ค๊ณ ์๊ฐํฉ๋๋ค.
1) "cashbook route" ์ค๋ฅ๊ฐ ๋ฐ์ํ๋ ๊ฒ์ฒ๋ผ ๋ณด์
๋๋ค( LinkTo
๊ตฌ์ฑ ์์๋ผ๊ณ ๊ฐ์ ํฉ๋๊น?). ์ผ๋จ _some_ ์์ธ๋ฅผ ํฌ์ฐฉํ๋ฉด models
๊ฐ ์ ๊ณต๋์ง ์์๋ค๊ณ ์๋ชป ๊ฐ์ ํฉ๋๋ค.
2) @action
์ ๋ํด ๋ถํํ๋ ๋ ๋ฒ์งธ ์ค๋ฅ๊ฐ ์๋ชป๋ ํ์ผ์ ๋ํ ํํธ๋ฅผ ์ค๋ค๋ฉด ๋ฌธ์ ์ ์์ธ์ ํจ์ฌ ๋นจ๋ฆฌ ์ฐพ์ ์ ์์ต๋๋ค.
๊ฐ์ ๋ฌธ์ ๋ฅผ ๊ฒช์ ์ ์๋ ์ฌ๋์ ์ํ ๊ฐ์ฃผ: ๊ฐ์ ์ด๋ฆ์ ๊ฐ์ง ํ๋์ ์ปจํธ๋กค๋ฌ์ action
๋ฐ task
(ember-concurrency์์)๊ฐ ์ ์๋์ด ์์ต๋๋ค . npx ember-native-class-codemod http://localhost:4200 ./app
codemod๋ฅผ ์คํํ ํ ํด๋์ค ์์ค ๋ค์์คํ์ด์ค์์ ์ด๋ฆ์ด ์ถฉ๋ํ์ต๋๋ค.
์ฌ๊ธฐ์ ์ฝ๊ฐ์ ๋ฐฐ๊ฒฝ์ง์, ๋ฌธ์ ์ ์ฃผ์ฅ์ด https://github.com/emberjs/ember.js/pull/14554 ์ ์ถ๊ฐ๋์์ต๋๋ค
์ฌ๊ธฐ์ ์ฌ๋ฐ๋ฅธ ์์ ์ ์ด catch
๋ธ๋ก์ ์
๋ฐ์ดํธํ๋ ๊ฒ์
๋๋ค.
๋ค์ ์ค ํ๋์:
assert
, ๊ทธ๋ ์ง ์์ ๊ฒฝ์ฐ throw e
๋ค, ๋ฐฉ๊ธ 3.18์์ ๊ฐ์ ๋ฌธ์ ๊ฐ ์์์ต๋๋ค. ๊ฒ์ํด ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค. ์ ๊ฒฝ์ฐ์๋ @action ๋ฐ์ฝ๋ ์ดํฐ์ ์ค์ ๋ฌธ์ ์ ๋ํ ๋งํฌ ์์ฑ ๋นํธ๋ฅผ ์ง๋ ๋ค๋ฅธ ์ด๋ฆ๊ณผ ๋์ผํ ์ด๋ฆ์ผ๋ก ์ฝ๊ฒ ๋ณผ ์ ์์ต๋๋ค.
์ ๊ฒฝ์ฐ์๋ ์ค๋ณต ์์ ์ด๋ฆ์ด์์ต๋๋ค.