Skip to content

Commit 131deae

Browse files
jassmithlukasmasuchluciacangarovaMacilBrianHung
authored
6.0.0 (#810)
Glide Data Grid 6.0.0 ## 🚨 Breaking Changes ### New dependency - canvas-hypertxt bumped to 1.0.3 - @linaria/react now added as dep (extremely tiny) ### ✌️ Farewell create react app 4 CRA 4 is no longer officially supported. While it is definitely possible to make it work, it may require extra work. CRA 5 works fine. ### 🚢 Better exports Exports for Glide Data Grid are now done in a more standard esm compliant manner. This should enable better tree shaking. ### 🧼 Cell API cleanup Some cells have had minor tweaks to their API to bring them in line with standard conventions. The `ImageCell` and all the cells in the `cells` package now uses the standard `readonly` flag. ### 👋 Minimap removed The minimap was awesome, and largely unused. It has been removed from this version of Glide Data Grid in the service of smaller packages and a more maintainable surface area. We appreciate your service 🫡 ### 🎨 `drawCell` callback improved. The drawCell callback now receives a callback argument which paints the standard cell. This allows dramatically more flexibility with custom under and overdrawing of cells. It is also now a void method eliminating a source of confusion. ```typescript const drawCell: DrawCellCallback = React.useCallback( (args, draw) => { // Draw something below the cell drawing draw() // Draw something on top of the cell drawing }, []) ``` ## 🎉 New Features ### 💪 Kinetic super scroll on iOS Are you the one person presenting data grids to your mobile users? This feature is for you. GDG will now artificially boost the framerate during kinetic scroll on iOS to maintain a smooth experience. This is still experimental, but if feedback goes well we intend to promote this to stable. ```tsx return ( <DataEditor {...otherProps} experimental={{ kineticScrollPerfHack: true, }} /> ); ``` ### 🏁 Performance improvements when updating lots of data at once Damage rendering now is 2x faster than the 5.0 series. This is enabled by reducing the amount of clipping during a damage pass. This improvement is what has made the DOOM easter egg on the main site possible. The easter egg may also be the reason for the improvement... <img width="1151" alt="CleanShot 2024-01-10 at 22 43 12@2x" src="https://github.com/glideapps/glide-data-grid/assets/30443/33041725-7398-4c49-9ef1-c199482eb93c"> ### 🌐 UriCell improvements ![CleanShot 2024-01-10 at 22 41 10@2x](https://github.com/glideapps/glide-data-grid/assets/30443/18df5dc5-5a93-46bd-8059-c0cdcb5cfe9c) The URI cell supports drawing an underscore on hovering a URI value via the `hoverEffect` property. It also supports click events (e.g., to open the URL) via the `onUriClick` property and uses the `displayData` within the cell rendering. ### ⚽️ Add support for rounding radius in the theme ![image](https://github.com/glideapps/glide-data-grid/assets/2852129/41205ff9-db9b-44ef-8a97-e59e826438bc) Configure the rounding radii of checkboxes, bubbles, skeletons, images, buttons, and other rounded elements via the optional `roundingRadius` theming property. ### 🤕 Header menu icons can now be configured ![image](https://github.com/glideapps/glide-data-grid/assets/2852129/974148aa-91e2-449d-9ed0-55a5940b60c4) Customize the header menu icon via the `menuIcon` property in `GridColumn`. It supports `triangle` for the default menu icon, `dots` for the three-dots menu icon, or a key of one of the icons passed to the `headerIcons` prop. ### 📈 Sparkline cell now supports even more charts <img width="473" alt="CleanShot 2024-01-10 at 22 37 25@2x" src="https://github.com/glideapps/glide-data-grid/assets/30443/f88fe87c-833d-450b-8468-be52faba605d"> The `line` graphKind got renamed to `area`. The new `line` chart now renders just a simple line chart. Additionally, the x-axis can be hidden via `hideAxis`. ### 🥶 Freeze trailing rows <img width="600" alt="CleanShot 2024-01-10 at 22 36 58@2x" src="https://github.com/glideapps/glide-data-grid/assets/30443/58b2603c-9113-44b2-9ab1-c79135e50cb9"> Get going by specifying the number of freeze trailing rows you want. ```tsx return ( <DataEditor {...otherProps} freezeTrailingRows={2} /> ); ``` ### 💀 LoadingCell skeletons <img width="510" alt="CleanShot 2024-01-10 at 22 34 25@2x" src="https://github.com/glideapps/glide-data-grid/assets/30443/aac2ed4b-f1f4-44e6-b758-f30caf871f5f"> The loading cell can be configured to show skeletons when `skeletonWidth` is set to a value > 0. The height can be configured via the optional `skeletonHeight` property, and it also supports a randomized variability applied to the width via `skeletonWidthVariability.` ### ⌨️ Fully remappable keybindings Keybindings can now be remapped instead of just turned off and on. More details [here](https://docs.grid.glideapps.com/api/dataeditor/input-interaction#keybindings). ### 🪤 Focus trapping There is now a `trapFocus` prop that will cause the grid to prevent focus leaving the grid during caret browsing or pressing tab. ### 🙅‍♀️ Prevent column reordering Reordering of columns can now be prevented as new column locations are proposed using the new `onColumnProposeMove` callback. This allows for greater control over where users are allowed to drag columns. ### 💾 Copy and paste methods now available The copy and paste functionality of the data grid is now exposed for direct usage by developers. ### 🌲 Tree view cell <img width="213" alt="image" src="https://github.com/glideapps/glide-data-grid/assets/2852129/258aabf8-b7ee-4dfb-842d-01e257e4b84a"> This cell represents the basic building block required to make collapsable and groupable rows. We will continue to improve support for row grouping in the rest of the 6.0.0 series. ### ⬇️ Dropdown cell improvements Allow specifying label and value independently in dropdown cell and some other visual improvements. ## 🚀 Improvements ### 💍 Improved drawing of highlight and selection rings When the selection ring or a highlight ring is at the right or bottom edge of the grid it will no longer be clipped out. ### 🦏 Safari performance improvements Safari now renders around 2 to 5 times faster on mobile devices. Less hitching, better grids, papa johns. ### 🔦 Large highlight region support Prior to 6.0.0 large highlight regions could cause excessively slow drawing performance. This is no longer a problem. ### 🔍 Search no longer renders eagerly Don't use the search? No problem. You no longer pay the penalty for something you don't need. ### 🏁 Mouse hover render reduction Hovering with the mouse no longer results in excessive react rendering. ### 👓 Hover interactions now can discern blank spots of grid from outside of grid More details here: #811 ### ↔️ Resize column indicator <img width="439" alt="image" src="https://github.com/glideapps/glide-data-grid/assets/2852129/b87ac8cb-9699-40f1-8816-d6c4e9bd0d17"> There is a new column resize indicator. It can be configured via the `resizeIndicatorColor` theme property. ### ☕️ Fill handle improvements - Controllable selection behavior - FillPattern support - Larger fill handle click region - New visual representation ![CleanShot 2024-01-10 at 23 10 57@2x](https://github.com/glideapps/glide-data-grid/assets/30443/3b76efbc-d0c0-4bb2-aa27-880f4315f3df) ### 🔲 Get the bounds of the entire scroll area If `getBounds` get called with `col` and `row` as undefined, the bounding box of the entire data grid scroll area is returned. ## 🔚 Odds and ends - GDG now prefixes most of the css classes it uses to avoid conflicting with commonly used names. - Page up and down keybindings are now on by default ## 🐞 Bug Fixes - `onDelete` now properly called when doing a cut operation. - Fixed a crasher caused by attemping to draw negative radius arcs. - Fix a bug where `getBounds` would compute for the wrong cell. - Fixed multiple bugs where strict mode would be violated - Horizontally center bubble cell editor to align with cell rendering. - Fix copy escaping for array values. - Fix issues with paste logic. - Fix text cell editor color in Safari. - Fix jittering issue with grow columns. - Use the configured padding for measuring of number, row-id, dropdown and date-picker cells. - Fix sparkline chart error related to arrays with less than 3 values. Co-authored-by: Lukas Masuch <[email protected]> Co-authored-by: luciacangarova <[email protected]> Co-authored-by: Chris Cowan <[email protected]> Co-authored-by: Brian Hung <[email protected]>
1 parent 3068d54 commit 131deae

File tree

296 files changed

+30741
-81488
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

296 files changed

+30741
-81488
lines changed

.github/workflows/beta.js.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: actions/checkout@v1
19-
- uses: actions/setup-node@v1
19+
- uses: actions/setup-node@v4
2020
with:
21-
node-version: 16
21+
node-version: 20.10.0
2222
- name: Build
2323
run: npm install && npm run build
2424
working-directory: .
@@ -35,9 +35,9 @@ jobs:
3535
runs-on: ubuntu-latest
3636
steps:
3737
- uses: actions/checkout@v1
38-
- uses: actions/setup-node@v1
38+
- uses: actions/setup-node@v4
3939
with:
40-
node-version: 16
40+
node-version: 20.10.0
4141
- name: Build
4242
run: npm install && npm run build
4343
working-directory: .
@@ -56,7 +56,7 @@ jobs:
5656
- uses: actions/checkout@v1
5757
- uses: actions/setup-node@v1
5858
with:
59-
node-version: 16
59+
node-version: 20.10.0
6060
- name: Bootstrap
6161
run: npm install && npm run build
6262
working-directory: .

.github/workflows/node.js.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v2
13-
- name: Use Node.js 16
14-
uses: actions/setup-node@v1
13+
- name: Use Node.js 20
14+
uses: actions/setup-node@v4
1515
with:
16-
node-version: 16
16+
node-version: 20.10.0
1717
- run: npm install
1818
- run: npm run build
1919
- run: npm run test -- --coverage
@@ -30,8 +30,8 @@ jobs:
3030
runs-on: ubuntu-latest
3131
steps:
3232
- uses: actions/checkout@v1
33-
- uses: actions/setup-node@v1
33+
- uses: actions/setup-node@v4
3434
with:
35-
node-version: 16
35+
node-version: 20.10.0
3636
- run: npm install
3737
- run: npm run test-18

.github/workflows/release.js.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- uses: actions/checkout@v1
20-
- uses: actions/setup-node@v1
20+
- uses: actions/setup-node@v4
2121
with:
22-
node-version: 16
22+
node-version: 20.10.0
2323
- name: Bootstrap
2424
run: npm install && npm run build
2525
working-directory: .
@@ -35,9 +35,9 @@ jobs:
3535
runs-on: ubuntu-latest
3636
steps:
3737
- uses: actions/checkout@v1
38-
- uses: actions/setup-node@v1
38+
- uses: actions/setup-node@v4
3939
with:
40-
node-version: 16
40+
node-version: 20.10.0
4141
- name: Bootstrap
4242
run: npm install && npm run build
4343
working-directory: .
@@ -53,9 +53,9 @@ jobs:
5353
runs-on: ubuntu-latest
5454
steps:
5555
- uses: actions/checkout@v1
56-
- uses: actions/setup-node@v1
56+
- uses: actions/setup-node@v4
5757
with:
58-
node-version: 16
58+
node-version: 20.10.0
5959
- name: Bootstrap
6060
run: npm install && npm run build
6161
working-directory: .

.github/workflows/storybook.js.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ jobs:
1111
uses: actions/[email protected]
1212
with:
1313
persist-credentials: false
14-
- uses: actions/setup-node@v1
14+
- uses: actions/setup-node@v4
1515
with:
16-
node-version: 16
16+
node-version: 20.10.0
1717
- name: Install and Build 🔧
1818
run: |
1919
npm install

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ node_modules*
77
pubsub-debug.log
88
storybook-build/
99
coverage/
10-
*.tsbuildinfo
10+
*.tsbuildinfo
11+
gen-docs/

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v16.16.0
1+
v20.10.0

.storybook/.babelrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
],
1919
"@babel/preset-react",
2020
"@babel/preset-typescript",
21-
"@linaria/babel-preset"
21+
"@linaria"
2222
],
2323
"plugins": ["@babel/plugin-proposal-class-properties"]
2424
}

