-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
updated version of the sandbox #1818
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really cool 🤩
Very simple and fast to create new examples. Great work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add something about how to test using the production (minified) version of the library?
Since we use the following in our library package:
"exports": {
"./package.json": "./package.json",
".": {
"development": {
"types": "./dist/typings.d.ts",
"import": "./dist/lightweight-charts.development.mjs"
},
"production": {
"types": "./dist/typings.d.ts",
"import": "./dist/lightweight-charts.production.mjs"
},
"default": {
"types": "./dist/typings.d.ts",
"import": "./dist/lightweight-charts.production.mjs"
}
}
},
It means all that we need to do to tell vite to use the production version is to set the NODE_ENV
to production
.
So if I want to run my playground with the production then I just do this:
NODE_ENV=production npm run serve my-playground
import { | ||
AreaSeries, | ||
CandlestickSeries, | ||
createChart, | ||
} from "lightweight-charts"; | ||
|
||
const chartOptions = { | ||
layout: { | ||
textColor: "black", | ||
background: { | ||
type: "solid", | ||
color: "white", | ||
}, | ||
}, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got a typescript warning when I opened the file in my playground.
Lets add some types to make TS happy.
import { | |
AreaSeries, | |
CandlestickSeries, | |
createChart, | |
} from "lightweight-charts"; | |
const chartOptions = { | |
layout: { | |
textColor: "black", | |
background: { | |
type: "solid", | |
color: "white", | |
}, | |
}, | |
}; | |
import { | |
AreaSeries, | |
CandlestickSeries, | |
ChartOptions, | |
ColorType, | |
createChart, | |
DeepPartial, | |
} from "lightweight-charts"; | |
const chartOptions = { | |
layout: { | |
textColor: "black", | |
background: { | |
type: ColorType.Solid, | |
color: "white", | |
}, | |
}, | |
} satisfies DeepPartial<ChartOptions>; |
This PR replaces existing
/debug
folder with alternative version for more convenient and streamlined experimentation with lightweight-charts.The main difference with my first attempt is focus on simplicity, ability to have unlimited amount of sandboxes.
Performance considerations was also taken into account and every sandbox is sharing the same common root
/debug/playground
and their packages. Any dependency managed under sandbox would happen under common root.