Skip to content

webpack fix and warning fixes #187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ executors:
docker:
- image: cimg/node:22.7.0
working_directory: ~/frontend
resource_class: large

jobs:
go-mod-install:
Expand Down
10 changes: 0 additions & 10 deletions public/app/core/reducers/fn-slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,6 @@ export const fnStateProps: FnStateProp[] = [
'version',
];

export const fnPropsMappedFromState: readonly FnPropMappedFromState[] = [
'FNDashboard',
'hiddenVariables',
'mode',
'uid',
'queryParams',
'slug',
'version',
] as const;

const INITIAL_MODE = GrafanaThemeType.Light;

export const FN_STATE_KEY = 'fnGlobalState';
Expand Down
11 changes: 3 additions & 8 deletions public/app/fn-app/fn-dashboard-page/fn-dashboard.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { pick } from 'lodash';
import { FC, useMemo } from 'react';

import { FnPropMappedFromState, fnPropsMappedFromState } from 'app/core/reducers/fn-slice';
import { StoreState, useSelector } from 'app/types';
import { FnGlobalState, FnPropMappedFromState } from 'app/core/reducers/fn-slice';
import { useSelector } from 'app/types';

import { FnAppProvider } from '../fn-app-provider';
import { FNDashboardProps } from '../types';
Expand All @@ -20,12 +19,8 @@ export const FNDashboard: FC<FNDashboardComponentProps> = (props) => {
);
};

function mapStateToProps() {
return ({ fnGlobalState }: StoreState) => pick(fnGlobalState, ...fnPropsMappedFromState);
}

export const DashboardPortal: FC<FNDashboardComponentProps> = (p) => {
const globalFnProps = useSelector(mapStateToProps());
const globalFnProps = useSelector<FnGlobalState>(({ fnGlobalState }) => fnGlobalState);

const props = useMemo(
() => ({
Expand Down
4 changes: 2 additions & 2 deletions public/microfrontends/fn_dashboard/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
</script>


<script nonce="" src="../../../public/build/runtime~fn_dashboard.27b2008e9aab8f8985b3.js" type="text/javascript"></script>
<script nonce="" src="../../../public/build/runtime~fn_dashboard.fc198176f5de1db6b062.js" type="text/javascript"></script>

<script nonce="" src="../../../public/build/fn_dashboard.1f9b5b453196a7012a75.js" type="text/javascript"></script>
<script nonce="" src="../../../public/build/fn_dashboard.e177740ae17aef5ea15a.js" type="text/javascript"></script>

</body>
</html>
11 changes: 7 additions & 4 deletions scripts/webpack/webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ const esbuildOptions = {
};

const envConfig = getEnvConfig();

module.exports = (env = {}) => {
return merge(common, {
devtool: 'eval-source-map',
devtool: false,
mode: 'development',

entry: {
Expand Down Expand Up @@ -76,7 +75,6 @@ module.exports = (env = {}) => {
// removeEmptyChunks: false,
// splitChunks: false,
// },

optimization: {
moduleIds: 'named',
runtimeChunk: true,
Expand All @@ -96,6 +94,11 @@ module.exports = (env = {}) => {
},
},

performance: {
hints: false,
},
parallelism: 2,

plugins: [
parseInt(env.noTsCheck, 10)
? new DefinePlugin({}) // bogus plugin to satisfy webpack API
Expand Down Expand Up @@ -139,7 +142,7 @@ module.exports = (env = {}) => {
new DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('development'),
SHOULD_LOG: JSON.stringify('true'),
SHOULD_LOG: JSON.stringify(process.env.SHOULD_LOG),
},
}),
],
Expand Down