.storybook/main.js

+20-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1+
const { dirname, join } = require("path");
12
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
3+
const ResolveTypeScriptPlugin = require("resolve-typescript-plugin");
24

35
module.exports = {
46
stories: ["../**/src/**/*.stories.tsx"],
5-
addons: ["@storybook/addon-storysource", "@storybook/addon-controls"],
6-
core: {
7-
builder: "webpack5",
8-
},
7+
addons: ["@storybook/addon-storysource", getAbsolutePath("@storybook/addon-controls")],
8+
99
typescript: {
1010
reactDocgen: false,
1111
},
12+
1213
webpackFinal: async (config, { configType }) => {
1314
// `configType` has a value of 'DEVELOPMENT' or 'PRODUCTION'
1415
// You can change the configuration based on that.
@@ -32,7 +33,22 @@ module.exports = {
3233
});
3334

3435
config.optimization.minimize = false;
36+
config.devtool = "source-map";
37+
config.resolve.plugins = [new ResolveTypeScriptPlugin()];
3538

3639
return config;
3740
},
41+
42+
framework: {
43+
name: getAbsolutePath("@storybook/react-webpack5"),
44+
options: {},
45+
},
46+
47+
docs: {
48+
autodocs: false,
49+
},
3850
};
51+
52+
function getAbsolutePath(value) {
53+
return dirname(require.resolve(join(value, "package.json")));
54+
}

