adobe / adobe/react-spectrum-charts

`vega-embed` relies on `fast-json-patch` which does not get hoisted properly by `parcel`

Open
#346 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
127
Forks
29
Avg merge
7d 2h
Merged PRs (30d)
21

Description

### Provide a general summary of the issue here

`vega-embed` has a dependency on `fast-json-patch` which does not currently get hoisted correctly in `parcel`. `vega-embed` also has `vega-lite` as a required dependency which is almost a 10MB package that we never use.

### 🤔 Expected Behavior?

`react-spectrum-charts` will work in `parcel` production builds without special `package.json` setup.

### 😯 Current Behavior

`parcel` apps need to add an alias to their `package.json` that points to the `index.js` file for `fast-json-patch` instead of the `index.mjs` file.

### 💁 Possible Solution

Remove our dependency on `vega-embed` by reimplementing the necessary parts in `react-spectrum-charts`

### 🔦 Context

_No response_

### 🖥️ Steps to Reproduce

1. Create a simple parcel app
2. Add `fast-json-patch`
3. Serve with hoisting enabled

### Version

v1.10.1

### What browsers are you seeing the problem on?

Chrome

### If other, please specify.

_No response_

### What operating system are you using?

Mac OS 14.5

### 🧢 Your Company/Team

Adobe

### 🕷 Tracking Issue

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the package.json alias workaround and reproduce the issue in a simple Parcel app using the described fast-json-patch index.js versus index.mjs behavior. Review how react-spectrum-charts depends on vega-embed and identify the necessary scope for removing that dependency; done means a Parcel production build works without special package.json setup and without the unused vega-lite dependency.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
data-visualization, frontend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.