javandres opened a new pull request, #541:
URL: https://github.com/apache/arrow-js/pull/541

   ## What's Changed
   
   `Vector` now looks up its get/set/indexOf visitor functions and builds its 
per-type chunked prototypes the first time a vector of each type is made, 
rather than in its static initializer. A bundle that reaches `vector` through a 
visitor (`import { StructRow } from 'apache-arrow'` under webpack) no longer 
reads a visitor before that visitor is initialized. The tables are still built 
once per type; the constructor's added cost is one property read per vector.
   
   `test/bundle/structRow.js` imports `StructRow` on its own. The webpack 
bundle task now writes one bundle per test file, as the esbuild and rollup 
tasks already do. In the single merged bundle it wrote before, the earlier 
files loaded `vector` first and hid the problem.
   
   Checked:
   - `npm run build -- -t apache-arrow` then `gulp bundle`: on `main` the new 
webpack `structRow` bundle fails with `ReferenceError: Cannot access '…' before 
initialization`; with this change all 30 bundles run (10 files × esbuild, 
rollup, webpack).
   - Each of the 165 exports of the published 21.2.0 bundled alone with webpack 
(production): `StructRow` is the only one that fails, and none fail with the 
same change applied to its `vector.mjs`.
   - `npm run lint:ci`.
   - Unit tests against the `apache-arrow` target (`jest -c 
jestconfigs/jest.apache-arrow.config.js`): 50 suites, 7047 tests pass.
   
   Closes #540.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to