.storybook/manager.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { addons } from "@storybook/addons";
2-
import { themes, create } from "@storybook/theming";
2+
import { create } from "@storybook/theming";
33

44
const glideTheme = create({
55
base: "dark",

.storybook/preview.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import { addParameters } from "@storybook/react";
2-
3-
addParameters({
4-
options: {
5-
showRoots: true,
6-
storySort: (a, b) => {
7-
return a[1].name.localeCompare(b[1].name, undefined, { numeric: true });
1+
const preview = {
2+
parameters: {
3+
layout: "fullscreen",
4+
options: {
5+
storySort: {
6+
method: "alphabetical",
7+
order: ["Glide-Data-Grid", "Extra Packages", "Subcomponents"],
8+
locales: "en-US",
9+
},
810
},
911
},
10-
});
11-
12-
export const parameters = {
13-
layout: "fullscreen",
1412
};
13+
14+
export default preview;

.vscode/launch.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"type": "msedge",
6+
"request": "launch",
7+
"name": "Launch Glide Data Grid",
8+
"url": "http://localhost:9009",
9+
"webRoot": "${workspaceRoot}/",
10+
"preLaunchTask": "npm: start",
11+
"sourceMaps": true
12+
}
13+
]
14+
}

.vscode/tasks.json

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "npm: start",
6+
"type": "npm",
7+
"script": "start",
8+
"isBackground": true,
9+
10+
"problemMatcher": {
11+
"pattern": {
12+
"regexp": ".*"
13+
},
14+
"background": {
15+
"activeOnStart": true,
16+
"beginsPattern": "^.*Starting Storybook.*$", // Adjust if there's a more specific start message
17+
"endsPattern": "^.*Storybook \\d+.\\d+.\\d+ for react-webpack5 started.*$"
18+
}
19+
},
20+
"group": {
21+
"kind": "build",
22+
"isDefault": true
23+
},
24+
"presentation": {
25+
"reveal": "always",
26+
"panel": "new"
27+
}
28+
}
29+
]
30+
}

