Comments (11)
Good catch. Can you send a pull request to add it?
from react-vega.
Sure, if the manual addition to package.json is the way to handle it. That would be about the only way at the moment I know how to resolve it ;)
from react-vega.
Hmm, I just checked and saw that React depends on prop types. Not sure how it would be missing if you have react:
Line 13369 in 0b1aef3
Since react is a peer dependency, I don't think we need to add this, do we?
from react-vega.
React seems to have it as dev-dependency, and npm install
doesn't pull it. My package-lock.json for react:
"node_modules/react": {
"version": "17.0.2",
"resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz",
"integrity": "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==",
"dependencies": {
"loose-envify": "^1.1.0",
"object-assign": "^4.1.1"
},
"engines": {
"node": ">=0.10.0"
}
},
from react-vega.
Ohh, I see. I still wonder where prop-types
is added since it's nowhere in the code. Can you see where it comes from?
from react-vega.
I tried looking a bit further, but can't get a handle on it. Nimbus seems very sparsely documented. And the lib/Vega.js has _interopRequireDefault(require("prop-types"))
which seems to be some babel internal magic, also not really useful avenue. To add to the insult, the built Vega.js files (esm or lib) don't even use the import/var, though VegaEmbed at least calls to it (in the built version, not in the source). No idea if that means that the imports still do some kind of side effects.
from react-vega.
I'd be inclined not to add the dependency until we understand the issue.
from react-vega.
Also hit this issue. Had to manually add "prop-types" and also "process" and "buffer" as dependencies.
from react-vega.
@aiba Seems to caused by babel-plugin-typescript-to-proptypes
that add prop-types
during transpile time. Let me investigate.
Update 1:
TypeScript may display an error message if an incorrect prop type is passed to the component, but if you are integrating with an external API or using an external library that does not have typings, you can not be 100% sure that you will always get the right data.
That's when PropTypes become useful - they display a warning in the console when unexpected data ends up in your component, making it much easier to debug where exactly an error is.
Seems like we should keep it and I can add prop-types
to dependencies.
Update 2:
Wonder where process
and buffer
are from. I don't see them.
from react-vega.
Please try [email protected]
from react-vega.
With 7.5.1, still getting a missing dep on buffer, but perhaps this is a vega-loader issue?
logs/client-dev.log: The required JS dependency "buffer" is not available, it was required by "node_modules/vega-loader/build/vega-loader.browser.js".
logs/client-dev.log: Dependency Trace:
logs/client-dev.log: node_modules/react-vega/lib/index.js
logs/client-dev.log: node_modules/react-vega/lib/Vega.js
logs/client-dev.log: node_modules/react-vega/lib/utils/updateMultipleDatasetsInView.js
logs/client-dev.log: node_modules/react-vega/lib/utils/updateSingleDatasetInView.js
logs/client-dev.log: node_modules/vega-embed/build/vega-embed.js
logs/client-dev.log: node_modules/vega/build/vega-node.js
logs/client-dev.log: node_modules/vega-dataflow/build/vega-dataflow.js
logs/client-dev.log: node_modules/vega-loader/build/vega-loader.browser.js
from react-vega.
Related Issues (20)
- Memory leak when using `onNewView`. HOT 2
- Type errors in demo code
- Infinite requests when the loader prop is passed
- Unable to highlight the vega chart from outside vega component
- Out of date CHANGELOG.md HOT 1
- Replace travis with GitHub actions HOT 2
- Dark theme does not pass on to signals or text marks HOT 1
- Unable to embed vega-lite visualization in react HOT 2
- When will react-vega migrate to react 18 HOT 2
- Re-rendering with className causes react-embed to lose styling
- Approach#1 in your documentation is not working HOT 5
- Setting height to "container" (i.e. responsive sizing) does not work as expected HOT 1
- Support for newer typescript version
- Generated Charts passing in data as an attribute messes up title ... extra space at top - pie chart
- Will the VegaLite component re-render on spec change? HOT 1
- Is it possible to use [email protected] with react native?
- [Security issue] - CVE-2022-25883-semver HOT 1
- Provide a more beginner-friendly documentation
- [Question] Does it support server side rendering?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-vega.