[JS] Avoid circular dependencies in apache-arrow
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Refactor
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript, rollup, typescript
- Domain
- build-system, tooling
Research direction
Start with the StackBlitz reproduction and trace the reported cycles through node_modules/apache-arrow/vector.mjs, util/vector.mjs, row/map.mjs, and visitor/get.mjs. Confirm the warning in Rollup, then reorganize the dependencies so the reproduction completes without circular-dependency warnings.
Written by the indexing model from the issue text.
Description
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 handler in the rollup configuration with an implementation like:
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
- Dominant language
- TypeScript
- Stars
- 112
- Forks
- 23
- Avg merge
- 17h 55m
- Merged PRs (30d)
- 10
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/arrow-js
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 50/100
Similar issues
-
blocklist removal
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
MetaMask/eth-phishing-detect#296544 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
pastelsky/bundlephobia#1122 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
category/development priority/P2 scope/file-operations scope/testing type/enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100