babel.cjs.json

-24
This file was deleted.

config/build-util.sh

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
run_in_parallel() {
2+
local funcs=("$@")
3+
local pids=()
4+
5+
# Start the functions in the background and store their PIDs
6+
for func in "${funcs[@]}"; do
7+
($func) &
8+
pids+=($!)
9+
done
10+
11+
# Wait for all functions and exit if any of them fail
12+
for pid in "${pids[@]}"; do
13+
wait $pid || exit $?
14+
done
15+
}
16+
17+
generate_index_css() {
18+
echo "/* Auto-generated file */" > dist/index.css
19+
find dist/esm -name '*.css' -print | sed 's/^dist\/esm\//\@import ".\/esm\//' | sed 's/$/";/' >> dist/index.css
20+
}
21+
22+
ensure_bash_4() {
23+
if [ "${BASH_VERSINFO[0]}" -lt 4 ]; then
24+
if [ -x "/opt/homebrew/bin/bash" ]; then
25+
exec /opt/homebrew/bin/bash "$0" "$@"
26+
elif [ -x "/usr/local/bin/bash" ]; then
27+
exec /usr/local/bin/bash "$0" "$@"
28+
else
29+
echo "Bash 4 or higher is required."
30+
exit 1
31+
fi
32+
fi
33+
}
34+
35+
remove_all_css_imports() {
36+
local directory=$1
37+
local sed_cmd="sed -i"
38+
39+
# Check if sed is GNU sed or BSD sed
40+
if sed --version 2>/dev/null | grep -q GNU; then
41+
sed_cmd="sed -i" # GNU sed
42+
else
43+
sed_cmd="sed -i ''" # BSD sed
44+
fi
45+
46+
find "$directory" -type f -name "*.js" -exec bash -c "$sed_cmd \"/require('.\/.*\.css');/d\" {}" \;
47+
find "$directory" -type f -name "*.js" -exec bash -c "$sed_cmd \"/import \\\".*\.css\\\";/d\" {}" \;
48+
}

config/linaria.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"classNameSlug": "gdg-[hash]"
3+
}

0 commit comments

Comments
 (0)