Skip to content

Commit

Permalink
React 18 (#245)
Browse files Browse the repository at this point in the history
* Update to React 18

* Malloy 0.0.214

* Fix typing
  • Loading branch information
whscullin authored Nov 14, 2024
1 parent 3465577 commit bc00f39
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 127 deletions.
181 changes: 77 additions & 104 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@
"malloy-packages": "./scripts/malloy-packages.ts"
},
"dependencies": {
"@malloydata/db-bigquery": "0.0.209",
"@malloydata/db-duckdb": "0.0.209",
"@malloydata/db-postgres": "0.0.209",
"@malloydata/malloy": "0.0.209",
"@malloydata/db-bigquery": "0.0.214",
"@malloydata/db-duckdb": "0.0.214",
"@malloydata/db-postgres": "0.0.214",
"@malloydata/malloy": "0.0.214",
"@malloydata/query-composer": "*",
"@malloydata/render": "0.0.209",
"@malloydata/render": "0.0.214",
"@popperjs/core": "^2.11.4",
"cors": "^2.8.5",
"duckdb": "^0.9.2",
"express": "^4.21.1",
"mdast-comment-marker": "^2.1.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hotkeys": "^2.0.0",
"react-query": "^3.34.16",
"react-router-dom": "^6.4.3",
Expand All @@ -65,8 +65,8 @@
"@types/jest": "^29.5.13",
"@types/node": "^18.11.11",
"@types/node-fetch": "^2.6.2",
"@types/react": "^17.0.38",
"@types/react-dom": "^17.0.11",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/styled-components": "^5.1.19",
"@types/tar-stream": "^2.2.2",
"@typescript-eslint/eslint-plugin": "v6.21.0",
Expand Down
5 changes: 3 additions & 2 deletions packages/query-composer/example/example.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {useState} from 'react';
import ReactDOM from 'react-dom';
import {createRoot} from 'react-dom/client';
import {ExploreQueryEditor, useQueryBuilder, useRunQuery} from '../src/index';

import {model as exampleModel, modelPath, topValues} from './example_model';
Expand Down Expand Up @@ -101,4 +101,5 @@ const GlobalStyle = createGlobalStyle`
}
`;

ReactDOM.render(<App />, document.getElementById('app'));
const root = createRoot(document.getElementById('app')!);
root.render(<App />);
10 changes: 5 additions & 5 deletions packages/query-composer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@malloydata/query-composer",
"version": "0.0.209",
"version": "0.0.214",
"description": "A query composer component for Malloy",
"main": "dist/cjs/index.cjs",
"type": "module",
Expand Down Expand Up @@ -37,8 +37,8 @@
},
"devDependencies": {
"@types/moment": "^2.13.0",
"@types/react": "^17.0.39",
"@types/react-dom": "^17.0.25",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.1",
"jest": "^29.3.1",
"ts-jest": "^29.0.5",
Expand All @@ -49,8 +49,8 @@
"peerDependencies": {
"@malloydata/malloy": ">=0.0.209",
"@malloydata/render": ">=0.0.209",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react": ">=18",
"react-dom": ">=18",
"styled-components": "^5.3.3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const GroupByContextBar: React.FC<GroupByContextBarProps> = ({
const [searchTerm, setSearchTerm] = useState('');

const maybeSelectField = useCallback(
(path, field) => {
(path: string, field: FieldDef) => {
if (field.type === 'date') {
setSelectingGranularity({field, path});
} else if (field.type === 'timestamp') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const SelectContextBar: React.FC<SelectContextBarProps> = ({
const [searchTerm, setSearchTerm] = useState('');

const maybeSelectField = useCallback(
(path, field) => {
(path: string, field: FieldDef) => {
if (field.type === 'date') {
setSelectingGranularity({field, path});
} else if (field.type === 'timestamp') {
Expand Down
3 changes: 2 additions & 1 deletion src/core/markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ export interface ListItem {

export interface Table {
type: 'table';
align: ('left' | 'right' | 'center' | null)[];
align: ('left' | 'right' | 'center' | undefined) &
('left' | 'right' | 'center' | null)[];
children: Markdown[];
}

Expand Down
8 changes: 4 additions & 4 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/

import React from 'react';
import ReactDOM from 'react-dom';
import {createRoot} from 'react-dom/client';
import './index.css';
import reportWebVitals from './reportWebVitals';
import {QueryClient, QueryClientProvider} from 'react-query';
Expand All @@ -45,13 +45,13 @@ const router = createHashRouter([
},
]);

ReactDOM.render(
const root = createRoot(document.getElementById('root')!);
root.render(
<React.StrictMode>
<QueryClientProvider client={client}>
<RouterProvider router={router} />
</QueryClientProvider>
</React.StrictMode>,
document.getElementById('root')
</React.StrictMode>
);

// If you want to start measuring performance in your app, pass a function
Expand Down

0 comments on commit bc00f39

Please sign in to comment.