non-enumerable object properties are lost after passing an object to workerize.
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript
- 領域
- web-dev
調査の方向性
workerize-loader の例から始め、Firebase オブジェクトとフィルタリング後の結果の間で報告されている差異を再現します。worker 呼び出しの境界と README を調べ、列挙不可プロパティを保持することが意図されているかを確認します。呼び出しをまたいで id プロパティが保持されるか、観測された動作が明確に文書化されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Here's a real life example:
// The main thread
import Worker from 'workerize-loader!./workers';
import getCompaniesFromFirebase from './getCompaniesFromFirebase';
const worker = Worker();
const {
filterCompaniesByTypes
// Other modules
} = worker;
(async () => {
const companies = await getCompaniesFromFirebase();
// typeof companies[0].id === "string" // true
const companiesFiltered = await filterCompaniesByTypes(companies, ['company-type-1', 'company-type-2']);
// typeof companiesFiltered[0].id === "string" // false
// typeof companiesFiltered[0].id === "undefined" // true
})();
// The worker
import intersection from 'lodash/intersection';
export const filterCompaniesByTypes = (companies, typesToFilerBy) => {
return companies.filter(({ types, id }) => {
// typeof id === 'undefined' // true
return intersection(types, typesToFilerBy).length > 0;
});
};
In the given example the getCompaniesFromFirebase() function returns an array of objects. Each object has some properties, inluding the id property that is non-enumerable.
After executing the filterCompaniesByTypes() function (which is a web worker function) I receive a filtered array. All id properties are gone.
if it's the desired behaviour (or an unpleasant, but expected, side-effect) not a bug, then it would be good to mention it in the readme.
- 主要言語
- JavaScript
- スター
- 4.4k
- フォーク
- 87
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
developit/workerize のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
-
Arrow functions オープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
developit/workerize の issue をすべて見る
似ている issue
-
awaiting triage bug Causes friction Hop Gui P1 P2 Transforms
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
georgestephanis/p2026#40 ·
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Margaret-Petersen/food-delivery-app-clone-react-native#1981 ·