From 5017bf1c084a949dbf921e9f71c3af2ce988cf3b Mon Sep 17 00:00:00 2001 From: Marius Andra Date: Mon, 31 May 2021 19:13:50 +0200 Subject: [PATCH] Fix deduplicated SCSS issue (#4545) * Revert "Hotfix SCSS for trend graphs (#4539)" This reverts commit 545dc62ec692c46221fb19c56b5efb2ee0755dd2. * Revert "Move history import to globals (#4531)" This reverts commit 542be620530e21bd17cf2163442fb2b946322026. * Revert "@ import all scss in lib/components (#4530)" This reverts commit 5e2a3290dade9fc98e8b84655ff0578ac0bda546. * fix deduplicated css problem * update lockfile --- frontend/src/global.scss | 11 ---- .../src/lib/components/PropertiesTable.tsx | 2 +- .../components/ResizableTable/TableConfig.tsx | 2 +- .../lib/components/ResizableTable/index.tsx | 2 +- frontend/src/lib/components/SelectBox.tsx | 2 +- .../lib/components/SelectGradientOverflow.tsx | 2 +- .../src/scenes/dashboard/DashboardItem.tsx | 2 +- .../InsightHistoryPanel.tsx | 2 +- .../scenes/insights/LineGraph/LineGraph.js | 2 +- package.json | 4 +- webpack.config.js | 1 + yarn.lock | 65 ++++--------------- 12 files changed, 23 insertions(+), 74 deletions(-) diff --git a/frontend/src/global.scss b/frontend/src/global.scss index fb478e793c9..eab3e8d0b62 100644 --- a/frontend/src/global.scss +++ b/frontend/src/global.scss @@ -6,17 +6,6 @@ style files without adding already imported styles. */ @import 'node_modules/react-toastify/dist/ReactToastify'; @import './vars'; -// https://github.com/PostHog/posthog/issues/4524 -@import './lib/components/ActionComponents.scss'; -@import './lib/components/PropertiesTable.scss'; -@import './lib/components/SelectBox.scss'; -@import './lib/components/SelectGradientOverflow.scss'; -@import './scenes/insights/InsightHistoryPanel/InsightHistoryPanel.scss'; -@import './scenes/insights/LineGraph/LineGraph.scss'; -@import './scenes/dashboard/DashboardItems.scss'; -@import './lib/components/ResizableTable/index.scss'; -@import './lib/components/ResizableTable/TableConfig.scss'; - @font-face { font-family: 'GoshaSans-Bold'; src: url('../public/GoshaSans-Bold.woff2') format('woff2'), url('../public/GoshaSans-Bold.woff') format('woff'); diff --git a/frontend/src/lib/components/PropertiesTable.tsx b/frontend/src/lib/components/PropertiesTable.tsx index 6bce9afb778..851a2e5873a 100644 --- a/frontend/src/lib/components/PropertiesTable.tsx +++ b/frontend/src/lib/components/PropertiesTable.tsx @@ -5,7 +5,7 @@ import { Dropdown, Input, Menu, Popconfirm, Table, Tooltip } from 'antd' import { NumberOutlined, BulbOutlined, StopOutlined, DeleteOutlined } from '@ant-design/icons' import { isURL } from 'lib/utils' import { IconExternalLink, IconText } from 'lib/components/icons' -// import './PropertiesTable.scss' //https://github.com/PostHog/posthog/issues/4524 +import './PropertiesTable.scss' import stringWithWBR from 'lib/utils/stringWithWBR' type HandledType = 'string' | 'number' | 'bigint' | 'boolean' | 'undefined' | 'null' diff --git a/frontend/src/lib/components/ResizableTable/TableConfig.tsx b/frontend/src/lib/components/ResizableTable/TableConfig.tsx index 379ce36c984..4730247449b 100644 --- a/frontend/src/lib/components/ResizableTable/TableConfig.tsx +++ b/frontend/src/lib/components/ResizableTable/TableConfig.tsx @@ -1,7 +1,7 @@ import { Button, Card, Col, Input, Row, Tooltip } from 'antd' import React, { useEffect, useState } from 'react' import { DownloadOutlined, SettingOutlined, SaveOutlined, SearchOutlined, ClearOutlined } from '@ant-design/icons' -// import './TableConfig.scss' // https://github.com/PostHog/posthog/issues/4524 +import './TableConfig.scss' import { useActions, useValues } from 'kea' import { tableConfigLogic } from './tableConfigLogic' import Modal from 'antd/lib/modal/Modal' diff --git a/frontend/src/lib/components/ResizableTable/index.tsx b/frontend/src/lib/components/ResizableTable/index.tsx index b29977db87b..10fc94cd467 100644 --- a/frontend/src/lib/components/ResizableTable/index.tsx +++ b/frontend/src/lib/components/ResizableTable/index.tsx @@ -8,7 +8,7 @@ import { getActiveBreakpoint, getFullwidthColumnSize, getMinColumnWidth, parsePi import VirtualTableHeader from './VirtualTableHeader' import { TableConfig as _TableConfig } from './TableConfig' -// import './index.scss' // https://github.com/PostHog/posthog/issues/4524 +import './index.scss' export const TableConfig = _TableConfig diff --git a/frontend/src/lib/components/SelectBox.tsx b/frontend/src/lib/components/SelectBox.tsx index d85ebdf2598..bcee5b22473 100644 --- a/frontend/src/lib/components/SelectBox.tsx +++ b/frontend/src/lib/components/SelectBox.tsx @@ -5,7 +5,7 @@ import { List } from 'antd' import { DownOutlined, RightOutlined } from '@ant-design/icons' import { ActionType, CohortType } from '~/types' import { selectBoxLogic } from 'lib/logic/selectBoxLogic' -// import './SelectBox.scss' // https://github.com/PostHog/posthog/issues/4524 +import './SelectBox.scss' import { selectBoxLogicType } from 'lib/logic/selectBoxLogicType' import { PropertyKeyInfo } from 'lib/components/PropertyKeyInfo' diff --git a/frontend/src/lib/components/SelectGradientOverflow.tsx b/frontend/src/lib/components/SelectGradientOverflow.tsx index 4487789faae..ee89329a058 100644 --- a/frontend/src/lib/components/SelectGradientOverflow.tsx +++ b/frontend/src/lib/components/SelectGradientOverflow.tsx @@ -1,7 +1,7 @@ import React, { ReactElement, RefObject, useEffect, useRef, useState } from 'react' import { Select, Tag, Tooltip } from 'antd' import { RefSelectProps, SelectProps } from 'antd/lib/select' -// import './SelectGradientOverflow.scss' //https://github.com/PostHog/posthog/issues/4524 +import './SelectGradientOverflow.scss' import { CloseButton } from './CloseButton' interface DropdownGradientRendererProps { diff --git a/frontend/src/scenes/dashboard/DashboardItem.tsx b/frontend/src/scenes/dashboard/DashboardItem.tsx index 57b4d2180fb..68af2fd6986 100644 --- a/frontend/src/scenes/dashboard/DashboardItem.tsx +++ b/frontend/src/scenes/dashboard/DashboardItem.tsx @@ -1,4 +1,4 @@ -// import './DashboardItems.scss' //https://github.com/PostHog/posthog/issues/4524 +import './DashboardItems.scss' import { Link } from 'lib/components/Link' import { useActions, useValues } from 'kea' import { Dropdown, Menu, Tooltip, Alert, Button, Skeleton } from 'antd' diff --git a/frontend/src/scenes/insights/InsightHistoryPanel/InsightHistoryPanel.tsx b/frontend/src/scenes/insights/InsightHistoryPanel/InsightHistoryPanel.tsx index 6d9ccc7ff8a..0cb80aa3634 100644 --- a/frontend/src/scenes/insights/InsightHistoryPanel/InsightHistoryPanel.tsx +++ b/frontend/src/scenes/insights/InsightHistoryPanel/InsightHistoryPanel.tsx @@ -5,7 +5,7 @@ import { useValues, useActions } from 'kea' import { insightHistoryLogic } from './insightHistoryLogic' import { DashboardItemType } from '~/types' import { DashboardItem, DisplayedType, displayMap } from 'scenes/dashboard/DashboardItem' -// import './InsightHistoryPanel.scss' //https://github.com/PostHog/posthog/issues/4524 +import './InsightHistoryPanel.scss' import dayjs from 'dayjs' import { dashboardItemsModel } from '~/models/dashboardItemsModel' import { router } from 'kea-router' diff --git a/frontend/src/scenes/insights/LineGraph/LineGraph.js b/frontend/src/scenes/insights/LineGraph/LineGraph.js index 8d34566d0ab..bf80661d38c 100644 --- a/frontend/src/scenes/insights/LineGraph/LineGraph.js +++ b/frontend/src/scenes/insights/LineGraph/LineGraph.js @@ -10,7 +10,7 @@ import { toast } from 'react-toastify' import { Annotations, annotationsLogic, AnnotationMarker } from 'lib/components/Annotations' import { useEscapeKey } from 'lib/hooks/useEscapeKey' import dayjs from 'dayjs' -// import './LineGraph.scss' //https://github.com/PostHog/posthog/issues/4524 +import './LineGraph.scss' //--Chart Style Options--// // Chart.defaults.global.defaultFontFamily = "'PT Sans', sans-serif" diff --git a/package.json b/package.json index 4df8bc29483..903adf2bfce 100644 --- a/package.json +++ b/package.json @@ -131,12 +131,12 @@ "less": "^3.12.2", "less-loader": "^7.0.2", "lint-staged": "~10.2.13", - "mini-css-extract-plugin": "^0.11.0", + "mini-css-extract-plugin": "^1.6.0", "monaco-editor-webpack-plugin": "^2.0.0", "postcss-loader": "^3.0.0", "prettier": "^2.1.1", "sass-loader": "^10.0.1", - "style-loader": "^1.2.1", + "style-loader": "^2.0.0", "ts-node": "^9.1.1", "typescript": "^4.3.2", "webpack": "^4.46.0", diff --git a/webpack.config.js b/webpack.config.js index 7bfb01b7a12..cf86b5edf5b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -209,6 +209,7 @@ function createEntry(entry) { // other bundles include the css in js via style-loader new MiniCssExtractPlugin({ filename: '[name].css', + chunkFilename: '[name].css', ignoreOrder: true, }), // we need these only once per build diff --git a/yarn.lock b/yarn.lock index c552df24856..6f6a97c66aa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6782,11 +6782,6 @@ is-path-inside@^2.1.0: dependencies: path-is-inside "^1.0.2" -is-plain-obj@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" - integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= - is-plain-obj@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" @@ -8027,14 +8022,13 @@ min-document@^2.19.0: dependencies: dom-walk "^0.1.0" -mini-css-extract-plugin@^0.11.0: - version "0.11.3" - resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.11.3.tgz#15b0910a7f32e62ffde4a7430cfefbd700724ea6" - integrity sha512-n9BA8LonkOkW1/zn+IbLPQmovsL0wMb9yx75fMJQZf2X1Zoec9yTZtyMePcyu19wPkmFbzZZA6fLTotpFhQsOA== +mini-css-extract-plugin@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-1.6.0.tgz#b4db2525af2624899ed64a23b0016e0036411893" + integrity sha512-nPFKI7NSy6uONUo9yn2hIfb9vyYvkFu95qki0e21DQ9uaqNKDP15DGpK0KnV6wDroWxPHtExrdEwx/yDQ8nVRw== dependencies: - loader-utils "^1.1.0" - normalize-url "1.9.1" - schema-utils "^1.0.0" + loader-utils "^2.0.0" + schema-utils "^3.0.0" webpack-sources "^1.1.0" mini-store@^3.0.1: @@ -8329,16 +8323,6 @@ normalize-range@^0.1.2: resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942" integrity sha1-LRDAa9/TEuqXd2laTShDlFa3WUI= -normalize-url@1.9.1: - version "1.9.1" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-1.9.1.tgz#2cc0d66b31ea23036458436e3620d85954c66c3c" - integrity sha1-LMDWazHqIwNkWENuNiDYWVTGbDw= - dependencies: - object-assign "^4.0.1" - prepend-http "^1.0.0" - query-string "^4.1.0" - sort-keys "^1.0.0" - normalize-url@^3.0.0: version "3.3.0" resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-3.3.0.tgz#b2e1c4dc4f7c6d57743df733a4f5978d18650559" @@ -8380,7 +8364,7 @@ oauth-sign@~0.9.0: resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== -object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: +object-assign@^4.0.1, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= @@ -9274,11 +9258,6 @@ prelude-ls@~1.1.2: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= -prepend-http@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" - integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw= - prettier-linter-helpers@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" @@ -9465,14 +9444,6 @@ query-selector-shadow-dom@0.8.0: resolved "https://registry.yarnpkg.com/query-selector-shadow-dom/-/query-selector-shadow-dom-0.8.0.tgz#74c7509e8b9bc24114febf076f89eb0eaf8e77a7" integrity sha512-dY6R/X8hfGapwcW9Xl6zSpGR1guYNdSVV7XOrO3Xb9UUyo5tEcWON2siDpNyQ+skVjAH0fH3azm3GdnTpUC/2A== -query-string@^4.1.0: - version "4.3.4" - resolved "https://registry.yarnpkg.com/query-string/-/query-string-4.3.4.tgz#bbb693b9ca915c232515b228b1a02b609043dbeb" - integrity sha1-u7aTucqRXCMlFbIosaArYJBD2+s= - dependencies: - object-assign "^4.1.0" - strict-uri-encode "^1.0.0" - query-string@^6.13.1: version "6.13.7" resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.13.7.tgz#af53802ff6ed56f3345f92d40a056f93681026ee" @@ -10924,13 +10895,6 @@ sockjs@^0.3.21: uuid "^3.4.0" websocket-driver "^0.7.4" -sort-keys@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-1.1.2.tgz#441b6d4d346798f1b4e49e8920adfba0e543f9ad" - integrity sha1-RBttTTRnmPG05J6JIK37oOVD+a0= - dependencies: - is-plain-obj "^1.0.0" - source-list-map@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" @@ -11174,11 +11138,6 @@ stream-shift@^1.0.0: resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d" integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ== -strict-uri-encode@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" - integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM= - strict-uri-encode@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" @@ -11312,13 +11271,13 @@ strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== -style-loader@^1.2.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-1.3.0.tgz#828b4a3b3b7e7aa5847ce7bae9e874512114249e" - integrity sha512-V7TCORko8rs9rIqkSrlMfkqA63DfoGBBJmK1kKGCcSi+BWb4cqz0SRsnp4l6rU5iwOEd0/2ePv68SV22VXon4Q== +style-loader@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-2.0.0.tgz#9669602fd4690740eaaec137799a03addbbc393c" + integrity sha512-Z0gYUJmzZ6ZdRUqpg1r8GsaFKypE+3xAzuFeMuoHgjc9KZv3wMyCRjQIWEbhoFSq7+7yoHXySDJyyWQaPajeiQ== dependencies: loader-utils "^2.0.0" - schema-utils "^2.7.0" + schema-utils "^3.0.0" style-value-types@^3.1.9: version "3.1.9"