You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/04/27 18:15:29 UTC

[GitHub] [incubator-superset] etr2460 opened a new pull request #9663: chore(ts): refactor and migrate StackTraceMessage to TypeScript

etr2460 opened a new pull request #9663:
URL: https://github.com/apache/incubator-superset/pull/9663


   ### CATEGORY
   
   Choose one
   
   - [ ] Bug Fix
   - [ ] Enhancement (new features, refinement)
   - [x] Refactor
   - [ ] Add tests
   - [ ] Build / Development Environment
   - [ ] Documentation
   
   ### SUMMARY
   In advance of further error message work, migrating the StackTraceMessage to TypeScript and rename it to a more clear (in my opinion) ErrorMessageWithStackTrace.
   
   Also adds a new `npm run type` command and adds it to `npm run lint` to ensure that typescript errors are caught by the linter
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <img width="325" alt="Screen Shot 2020-04-27 at 11 06 43 AM" src="https://user-images.githubusercontent.com/7409244/80405997-3c756100-8878-11ea-8f49-2b323392e42c.png">
   <img width="1095" alt="Screen Shot 2020-04-27 at 11 08 32 AM" src="https://user-images.githubusercontent.com/7409244/80405998-3da68e00-8878-11ea-80c8-d0777e2121a8.png">
   
   ### TEST PLAN
   Ensure error messages with and without stacktraces still render properly
   run `npm run lint`
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Changes UI
   - [ ] Requires DB Migration.
   - [ ] Confirm DB Migration upgrade and downgrade tested.
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   ### REVIEWERS
   to: @graceguo-supercat @rusackas @nytai 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] rusackas commented on a change in pull request #9663: chore(ts): refactor and migrate StackTraceMessage to TypeScript

Posted by GitBox <gi...@apache.org>.
rusackas commented on a change in pull request #9663:
URL: https://github.com/apache/incubator-superset/pull/9663#discussion_r416111927



##########
File path: superset-frontend/package.json
##########
@@ -10,16 +10,17 @@
   "scripts": {
     "tdd": "NODE_ENV=test jest --watch",
     "test": "NODE_ENV=test jest",
+    "type": "tsc --noEmit",
     "cover": "NODE_ENV=test jest --coverage",
     "dev": "webpack --mode=development --colors --progress --debug --watch",
     "dev-server": "NODE_ENV=development BABEL_ENV=development node --max_old_space_size=4096 ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --mode=development --progress",
     "prod": "node --max_old_space_size=4096 ./node_modules/webpack/bin/webpack.js --mode=production --colors --progress",
     "build-dev": "cross-env NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=development webpack --mode=development --colors --progress",
     "build-instrumented": "cross-env NODE_ENV=development BABEL_ENV=instrumented webpack --mode=development --colors --progress",
     "build": "cross-env NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=production webpack --mode=production --colors --progress",
-    "lint": "eslint --ignore-path=.eslintignore --ext .js,.jsx,.ts,.tsx .",
+    "lint": "eslint --ignore-path=.eslintignore --ext .js,.jsx,.ts,.tsx . && npm run type",
     "prettier-check": "prettier --check '{src,stylesheets}/**/*.{css,less,sass,scss}'",
-    "lint-fix": "eslint --fix --ignore-path=.eslintignore --ext .js,.jsx,.ts,tsx . && npm run clean-css",
+    "lint-fix": "eslint --fix --ignore-path=.eslintignore --ext .js,.jsx,.ts,tsx . && npm run clean-css && npm run type",

Review comment:
       For a brief moment, I dreamed of a world where you could `--fix` your way into TypeScript :)
   
   Thanks for adding this checking.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] etr2460 commented on a change in pull request #9663: chore(ts): refactor and migrate StackTraceMessage to TypeScript

Posted by GitBox <gi...@apache.org>.
etr2460 commented on a change in pull request #9663:
URL: https://github.com/apache/incubator-superset/pull/9663#discussion_r416114266



##########
File path: superset-frontend/src/components/ErrorMessageWithStackTrace.tsx
##########
@@ -0,0 +1,53 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import React, { useState } from 'react';
+// @ts-ignore
+import { Alert, Collapse } from 'react-bootstrap';
+
+interface Props {
+  message: string;
+  link?: string;
+  stackTrace?: string;
+}
+
+function ErrorMessageWithStackTrace({ message, link, stackTrace }: Props) {

Review comment:
       fair enough, done




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] etr2460 commented on a change in pull request #9663: chore(ts): refactor and migrate StackTraceMessage to TypeScript

Posted by GitBox <gi...@apache.org>.
etr2460 commented on a change in pull request #9663:
URL: https://github.com/apache/incubator-superset/pull/9663#discussion_r416046544



##########
File path: superset-frontend/src/components/ErrorMessageWithStackTrace.tsx
##########
@@ -0,0 +1,53 @@
+/**

Review comment:
       this file is moved from the old jsx file, major changes are making it a functional component and replacing the state object with a useState hook. Note that the old prop `showStackTrace` was unused except to initialize the state, so i removed it




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] ktmud commented on a change in pull request #9663: chore(ts): refactor and migrate StackTraceMessage to TypeScript

Posted by GitBox <gi...@apache.org>.
ktmud commented on a change in pull request #9663:
URL: https://github.com/apache/incubator-superset/pull/9663#discussion_r416099570



##########
File path: superset-frontend/src/components/ErrorMessageWithStackTrace.tsx
##########
@@ -0,0 +1,53 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import React, { useState } from 'react';
+// @ts-ignore
+import { Alert, Collapse } from 'react-bootstrap';
+
+interface Props {
+  message: string;
+  link?: string;
+  stackTrace?: string;
+}
+
+function ErrorMessageWithStackTrace({ message, link, stackTrace }: Props) {

Review comment:
       Can `expore default` here.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org