Yeefun Lin
Yeefun Lin
See https://github.com/koajs/cors/issues/52#issuecomment-413887382
謝謝你寫這篇文章,收穫良多。 有個小疑惑,想請你解答: 你在「hoisting 到底是怎麼運作的?」寫道:當進入 EC 時,JS 會依序把東西放到 VO 裡面,其中函式宣告先於變數宣告。 但你在「JS 引擎的運作」的編譯處理宣告部分,又是逐行處理下來,導致變數宣告先於函式宣告。 請問為什麼會有這樣子的差別? (雖然說結果不會不一樣,畢竟函式宣告的值可以覆蓋、變數宣告不能,所以哪個處理在前其實沒差)
> @yeefun 沒有很理解你的問題,不太懂你說的『但你在「JS 引擎的運作」的編譯處理宣告部分,又是逐行處理下來,導致變數宣告先於函式宣告。』這邊的意思 > > 可以舉個例子嗎? JS 進入 EC 時,會依照以下順序把東西放到 VO: 1. 把參數放到 VO 裡面並設定好值,傳什麼進來就是什麼,沒有值的設成 undefined 2. 把 function 宣告放到 VO 裡,如果已經有同名的就覆蓋掉 3. 把變數宣告放到 VO 裡,如果已經有同名的則忽略 而你在「JS 引擎的運作」舉了一個例子: ```javascript...
謝謝你寫這篇文章,講解得很清楚。 有個地方似乎有錯誤: 在「第四步:執行 test 中的程式碼」一節中,既然函式 test 已經回傳 inner 了,那 globalEC.VO.inner 應該是個 `function`,而不是 `undefined`?
about page 沒有做 anchor,我這邊要再改
> However, that perf chart seems abnormally complicated. Can you show your store setup? How many middleware are being added to the store? Any chance you could zip up and...
Currently, I'm forced to use lower-level APIs such as `useLazyQuerySubscription` and `useQueryState` to work around performance issues, which is quite frustrating for me. ```ts import { skipToken } from '@reduxjs/toolkit/query';...
> What are those 21 middleware? Usually I wouldn't expect more than 3 to 5. That might have a significant impact. I see. Could you explain why there's a significant...
> Can you show the actual store setup code, and possibly also some examples of these middleware? That would help me understand what the app itself needs to do. reduxStore.ts...
> Also, something about that perf trace JSON file seems possibly corrupted or cut off - Chrome DevTools doesn't want to load it properly. I _may_ have gotten it to...