rajsite opened a new issue, #63:
URL: https://github.com/apache/arrow-js/issues/63

   ### Describe the enhancement requested
   
   Currently the apache-arrow library has circular dependencies which cause 
warnings in tools like rollup:
   
   ```
   src/example.js → dist/example.js...
   (!) Circular dependencies
   node_modules/apache-arrow/vector.mjs -> 
node_modules/apache-arrow/util/vector.mjs -> 
node_modules/apache-arrow/vector.mjs
   node_modules/apache-arrow/vector.mjs -> 
node_modules/apache-arrow/util/vector.mjs -> 
node_modules/apache-arrow/row/map.mjs -> node_modules/apache-arrow/vector.mjs
   node_modules/apache-arrow/vector.mjs -> 
node_modules/apache-arrow/util/vector.mjs -> 
node_modules/apache-arrow/row/map.mjs -> 
node_modules/apache-arrow/visitor/get.mjs -> 
node_modules/apache-arrow/vector.mjs
   ...and 10 more
   created dist/example.js in 890ms
   ```
   
   See the following stackblitz which reproduces that build warning: 
https://stackblitz.com/edit/apache-arrow-circular-dependencies?file=src%2Fexample.js
   
   It would be nice if the library was organized such that circular 
dependencies could be avoided.
   
   To workaround the warnings in rollup one can use an 
[onwarn](https://rollupjs.org/configuration-options/#onwarn) handler in the 
rollup configuration with an implementation like:
   
   ```js
   const onwarn = (warning, defaultHandler) => {
       const ignoredWarnings = [
           {
               code: 'CIRCULAR_DEPENDENCY',
               file: 'node_modules/apache-arrow'
           }
       ];
   
       if (
           !ignoredWarnings.some(
               ({ code, file }) => warning.code === code && 
warning.message.includes(file)
           )
       ) {
           defaultHandler(warning);
       }
   };
   ```
   
   ### Component(s)
   
   JavaScript


-- 
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: issues-unsubscr...@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to