Skip to content

Commit

Permalink
[ui] Fix up React imports
Browse files Browse the repository at this point in the history
  • Loading branch information
hellendag committed Jan 18, 2024
1 parent b4ec0b4 commit 37e3567
Show file tree
Hide file tree
Showing 545 changed files with 1,286 additions and 1,549 deletions.
1 change: 0 additions & 1 deletion js_modules/dagster-ui/packages/app-oss/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {UserSettingsButton} from '@dagster-io/ui-core/app/UserSettingsButton';
import {logLink, timeStartLink} from '@dagster-io/ui-core/app/apolloLinks';
import {LiveDataPollRateContext} from '@dagster-io/ui-core/asset-data/AssetLiveDataProvider';
import {DeploymentStatusType} from '@dagster-io/ui-core/instance/DeploymentStatusProvider';
import React from 'react';

import {CommunityNux} from './NUX/CommunityNux';
import {extractInitializationData} from './extractInitializationData';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
TextInput,
} from '@dagster-io/ui-components';
import {useStateWithStorage} from '@dagster-io/ui-core/hooks/useStateWithStorage';
import React from 'react';
import * as React from 'react';
import isEmail from 'validator/lib/isEmail';

export const CommunityNux = () => {
Expand Down
1 change: 0 additions & 1 deletion js_modules/dagster-ui/packages/app-oss/src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {AppProps} from 'next/app';
import Head from 'next/head';
import React from 'react';

// eslint-disable-next-line import/no-default-export
export default function MyApp({Component, pageProps}: AppProps) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import fs from 'fs';
import path from 'path';

import {Head, Html, Main, NextScript} from 'next/document';
import React from 'react';

function getSecurityPolicy() {
return fs.readFileSync(path.join(__dirname, '../../../csp-header-dev.txt'), {encoding: 'utf8'});
Expand Down
4 changes: 2 additions & 2 deletions js_modules/dagster-ui/packages/app-oss/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import dynamic from 'next/dynamic';
import {useRouter} from 'next/router';
import React from 'react';
import {useEffect} from 'react';

const App = dynamic(() => import('../App'), {
ssr: false,
Expand All @@ -12,7 +12,7 @@ const App = dynamic(() => import('../App'), {
export default function IndexPage() {
const router = useRouter();

React.useEffect(() => {
useEffect(() => {
router.beforePopState(() => {
// Disable Next.js client side routing until we migrate to Next.js routing
return false;
Expand Down
2 changes: 2 additions & 0 deletions js_modules/dagster-ui/packages/eslint-config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,11 @@ module.exports = {
'object-shorthand': ['error', 'always'],
'react/jsx-curly-brace-presence': 'error',
'react/jsx-no-target-blank': 'error',
'react/jsx-uses-react': 'off',
'react/prefer-stateless-function': 'error',
'react/prop-types': 'off',
'react/display-name': 'off',
'react/react-in-jsx-scope': 'off',
'@typescript-eslint/ban-types': [
'error',
{
Expand Down
5 changes: 3 additions & 2 deletions js_modules/dagster-ui/packages/ui-components/.babelrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"presets": [
[
"@babel/preset-env", {
"@babel/preset-env",
{
"useBuiltIns": "entry",
"corejs": 3
}
],
"@babel/preset-react",
["@babel/preset-react", {"runtime": "automatic"}],
"@babel/preset-typescript"
],
"plugins": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
} from '../src';

import {MemoryRouter} from 'react-router-dom';
import * as React from 'react';

import {createGlobalStyle} from 'styled-components/macro';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as React from 'react';
import styled, {css} from 'styled-components';

import {Box} from './Box';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import * as React from 'react';

import {Button} from './Button';
import {ConfigEditorWithSchema} from './ConfigEditorWithSchema';
import {Dialog, DialogFooter} from './Dialog';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import {useRef, useState} from 'react';
import {createGlobalStyle} from 'styled-components';

import {Box} from './Box';
Expand Down Expand Up @@ -32,11 +32,9 @@ export const ConfigEditorWithSchema = ({
onConfigChange,
configSchema,
}: Props) => {
const editorSplitPanelContainer = React.useRef<SplitPanelContainer | null>(null);
const [editorHelpContext, setEditorHelpContext] = React.useState<ConfigEditorHelpContext | null>(
null,
);
const editor = React.useRef<ConfigEditorHandle | null>(null);
const editorSplitPanelContainer = useRef<SplitPanelContainer | null>(null);
const [editorHelpContext, setEditorHelpContext] = useState<ConfigEditorHelpContext | null>(null);
const editor = useRef<ConfigEditorHandle | null>(null);

return (
<>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as React from 'react';
import styled from 'styled-components';

import {Button} from './Button';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React from 'react';
import {useEffect, useState} from 'react';
import styled from 'styled-components';

import {Colors} from './Color';

export const CustomTooltipProvider = () => {
const [state, setState] = React.useState<null | {
const [state, setState] = useState<null | {
title: string;
style: React.CSSProperties;
}>(null);

React.useEffect(() => {
useEffect(() => {
document.addEventListener('mouseover', (ev) => {
const el = ev.target;
if (!(el instanceof Element)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
import styled from 'styled-components';

import {Box} from './Box';
Expand Down
Loading

0 comments on commit 37e3567

Please sign in to comment.