Skip to content
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

@W-13942827 - Reduced Javascript Heap Size Ramp Up #1535

Merged
merged 22 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from 14 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,943 changes: 1,233 additions & 710 deletions package-lock.json

Large diffs are not rendered by default.

343 changes: 181 additions & 162 deletions packages/commerce-sdk-react/package-lock.json

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions packages/commerce-sdk-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"dependencies": {
"commerce-sdk-isomorphic": "^1.10.4",
"js-cookie": "^3.0.1",
"jwt-decode": "^3.1.2"
"jwt-decode": "^4.0.0"
},
"devDependencies": {
"@salesforce/pwa-kit-dev": "3.3.0-dev",
Expand All @@ -52,7 +52,6 @@
"@types/js-cookie": "~3.0.3",
"@types/jsdom": "^16.2.15",
"@types/jsonwebtoken": "~9.0.0",
"@types/jwt-decode": "~3.1.0",
"@types/node": "~16.0.3",
"@types/prop-types": "~15.7.9",
"@types/react": "~18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/commerce-sdk-react/src/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
ShopperLoginTypes,
ShopperCustomersTypes
} from 'commerce-sdk-isomorphic'
import jwtDecode, {JwtPayload} from 'jwt-decode'
import {jwtDecode, JwtPayload} from 'jwt-decode'
import {ApiClientConfigParams, Prettify, RemoveStringIndex} from '../hooks/types'
import {BaseStorage, LocalStorage, CookieStorage, MemoryStorage, StorageType} from './storage'
import {CustomerType} from '../hooks/useCustomerType'
Expand Down
2,216 changes: 1,035 additions & 1,181 deletions packages/internal-lib-build/package-lock.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"bundlesize": [
{
"path": "build/main.js",
"maxSize": "42 kB"
"maxSize": "43 kB"
},
{
"path": "build/vendor.js",
Expand Down
516 changes: 330 additions & 186 deletions packages/pwa-kit-create-app/package-lock.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions packages/pwa-kit-dev/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## v3.3.0-dev (Nov 03, 2023)

- Add `source-map-loader` plugin to webpack configuration. [#1535](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1535)
- Only use source maps in server when `inpect` flag is being used. [#1535](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1535)
bendvc marked this conversation as resolved.
Show resolved Hide resolved

## v3.2.0 (Nov 03, 2023)
## v3.1.1 (Sep 21, 2023)

Expand Down
3 changes: 2 additions & 1 deletion packages/pwa-kit-dev/bin/pwa-kit-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ const main = async () => {
execSync(`${babelNode} ${inspect ? '--inspect' : ''} ${entrypoint}`, {
env: {
...process.env,
...(noHMR ? {HMR: 'false'} : {})
...(noHMR ? {HMR: 'false'} : {}),
...{WEBPACK_INSPECT: inspect}
bendvc marked this conversation as resolved.
Show resolved Hide resolved
}
})
})
Expand Down
3,365 changes: 1,678 additions & 1,687 deletions packages/pwa-kit-dev/package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/pwa-kit-dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
"require-from-string": "^2.0.2",
"rimraf": "2.7.1",
"semver": "^7.5.2",
"source-map-loader": "^4.0.1",
"speed-measure-webpack-plugin": "^1.5.0",
"svg-sprite-loader": "^6.0.11",
"validator": "^13.9.0",
Expand Down
12 changes: 10 additions & 2 deletions packages/pwa-kit-dev/src/configs/webpack/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const production = 'production'
const development = 'development'
const analyzeBundle = process.env.MOBIFY_ANALYZE === 'true'
const mode = process.env.NODE_ENV === production ? production : development
const INSPECT = process.env.WEBPACK_INSPECT
bendvc marked this conversation as resolved.
Show resolved Hide resolved
const DEBUG = mode !== production && process.env.DEBUG === 'true'
const CI = process.env.CI
const disableHMR = process.env.HMR === 'false'
Expand Down Expand Up @@ -257,6 +258,13 @@ const baseConfig = (target) => {
use: {
loader: findDepInStack('html-loader')
}
},
{
test: /\.js$/,
enforce: 'pre',
use: {
loader: findDepInStack('source-map-loader')
}
}
].filter(Boolean)
}
Expand Down Expand Up @@ -467,7 +475,7 @@ const renderer =
name: SERVER,
entry: '@salesforce/pwa-kit-react-sdk/ssr/server/react-rendering.js',
// use eval-source-map for server-side debugging
devtool: mode === development ? 'eval-source-map' : false,
devtool: mode === development && INSPECT ? 'eval-source-map' : false,
output: {
path: buildDir,

Expand Down Expand Up @@ -536,7 +544,7 @@ const requestProcessor =
libraryTarget: 'commonjs2'
},
// use eval-source-map for server-side debugging
devtool: mode === development ? 'eval-source-map' : false,
devtool: mode === development && INSPECT ? 'eval-source-map' : false,
Copy link
Collaborator

@alexvuong alexvuong Nov 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, would this prevent source-map on browser? when we are not starting the app with inspect mode?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The request processor is something that runs on the "server"... well at least on the browser. So if you wanted to debug it, you'd be adding the --inspect flag anyway.

plugins: [
...config.plugins,
analyzeBundle && getBundleAnalyzerPlugin(REQUEST_PROCESSOR)
Expand Down
Loading