diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 514a8ae301..3e6e2480c6 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -11,13 +11,6 @@ updates: patterns: - 'react' - 'react-dom' - babel: - patterns: - - '@babel/*' - linaria: - patterns: - - '@linaria/*' - - '@wyw-in-js/*' typescript-eslint: patterns: - '@typescript-eslint/*' diff --git a/.prettierignore b/.prettierignore index 3b8c0ad9fb..2dfabd2544 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1 @@ -package.json /website/routeTree.gen.ts diff --git a/.prettierrc.json b/.prettierrc similarity index 94% rename from .prettierrc.json rename to .prettierrc index 1511954754..3ff9ca6132 100644 --- a/.prettierrc.json +++ b/.prettierrc @@ -9,7 +9,7 @@ "^react-dom", "^react", "", - "^@linaria/core$", + "^ecij$", "^clsx$", "", "./src", diff --git a/.vscode/settings.json b/.vscode/settings.json index bb939b6158..c60cc479e1 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,9 +4,6 @@ }, "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.formatOnSave": true, - "[javascript][json][jsonc][css]": { - "editor.defaultFormatter": "biomejs.biome" - }, "typescript.enablePromptUseWorkspaceTsdk": true, "typescript.tsdk": "node_modules/typescript/lib", "files.readonlyInclude": { diff --git a/babel.config.json b/babel.config.json deleted file mode 100644 index f878e8f9f9..0000000000 --- a/babel.config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@babel/typescript"] -} diff --git a/package.json b/package.json index 29c3d40f3b..91707feb5d 100644 --- a/package.json +++ b/package.json @@ -51,13 +51,11 @@ "postpublish": "git push --follow-tags origin HEAD" }, "devDependencies": { - "@babel/preset-typescript": "^7.27.1", "@biomejs/biome": "2.3.5", "@eslint-react/eslint-plugin": "^2.0.2", "@eslint/markdown": "^7.3.0", "@faker-js/faker": "^10.0.0", "@ianvs/prettier-plugin-sort-imports": "^4.6.2", - "@linaria/core": "^6.3.0", "@tanstack/react-router": "^1.132.31", "@tanstack/router-plugin": "^1.132.31", "@types/node": "^24.8.0", @@ -65,13 +63,12 @@ "@types/react-dom": "^19.2.0", "@typescript-eslint/eslint-plugin": "^8.39.1", "@typescript-eslint/parser": "^8.39.1", - "@vitejs/plugin-react": "5.0.2", + "@vitejs/plugin-react": "^5.1.1", "@vitest/browser-playwright": "^4.0.1", "@vitest/coverage-istanbul": "^4.0.1", "@vitest/eslint-plugin": "^1.3.4", - "@wyw-in-js/rollup": "^0.8.0", - "@wyw-in-js/vite": "^0.8.0", "clsx": "^2.1.1", + "ecij": "^0.1.1", "eslint": "^9.36.0", "eslint-plugin-jest-dom": "^5.5.0", "eslint-plugin-react": "^7.37.5", @@ -85,10 +82,10 @@ "prettier": "3.6.2", "react": "^19.2.0", "react-dom": "^19.2.0", - "rolldown": "^1.0.0-beta.33", - "rolldown-plugin-dts": "^0.17.1", + "rolldown": "^1.0.0-beta.50", + "rolldown-plugin-dts": "^0.17.7", "typescript": "~5.9.2", - "vite": "npm:rolldown-vite@^7.1.3", + "vite": "npm:rolldown-vite@^7.2.5", "vitest": "^4.0.1", "vitest-browser-react": "^2.0.2" }, diff --git a/rolldown.config.ts b/rolldown.config.ts index dca034dcff..d3080f556b 100644 --- a/rolldown.config.ts +++ b/rolldown.config.ts @@ -1,5 +1,5 @@ import { isAbsolute } from 'node:path'; -import wyw from '@wyw-in-js/rollup'; +import { ecij } from 'ecij/plugin'; import { defineConfig } from 'rolldown'; import { dts } from 'rolldown-plugin-dts'; @@ -10,22 +10,19 @@ export default defineConfig({ output: { dir: 'lib', cssEntryFileNames: 'styles.css', - sourcemap: true + sourcemap: true, + cleanDir: true }, platform: 'browser', external: (id) => !id.startsWith('.') && !isAbsolute(id), plugins: [ + ecij({ + // We add the package version as prefix to avoid style conflicts + // between multiple versions of RDG on the same page + classPrefix: `rdg-${pkg.version.replaceAll('.', '-')}-` + }), dts({ tsconfig: './tsconfig.lib.json' - }), - wyw({ - exclude: ['**/*.d.ts'], - preprocessor: 'none', - classNameSlug(hash) { - // We add the package version as suffix to avoid style conflicts - // between multiple versions of RDG on the same page. - return `${hash}${pkg.version.replaceAll('.', '-')}`; - } }) ] }); diff --git a/src/Cell.tsx b/src/Cell.tsx index a63e66a2a3..253d4bbd1a 100644 --- a/src/Cell.tsx +++ b/src/Cell.tsx @@ -1,5 +1,5 @@ import { memo, type MouseEvent } from 'react'; -import { css } from '@linaria/core'; +import { css } from 'ecij'; import { useRovingTabIndex } from './hooks'; import { createCellEvent, getCellClassname, getCellStyle, isCellEditableUtil } from './utils'; diff --git a/src/EditCell.tsx b/src/EditCell.tsx index 5e62f69a7b..c497929a44 100644 --- a/src/EditCell.tsx +++ b/src/EditCell.tsx @@ -1,5 +1,5 @@ import { useEffectEvent, useLayoutEffect, useRef } from 'react'; -import { css } from '@linaria/core'; +import { css } from 'ecij'; import { createCellEvent, getCellClassname, getCellStyle, onEditorNavigation } from './utils'; import type { diff --git a/src/GroupRow.tsx b/src/GroupRow.tsx index c8f2c78c16..abc356682e 100644 --- a/src/GroupRow.tsx +++ b/src/GroupRow.tsx @@ -1,5 +1,5 @@ import { memo, useMemo } from 'react'; -import { css } from '@linaria/core'; +import { css } from 'ecij'; import { RowSelectionContext, type RowSelectionContextValue } from './hooks'; import { classnames, getRowStyle } from './utils'; diff --git a/src/HeaderCell.tsx b/src/HeaderCell.tsx index b60b05e81d..8da9ed3e90 100644 --- a/src/HeaderCell.tsx +++ b/src/HeaderCell.tsx @@ -1,6 +1,6 @@ import { useRef, useState } from 'react'; import { flushSync } from 'react-dom'; -import { css } from '@linaria/core'; +import { css } from 'ecij'; import { useRovingTabIndex } from './hooks'; import { diff --git a/src/HeaderRow.tsx b/src/HeaderRow.tsx index dee50b215b..dea30c9fe9 100644 --- a/src/HeaderRow.tsx +++ b/src/HeaderRow.tsx @@ -1,5 +1,5 @@ import { memo, useState } from 'react'; -import { css } from '@linaria/core'; +import { css } from 'ecij'; import { classnames, getColSpan } from './utils'; import type { CalculatedColumn, Direction, Maybe, Position, ResizedWidth } from './types'; diff --git a/src/SummaryCell.tsx b/src/SummaryCell.tsx index 85bf7ae7f0..cb1e5fdab3 100644 --- a/src/SummaryCell.tsx +++ b/src/SummaryCell.tsx @@ -1,5 +1,5 @@ import { memo } from 'react'; -import { css } from '@linaria/core'; +import { css } from 'ecij'; import { useRovingTabIndex } from './hooks'; import { getCellClassname, getCellStyle } from './utils'; diff --git a/src/SummaryRow.tsx b/src/SummaryRow.tsx index 67d9ef1ada..3e66c2c41b 100644 --- a/src/SummaryRow.tsx +++ b/src/SummaryRow.tsx @@ -1,5 +1,5 @@ import { memo } from 'react'; -import { css } from '@linaria/core'; +import { css } from 'ecij'; import { classnames, getColSpan, getRowStyle } from './utils'; import type { RenderRowProps } from './types'; diff --git a/src/cellRenderers/renderCheckbox.tsx b/src/cellRenderers/renderCheckbox.tsx index a24ac0ebe4..9920c08157 100644 --- a/src/cellRenderers/renderCheckbox.tsx +++ b/src/cellRenderers/renderCheckbox.tsx @@ -1,4 +1,4 @@ -import { css } from '@linaria/core'; +import { css } from 'ecij'; import type { RenderCheckboxProps } from '../types'; diff --git a/src/cellRenderers/renderToggleGroup.tsx b/src/cellRenderers/renderToggleGroup.tsx index 6cafb99fbb..ba7884dd7e 100644 --- a/src/cellRenderers/renderToggleGroup.tsx +++ b/src/cellRenderers/renderToggleGroup.tsx @@ -1,4 +1,4 @@ -import { css } from '@linaria/core'; +import { css } from 'ecij'; import type { RenderGroupCellProps } from '../types'; diff --git a/src/editors/renderTextEditor.tsx b/src/editors/renderTextEditor.tsx index 784ea851da..47ccb36c0b 100644 --- a/src/editors/renderTextEditor.tsx +++ b/src/editors/renderTextEditor.tsx @@ -1,4 +1,4 @@ -import { css } from '@linaria/core'; +import { css } from 'ecij'; import type { RenderEditCellProps } from '../types'; diff --git a/src/renderHeaderCell.tsx b/src/renderHeaderCell.tsx index d7a848359d..eb14ee48f4 100644 --- a/src/renderHeaderCell.tsx +++ b/src/renderHeaderCell.tsx @@ -1,4 +1,4 @@ -import { css } from '@linaria/core'; +import { css } from 'ecij'; import type { RenderHeaderCellProps } from './types'; import { useDefaultRenderers } from './DataGridDefaultRenderersContext'; diff --git a/src/sortStatus.tsx b/src/sortStatus.tsx index 2b910b7010..752f22f576 100644 --- a/src/sortStatus.tsx +++ b/src/sortStatus.tsx @@ -1,4 +1,4 @@ -import { css } from '@linaria/core'; +import { css } from 'ecij'; import type { RenderSortIconProps, RenderSortPriorityProps, RenderSortStatusProps } from './types'; diff --git a/src/style/cell.ts b/src/style/cell.ts index 3e1db87d14..207d468f56 100644 --- a/src/style/cell.ts +++ b/src/style/cell.ts @@ -1,4 +1,4 @@ -import { css } from '@linaria/core'; +import { css } from 'ecij'; export const cell = css` @layer rdg.Cell { diff --git a/src/style/core.ts b/src/style/core.ts index ec3a0abc6b..142d4b1a4e 100644 --- a/src/style/core.ts +++ b/src/style/core.ts @@ -1,4 +1,4 @@ -import { css } from '@linaria/core'; +import { css } from 'ecij'; import { cell } from './cell'; import { bottomSummaryRowClassname, row, topSummaryRowClassname } from './row'; diff --git a/src/style/row.ts b/src/style/row.ts index 9a6d72f8e4..7c7a2687b4 100644 --- a/src/style/row.ts +++ b/src/style/row.ts @@ -1,4 +1,4 @@ -import { css } from '@linaria/core'; +import { css } from 'ecij'; export const row = css` @layer rdg.Row { diff --git a/src/utils/renderMeasuringCells.tsx b/src/utils/renderMeasuringCells.tsx index ff2b88b86a..e26a0807f5 100644 --- a/src/utils/renderMeasuringCells.tsx +++ b/src/utils/renderMeasuringCells.tsx @@ -1,4 +1,4 @@ -import { css } from '@linaria/core'; +import { css } from 'ecij'; import type { CalculatedColumn } from '../types'; diff --git a/test/browser/utils.tsx b/test/browser/utils.tsx index 3f10c007d2..46e5dd7aa3 100644 --- a/test/browser/utils.tsx +++ b/test/browser/utils.tsx @@ -1,5 +1,5 @@ import { page, userEvent, type Locator } from 'vitest/browser'; -import { css } from '@linaria/core'; +import { css } from 'ecij'; import { DataGrid } from '../../src'; import type { DataGridProps } from '../../src'; diff --git a/vite.config.ts b/vite.config.ts index 8512ec3602..fe5cffe731 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,7 +1,7 @@ import { tanstackRouter } from '@tanstack/router-plugin/vite'; import react from '@vitejs/plugin-react'; import { playwright } from '@vitest/browser-playwright'; -import wyw from '@wyw-in-js/vite'; +import { ecij } from 'ecij/plugin'; import { defineConfig, type ViteUserConfig } from 'vitest/config'; import type { BrowserCommand } from 'vitest/node'; @@ -64,7 +64,7 @@ const scrollGrid: BrowserCommand<[{ scrollLeft?: number; scrollTop?: number }]> const viewport = { width: 1920, height: 1080 } as const; export default defineConfig( - ({ command, isPreview }): ViteUserConfig => ({ + ({ isPreview }): ViteUserConfig => ({ base: '/react-data-grid/', cacheDir: '.cache/vite', clearScreen: false, @@ -76,6 +76,7 @@ export default defineConfig( cssMinify: 'esbuild' }, plugins: [ + ecij(), (!isTest || isPreview) && tanstackRouter({ target: 'react', @@ -85,12 +86,7 @@ export default defineConfig( verboseFileRoutes: false }), react({ - exclude: ['./.cache/**/*'] - }), - wyw({ - exclude: ['./.cache/**/*', '**/*.d.ts', '**/*.gen.ts'], - preprocessor: 'none', - displayName: command === 'serve' + exclude: ['./.cache/**/*', './node_modules/**/*', './website/routeTree.gen.ts'] }) ], server: { diff --git a/website/Nav.tsx b/website/Nav.tsx index 364cadef32..b1ad6508a8 100644 --- a/website/Nav.tsx +++ b/website/Nav.tsx @@ -1,6 +1,6 @@ import { useId, useState } from 'react'; import { Link } from '@tanstack/react-router'; -import { css } from '@linaria/core'; +import { css } from 'ecij'; import type { Direction } from '../src/types'; import { startViewTransition } from './utils'; diff --git a/website/components/CellExpanderFormatter.tsx b/website/components/CellExpanderFormatter.tsx index d62c015866..7d27dddfcf 100644 --- a/website/components/CellExpanderFormatter.tsx +++ b/website/components/CellExpanderFormatter.tsx @@ -1,4 +1,4 @@ -import { css } from '@linaria/core'; +import { css } from 'ecij'; const cellExpandClassname = css` block-size: 100%; diff --git a/website/components/ChildRowDeleteButton.tsx b/website/components/ChildRowDeleteButton.tsx index ac0ff36ffe..69dc6e548f 100644 --- a/website/components/ChildRowDeleteButton.tsx +++ b/website/components/ChildRowDeleteButton.tsx @@ -1,4 +1,4 @@ -import { css } from '@linaria/core'; +import { css } from 'ecij'; const childRowActionCrossClassname = css` block-size: 100%; diff --git a/website/components/DraggableCellRenderer.tsx b/website/components/DraggableCellRenderer.tsx index ab2c2535a2..80f68a735d 100644 --- a/website/components/DraggableCellRenderer.tsx +++ b/website/components/DraggableCellRenderer.tsx @@ -1,5 +1,5 @@ import { useState } from 'react'; -import { css } from '@linaria/core'; +import { css } from 'ecij'; import clsx from 'clsx'; import { Cell, type CellRendererProps } from '../../src'; diff --git a/website/routes/AllFeatures.tsx b/website/routes/AllFeatures.tsx index c5b9872ccc..a603269e59 100644 --- a/website/routes/AllFeatures.tsx +++ b/website/routes/AllFeatures.tsx @@ -1,6 +1,6 @@ import { useState } from 'react'; import { faker } from '@faker-js/faker'; -import { css } from '@linaria/core'; +import { css } from 'ecij'; import clsx from 'clsx'; import { DataGrid, renderTextEditor, SelectColumn } from '../../src'; diff --git a/website/routes/Animation.tsx b/website/routes/Animation.tsx index b40da14bfa..7532f160fa 100644 --- a/website/routes/Animation.tsx +++ b/website/routes/Animation.tsx @@ -1,5 +1,5 @@ import { useState } from 'react'; -import { css } from '@linaria/core'; +import { css } from 'ecij'; import { DataGrid, type Column } from '../../src'; import { useDirection } from '../directionContext'; diff --git a/website/routes/ColumnSpanning.tsx b/website/routes/ColumnSpanning.tsx index afd3493a8e..35339790b2 100644 --- a/website/routes/ColumnSpanning.tsx +++ b/website/routes/ColumnSpanning.tsx @@ -1,4 +1,4 @@ -import { css } from '@linaria/core'; +import { css } from 'ecij'; import { DataGrid, type Column } from '../../src'; import { renderCoordinates } from '../renderers'; diff --git a/website/routes/CommonFeatures.tsx b/website/routes/CommonFeatures.tsx index 3bf63e54ca..0d934a526c 100644 --- a/website/routes/CommonFeatures.tsx +++ b/website/routes/CommonFeatures.tsx @@ -1,7 +1,7 @@ import { useMemo, useRef, useState } from 'react'; import { createPortal, flushSync } from 'react-dom'; import { faker } from '@faker-js/faker'; -import { css } from '@linaria/core'; +import { css } from 'ecij'; import { DataGrid, diff --git a/website/routes/ContextMenu.tsx b/website/routes/ContextMenu.tsx index e1ac2b460a..58655488e1 100644 --- a/website/routes/ContextMenu.tsx +++ b/website/routes/ContextMenu.tsx @@ -1,7 +1,7 @@ import { useLayoutEffect, useReducer, useRef, useState } from 'react'; import { createPortal } from 'react-dom'; import { faker } from '@faker-js/faker'; -import { css } from '@linaria/core'; +import { css } from 'ecij'; import { DataGrid, type Column } from '../../src'; import { useDirection } from '../directionContext'; diff --git a/website/routes/CustomizableRenderers.tsx b/website/routes/CustomizableRenderers.tsx index 648c106971..ec4a2aa47d 100644 --- a/website/routes/CustomizableRenderers.tsx +++ b/website/routes/CustomizableRenderers.tsx @@ -1,5 +1,5 @@ import { useMemo, useState } from 'react'; -import { css } from '@linaria/core'; +import { css } from 'ecij'; import { Row as BaseRow, Cell, DataGrid, renderTextEditor, SelectColumn } from '../../src'; import type { diff --git a/website/routes/HeaderFilters.tsx b/website/routes/HeaderFilters.tsx index 91483680b6..f4b26fd95b 100644 --- a/website/routes/HeaderFilters.tsx +++ b/website/routes/HeaderFilters.tsx @@ -1,6 +1,6 @@ import { createContext, useContext, useMemo, useState } from 'react'; import { faker } from '@faker-js/faker'; -import { css } from '@linaria/core'; +import { css } from 'ecij'; import { DataGrid, type Column, type RenderHeaderCellProps } from '../../src'; import type { Omit } from '../../src/types'; diff --git a/website/routes/InfiniteScrolling.tsx b/website/routes/InfiniteScrolling.tsx index d3d92f9b66..2b7ec28646 100644 --- a/website/routes/InfiniteScrolling.tsx +++ b/website/routes/InfiniteScrolling.tsx @@ -1,6 +1,6 @@ import { useState } from 'react'; import { faker } from '@faker-js/faker'; -import { css } from '@linaria/core'; +import { css } from 'ecij'; import { DataGrid, type Column } from '../../src'; import { useDirection } from '../directionContext'; diff --git a/website/routes/MasterDetail.tsx b/website/routes/MasterDetail.tsx index 7075af4a42..b5d41d0945 100644 --- a/website/routes/MasterDetail.tsx +++ b/website/routes/MasterDetail.tsx @@ -1,6 +1,6 @@ import { useMemo, useState } from 'react'; import { faker } from '@faker-js/faker'; -import { css } from '@linaria/core'; +import { css } from 'ecij'; import { DataGrid, type Column, type Direction, type RowsChangeData } from '../../src'; import { CellExpanderFormatter } from '../components'; diff --git a/website/routes/NoRows.tsx b/website/routes/NoRows.tsx index 3a99463d88..ccc9c3c61c 100644 --- a/website/routes/NoRows.tsx +++ b/website/routes/NoRows.tsx @@ -1,5 +1,5 @@ import { useState } from 'react'; -import { css } from '@linaria/core'; +import { css } from 'ecij'; import { DataGrid, SelectColumn, type Column } from '../../src'; import { useDirection } from '../directionContext'; diff --git a/website/routes/RowGrouping.tsx b/website/routes/RowGrouping.tsx index 0b52a8c11b..d260902718 100644 --- a/website/routes/RowGrouping.tsx +++ b/website/routes/RowGrouping.tsx @@ -1,6 +1,6 @@ import { useState } from 'react'; import { faker } from '@faker-js/faker'; -import { css } from '@linaria/core'; +import { css } from 'ecij'; import { SelectColumn, TreeDataGrid, type Column } from '../../src'; import { useDirection } from '../directionContext'; diff --git a/website/routes/ScrollToCell.tsx b/website/routes/ScrollToCell.tsx index 506975b6e6..b442f37333 100644 --- a/website/routes/ScrollToCell.tsx +++ b/website/routes/ScrollToCell.tsx @@ -1,5 +1,5 @@ import { useRef, useState } from 'react'; -import { css } from '@linaria/core'; +import { css } from 'ecij'; import clsx from 'clsx'; import { DataGrid, type Column, type DataGridHandle } from '../../src'; diff --git a/website/routes/TreeView.tsx b/website/routes/TreeView.tsx index c22726437d..47fd20fa4d 100644 --- a/website/routes/TreeView.tsx +++ b/website/routes/TreeView.tsx @@ -1,5 +1,5 @@ import { useMemo, useReducer, useState } from 'react'; -import { css } from '@linaria/core'; +import { css } from 'ecij'; import { DataGrid, type Column } from '../../src'; import { CellExpanderFormatter, ChildRowDeleteButton } from '../components'; diff --git a/website/routes/__root.tsx b/website/routes/__root.tsx index 796e87ff3a..892d74f21b 100644 --- a/website/routes/__root.tsx +++ b/website/routes/__root.tsx @@ -1,6 +1,6 @@ import { useState } from 'react'; import { createRootRoute, Outlet } from '@tanstack/react-router'; -import { css } from '@linaria/core'; +import { css } from 'ecij'; import type { Direction } from '../../src/types'; import { DirectionContext } from '../directionContext';