Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
f372d50
Initial points implementation
jmgasper Dec 14, 2025
d1e8a11
Deploy points branch
jmgasper Dec 14, 2025
9c974b1
Build fix for appirio-tech to topcoder-platform
jmgasper Dec 14, 2025
bed5a22
Fix confirmation dialog width
jmgasper Dec 15, 2025
3023780
Change how the cost estimates are calcualted when points based paymen…
jmgasper Dec 15, 2025
db99a15
Merge pull request #1713 from topcoder-platform/points
jmgasper Dec 15, 2025
0c00adb
Checkpoint prize type
jmgasper Dec 15, 2025
716feb2
Checkpoint prize type
jmgasper Dec 15, 2025
7ae46d5
Revert change to allow reviewers to receive points as paymentg
jmgasper Dec 15, 2025
d1abf94
Merge pull request #1714 from topcoder-platform/points
jmgasper Dec 15, 2025
5edacb4
fix: removing reviewer when new review config is added or review type…
hentrymartin Jan 6, 2026
a91aa85
fix: removing reviewer when new review config is added or review type…
hentrymartin Jan 6, 2026
46e56d1
Fix up challenge status normalization to match v6 changes
jmgasper Jan 6, 2026
ce6d2d5
fix: lint
hentrymartin Jan 7, 2026
534f702
Initial engagements work
jmgasper Jan 9, 2026
a126dd1
Minor UI and API usage fixes
jmgasper Jan 12, 2026
9f08052
Engagements cleanup
jmgasper Jan 12, 2026
2c0f48a
Engagements cleanup
jmgasper Jan 12, 2026
a828dd1
Lint
jmgasper Jan 12, 2026
723bf4a
Updates to support changes to the engagements-api-v6
jmgasper Jan 13, 2026
11fa6da
Navigation and usability tweaks for engagements
jmgasper Jan 14, 2026
97f497f
Add feedback functionality
jmgasper Jan 14, 2026
984db2f
Work in progress updates on the new statuses, multi-member assignment…
jmgasper Jan 15, 2026
c648bc0
Lint
jmgasper Jan 15, 2026
917caf5
Merge pull request #1715 from topcoder-platform/pm-3270
kkartunov Jan 15, 2026
168b3dc
Assignment handling for multi-member engagements
jmgasper Jan 15, 2026
20f0c29
PM-3416 and additional fixes for new assignment / multi-member engag…
jmgasper Jan 15, 2026
3cdb283
More UI fixes
jmgasper Jan 16, 2026
9a42d25
Fix up the engagements list page
jmgasper Jan 16, 2026
a903302
QA fixes for engagements
jmgasper Jan 19, 2026
a192264
Navigation and UI fixes
jmgasper Jan 19, 2026
fb1e064
Fix some API references
jmgasper Jan 19, 2026
29fc7f3
Fix statuses to align with API
jmgasper Jan 19, 2026
a9e5872
Fix spacing for error messages
jmgasper Jan 19, 2026
4a8beb5
Fix engagements payment creation and tweak a UI element
jmgasper Jan 19, 2026
5d66635
Better origin for payments, to match DB
jmgasper Jan 19, 2026
3eaa70b
QA fixes, and add phone number to applications view
jmgasper Jan 20, 2026
5ea1a40
Member experience viewing for PM / TM
jmgasper Jan 20, 2026
9465973
Feedback and experience fixes
jmgasper Jan 20, 2026
84bbe66
UI and QA fixes
jmgasper Jan 21, 2026
73f230c
QA fixes
jmgasper Jan 21, 2026
4333353
Feedback and QA updates https://topcoder.atlassian.net/browse/PM-3559
jmgasper Jan 22, 2026
d1435d1
Add basic tooltip for assignee mousover
jmgasper Jan 22, 2026
6ff326d
Payment weaks for PM-3555
jmgasper Jan 22, 2026
e79b94a
Remove payment status display
jmgasper Jan 22, 2026
d66ada9
Merge branch 'develop' into engagements
jmgasper Jan 22, 2026
0e5d222
Merge pull request #1716 from topcoder-platform/engagements
jmgasper Jan 22, 2026
fe397bc
De-dupe timezone options
jmgasper Jan 23, 2026
87071c5
Merge branch 'engagements' of github.com:topcoder-platform/work-manag…
jmgasper Jan 23, 2026
e6e4ae4
Merge pull request #1717 from topcoder-platform/engagements
jmgasper Jan 23, 2026
1f6f10e
Tweaks for application deadline handling
jmgasper Jan 23, 2026
8f7876f
QA fixes for engagements
jmgasper Jan 25, 2026
f3354a1
Create engagement payment with PAYMENT type, instead of ENGAGEMENT, f…
jmgasper Jan 25, 2026
8931e60
Engagements feedback updates
jmgasper Jan 30, 2026
bd52ae7
More feedback for engagements flow
jmgasper Jan 30, 2026
1a6b856
Remove pending assignment status
jmgasper Jan 30, 2026
3456026
Bulk group creation in WM
jmgasper Feb 1, 2026
c1fb185
Merge pull request #1718 from topcoder-platform/bulk-group
jmgasper Feb 1, 2026
b6c82c2
UI updates for create group page, and add link to create group page f…
jmgasper Feb 2, 2026
286b824
Merge pull request #1719 from topcoder-platform/bulk-group
jmgasper Feb 2, 2026
5d692a9
Updates for anticipated start, payment popup changes
jmgasper Feb 2, 2026
672142a
Fix bulk-search response parsing
jmgasper Feb 2, 2026
59d88ad
Merge pull request #1720 from topcoder-platform/bulk-group
jmgasper Feb 2, 2026
67df58f
Merge pull request #1721 from topcoder-platform/engagements
jmgasper Feb 2, 2026
91ffd6f
Tweaks for bulk group creation flow and better error handling
jmgasper Feb 2, 2026
2d4712a
Merge pull request #1722 from topcoder-platform/bulk-group
jmgasper Feb 2, 2026
2eb49ca
Chunk large files to member-api-v6 bulk-search endpoint to avoid time…
jmgasper Feb 2, 2026
31a0c79
Handling of success when bulk creating group
jmgasper Feb 2, 2026
e94e663
Wording tweak for additional request in PM-3649
jmgasper Feb 2, 2026
6b65f64
Engagements feedback updates
jmgasper Feb 2, 2026
62a1673
QA feedback on engagements and groups management
jmgasper Feb 2, 2026
7dd486f
Create group tweaks for modal popup
jmgasper Feb 2, 2026
4a3266b
Remove description from experience and feedback pages
jmgasper Feb 2, 2026
7931b8a
Cleanup for PM-3655
jmgasper Feb 2, 2026
a267b17
Engagements feedback updates
jmgasper Feb 2, 2026
8feadc9
Fix z-index of date selectors on application approval popup
jmgasper Feb 3, 2026
3d0b54b
Rating color of handle tweak for engagement assignments
jmgasper Feb 3, 2026
55630b8
Clarifying text
jmgasper Feb 3, 2026
9a6256d
Tweak for the acceptance flow for an engagement application
jmgasper Feb 3, 2026
d952efd
Show assignment status instead of application status here.
jmgasper Feb 3, 2026
48bce3a
Default payment value in engagements
jmgasper Feb 3, 2026
9000717
Saturday instead of Friday for week ending
jmgasper Feb 3, 2026
ced6f94
Fix back button on assignments list
jmgasper Feb 3, 2026
fcafa57
Wording change
jmgasper Feb 3, 2026
73d861a
Update to send On Hold (Admin) status for engagement payments
jmgasper Feb 3, 2026
1c97cb2
Payment popup QA fixes
jmgasper Feb 3, 2026
3c3a7c7
Don't count offer rejected, completed, or terminated engagements when…
jmgasper Feb 3, 2026
98cffff
Fix for calendar error on popup
jmgasper Feb 3, 2026
3bb2d04
Changes for PM-3685
jmgasper Feb 3, 2026
909f029
QA fixes for engagements
jmgasper Feb 3, 2026
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ workflows:
context: org-global
filters: &filters-dev
branches:
only: ["develop", "pm-2917"]
only: ["develop", "pm-2917", "points", "pm-3270", "engagements"]

# Production builds are exectuted only on tagged commits to the
# master branch.
Expand Down
6 changes: 6 additions & 0 deletions config/constants/development.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@ module.exports = {
ACCOUNTS_APP_CONNECTOR_URL: `https://accounts-auth0.${DOMAIN}`,
ACCOUNTS_APP_LOGIN_URL: `https://accounts-auth0.${DOMAIN}`,
COMMUNITY_APP_URL: `https://www.${DOMAIN}`,
ENGAGEMENTS_APP_URL: 'https://engagements.topcoder-dev.com',
MEMBER_API_URL: `${DEV_API_HOSTNAME}/v6/members`,
CHALLENGE_API_URL: `${DEV_API_HOSTNAME}/v6/challenges`,
ENGAGEMENTS_API_URL: `${DEV_API_HOSTNAME}/v6/engagements/engagements`,
ENGAGEMENTS_ROOT_API_URL: `${DEV_API_HOSTNAME}/v6/engagements`,
APPLICATIONS_API_URL: `${DEV_API_HOSTNAME}/v6/engagements/applications`,
TC_FINANCE_API_URL: process.env.TC_FINANCE_API_URL || `${API_V6}/finance`,
Copy link

Choose a reason for hiding this comment

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

[⚠️ correctness]
Using process.env.TC_FINANCE_API_URL as a fallback is good, but ensure that this environment variable is set in all environments where this code will run to avoid unexpected behavior.

CHALLENGE_DEFAULT_REVIEWERS_URL: `${DEV_API_HOSTNAME}/v6/challenge/default-reviewers`,
CHALLENGE_API_VERSION: '1.1.0',
CHALLENGE_TIMELINE_TEMPLATES_URL: `${DEV_API_HOSTNAME}/v6/timeline-templates`,
Expand Down Expand Up @@ -62,6 +67,7 @@ module.exports = {
HEADER_AUTH_URLS_HREF: `https://accounts-auth0.${DOMAIN}?utm_source=community-app-main`,
HEADER_AUTH_URLS_LOCATION: `https://accounts-auth0.${DOMAIN}?retUrl=%S&utm_source=community-app-main`,
SKILLS_V5_API_URL: `${API_V5}/standardized-skills/skills/autocomplete`,
SKILLS_V5_SKILLS_URL: `${API_V5}/standardized-skills/skills`,
UPDATE_SKILLS_V5_API_URL: `${API_V5}/standardized-skills/challenge-skills`,
SALESFORCE_BILLING_ACCOUNT_LINK: 'https://c.cs18.visual.force.com/apex/baredirect?id=',
PROFILE_URL: 'https://profiles.topcoder-dev.com/'
Expand Down
6 changes: 6 additions & 0 deletions config/constants/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,15 @@ module.exports = {
ACCOUNTS_APP_CONNECTOR_URL: `https://accounts-auth0.${DOMAIN}`,
ACCOUNTS_APP_LOGIN_URL: `https://accounts-auth0.${DOMAIN}`,
COMMUNITY_APP_URL: `https://www.${DOMAIN}`,
ENGAGEMENTS_APP_URL: 'https://engagements.topcoder-dev.com',

// Local service URLs
MEMBER_API_URL: `${LOCAL_MEMBER_API}/members`,
CHALLENGE_API_URL: `${LOCAL_CHALLENGE_API}/challenges`,
ENGAGEMENTS_API_URL: `${LOCAL_CHALLENGE_API}/engagements/engagements`,
Copy link

Choose a reason for hiding this comment

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

[⚠️ maintainability]
The ENGAGEMENTS_API_URL and ENGAGEMENTS_ROOT_API_URL are both using the same base URL (${LOCAL_CHALLENGE_API}/engagements). Consider whether both are necessary or if one can be derived from the other to reduce redundancy and potential maintenance overhead.

ENGAGEMENTS_ROOT_API_URL: `${LOCAL_CHALLENGE_API}/engagements`,
APPLICATIONS_API_URL: `${LOCAL_CHALLENGE_API}/engagements/applications`,
TC_FINANCE_API_URL: process.env.TC_FINANCE_API_URL || 'http://localhost:3009/v6/finance',
Copy link

Choose a reason for hiding this comment

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

[⚠️ correctness]
Using process.env.TC_FINANCE_API_URL with a fallback to a hardcoded URL can lead to inconsistencies between environments if the environment variable is not set. Ensure that this fallback is intentional and documented, or consider enforcing the presence of the environment variable.

CHALLENGE_DEFAULT_REVIEWERS_URL: `${LOCAL_CHALLENGE_API.replace(/\/v6$/, '')}/v6/challenge/default-reviewers`,
CHALLENGE_API_VERSION: '1.1.0',
CHALLENGE_TIMELINE_TEMPLATES_URL: `${LOCAL_CHALLENGE_API}/timeline-templates`,
Expand Down Expand Up @@ -90,6 +95,7 @@ module.exports = {

// Standardized skills API on local
SKILLS_V5_API_URL: `${LOCAL_SKILLS_API_V5}/skills/autocomplete`,
SKILLS_V5_SKILLS_URL: `${LOCAL_SKILLS_API_V5}/skills`,
UPDATE_SKILLS_V5_API_URL: `${LOCAL_SKILLS_API_V5}/challenge-skills`,

SALESFORCE_BILLING_ACCOUNT_LINK: 'https://c.cs18.visual.force.com/apex/baredirect?id=',
Expand Down
6 changes: 6 additions & 0 deletions config/constants/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ module.exports = {
ACCOUNTS_APP_CONNECTOR_URL: process.env.ACCOUNTS_APP_CONNECTOR_URL || `https://accounts-auth0.${DOMAIN}`,
ACCOUNTS_APP_LOGIN_URL: `https://accounts-auth0.${DOMAIN}`,
COMMUNITY_APP_URL: `https://www.${DOMAIN}`,
ENGAGEMENTS_APP_URL: 'https://engagements.topcoder.com',
Copy link

Choose a reason for hiding this comment

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

[💡 maintainability]
Consider using the DOMAIN constant for consistency: 'https://engagements.${DOMAIN}'.

MEMBER_API_URL: `${PROD_API_HOSTNAME}/v6/members`,
CHALLENGE_API_URL: `${PROD_API_HOSTNAME}/v6/challenges`,
ENGAGEMENTS_API_URL: `${PROD_API_HOSTNAME}/v6/engagements/engagements`,
ENGAGEMENTS_ROOT_API_URL: `${PROD_API_HOSTNAME}/v6/engagements`,
APPLICATIONS_API_URL: `${PROD_API_HOSTNAME}/v6/engagements/applications`,
TC_FINANCE_API_URL: process.env.TC_FINANCE_API_URL || `${API_V6}/finance`,
Copy link

Choose a reason for hiding this comment

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

[❗❗ security]
Ensure that process.env.TC_FINANCE_API_URL is properly validated and sanitized to prevent potential security issues.

CHALLENGE_DEFAULT_REVIEWERS_URL: `${PROD_API_HOSTNAME}/v6/challenge/default-reviewers`,
CHALLENGE_API_VERSION: '1.1.0',
CHALLENGE_TIMELINE_TEMPLATES_URL: `${PROD_API_HOSTNAME}/v6/timeline-templates`,
Expand Down Expand Up @@ -62,6 +67,7 @@ module.exports = {
HEADER_AUTH_URLS_HREF: `https://accounts-auth0.${DOMAIN}?utm_source=community-app-main`,
HEADER_AUTH_URLS_LOCATION: `https://accounts-auth0.${DOMAIN}?retUrl=%S&utm_source=community-app-main`,
SKILLS_V5_API_URL: `${API_V5}/standardized-skills/skills/autocomplete`,
SKILLS_V5_SKILLS_URL: `${API_V5}/standardized-skills/skills`,
UPDATE_SKILLS_V5_API_URL: `${API_V5}/standardized-skills/challenge-skills`,
SALESFORCE_BILLING_ACCOUNT_LINK: 'https://topcoder.my.salesforce.com/apex/baredirect?id=',
PROFILE_URL: 'https://profiles.topcoder.com/'
Expand Down
138 changes: 138 additions & 0 deletions config/formatWebpackMessages.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

'use strict';

const chalk = require('chalk');
const friendlySyntaxErrorLabel = 'Syntax error:';

function isLikelyASyntaxError(message) {
return message.indexOf(friendlySyntaxErrorLabel) !== -1;
}

// Cleans up webpack error messages.
// eslint-disable-next-line no-unused-vars
function formatMessage(message, isError) {
Copy link

Choose a reason for hiding this comment

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

[💡 maintainability]
The isError parameter is not used in the formatMessage function. Consider removing it to improve maintainability and avoid confusion.

// Webpack 5 can emit warning/error objects; normalize to strings.
if (typeof message !== 'string') {
if (message && typeof message.message === 'string') {
message = message.message;
} else if (message && typeof message.stack === 'string') {
message = message.stack;
} else {
message = String(message);
}
}

let lines = message.split('\n');

// Strip Webpack-added headers off errors/warnings
// https://github.com/webpack/webpack/blob/master/lib/ModuleError.js
lines = lines.filter(line => !/Module [A-z ]+\(from/.test(line));

Check warning

Code scanning / CodeQL

Overly permissive regular expression range Medium

Suspicious character range that is equivalent to [A-Z[]^_`a-z].

Copilot Autofix

AI about 1 month ago

In general, to fix overly permissive regex ranges, replace ambiguous ranges like A-z with explicit ranges that only include the desired characters, for example A-Za-z, or use more targeted shorthand classes like [A-Za-z] or \w when appropriate. Also ensure that literal - characters in character classes are either placed at the start/end or escaped so they are not interpreted as ranges.

In this file, the best fix is to change the character class in the filter on line 35 from [A-z ]+ to [A-Za-z ]+. This preserves the intended behavior (letters and spaces) without accidentally including ASCII punctuation between Z and a. No other functionality needs to change: we’re still removing the same Webpack “Module ... (from ...)” header lines, just with a slightly more precise match. We do not need any new imports or helper methods; we only adjust the regex literal in place in config/formatWebpackMessages.js, within the formatMessage function where lines is filtered.

Suggested changeset 1
config/formatWebpackMessages.js

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/config/formatWebpackMessages.js b/config/formatWebpackMessages.js
--- a/config/formatWebpackMessages.js
+++ b/config/formatWebpackMessages.js
@@ -32,7 +32,7 @@
 
   // Strip Webpack-added headers off errors/warnings
   // https://github.com/webpack/webpack/blob/master/lib/ModuleError.js
-  lines = lines.filter(line => !/Module [A-z ]+\(from/.test(line));
+  lines = lines.filter(line => !/Module [A-Za-z ]+\(from/.test(line));
 
   // Transform parsing error into syntax error
   // TODO: move this to our ESLint formatter?
EOF
@@ -32,7 +32,7 @@

// Strip Webpack-added headers off errors/warnings
// https://github.com/webpack/webpack/blob/master/lib/ModuleError.js
lines = lines.filter(line => !/Module [A-z ]+\(from/.test(line));
lines = lines.filter(line => !/Module [A-Za-z ]+\(from/.test(line));

// Transform parsing error into syntax error
// TODO: move this to our ESLint formatter?
Copilot is powered by AI and may make mistakes. Always verify output.

// Transform parsing error into syntax error
// TODO: move this to our ESLint formatter?
lines = lines.map(line => {
const parsingError = /Line (\d+):(?:(\d+):)?\s*Parsing error: (.+)$/.exec(
line
);
if (!parsingError) {
return line;
}
const [, errorLine, errorColumn, errorMessage] = parsingError;
return `${friendlySyntaxErrorLabel} ${errorMessage} (${errorLine}:${errorColumn})`;
});

message = lines.join('\n');
// Smoosh syntax errors (commonly found in CSS)
message = message.replace(
/SyntaxError\s+\((\d+):(\d+)\)\s*(.+?)\n/g,
`${friendlySyntaxErrorLabel} $3 ($1:$2)\n`
);
// Remove columns from ESLint formatter output (we added these for more
// accurate syntax errors)
message = message.replace(/Line (\d+):\d+:/g, 'Line $1:');
// Clean up export errors
message = message.replace(
/^.*export '(.+?)' was not found in '(.+?)'.*$/gm,
`Attempted import error: '$1' is not exported from '$2'.`
);
message = message.replace(
/^.*export 'default' \(imported as '(.+?)'\) was not found in '(.+?)'.*$/gm,
`Attempted import error: '$2' does not contain a default export (imported as '$1').`
);
message = message.replace(
/^.*export '(.+?)' \(imported as '(.+?)'\) was not found in '(.+?)'.*$/gm,
`Attempted import error: '$1' is not exported from '$3' (imported as '$2').`
);
lines = message.split('\n');

// Remove leading newline
if (lines.length > 2 && lines[1].trim() === '') {
lines.splice(1, 1);
}
// Clean up file name
lines[0] = lines[0].replace(/^(.*) \d+:\d+-\d+$/, '$1');

// Cleans up verbose "module not found" messages for files and packages.
if (lines[1] && lines[1].indexOf('Module not found: ') === 0) {
lines = [
lines[0],
lines[1]
.replace('Error: ', '')
.replace('Module not found: Cannot find file:', 'Cannot find file:'),
];
}

// Add helpful message for users trying to use Sass for the first time
if (lines[1] && lines[1].match(/Cannot find module.+node-sass/)) {
lines[1] = 'To import Sass files, you first need to install node-sass.\n';
lines[1] +=
'Run `npm install node-sass` or `yarn add node-sass` inside your workspace.';
}

lines[0] = chalk.inverse(lines[0]);

message = lines.join('\n');
// Internal stacks are generally useless so we strip them... with the
// exception of stacks containing `webpack:` because they're normally
// from user code generated by Webpack. For more information see
// https://github.com/facebook/create-react-app/pull/1050
message = message.replace(
/^\s*at\s((?!webpack:).)*:\d+:\d+[\s)]*(\n|$)/gm,
''
); // at ... ...:x:y
message = message.replace(/^\s*at\s<anonymous>(\n|$)/gm, ''); // at <anonymous>
lines = message.split('\n');

// Remove duplicated newlines
lines = lines.filter(
(line, index, arr) =>
index === 0 || line.trim() !== '' || line.trim() !== arr[index - 1].trim()
);

// Reassemble the message
message = lines.join('\n');
return message.trim();
}

function formatWebpackMessages(json) {
Copy link

Choose a reason for hiding this comment

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

[⚠️ correctness]
The formatWebpackMessages function assumes that the json parameter always contains errors and warnings arrays. Consider adding validation to handle cases where these properties might be missing or not arrays to prevent potential runtime errors.

const formattedErrors = json.errors.map(function(message) {
return formatMessage(message, true);
});
const formattedWarnings = json.warnings.map(function(message) {
return formatMessage(message, false);
});
const result = { errors: formattedErrors, warnings: formattedWarnings };
if (result.errors.some(isLikelyASyntaxError)) {
// If there are any syntax errors, show just them.
result.errors = result.errors.filter(isLikelyASyntaxError);
}
return result;
}

module.exports = formatWebpackMessages;
18 changes: 17 additions & 1 deletion config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ module.exports = function (webpackEnv) {
const isEnvDevelopment = webpackEnv === 'development'
const isEnvProduction = webpackEnv === 'production'
const WM_DEBUG = /^(1|true|on|yes)$/i.test(String(process.env.WM_DEBUG || ''))
const reactDevUtilsContextRegExp = /[\\/]react-dev-utils[\\/]/
Copy link

Choose a reason for hiding this comment

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

[💡 maintainability]
The regular expression for reactDevUtilsContextRegExp uses [\\/] to match path separators. This is generally fine, but consider using path.sep for better cross-platform compatibility, especially if this pattern is used elsewhere in the code.


// Webpack uses `publicPath` to determine where the app is being served from.
// It requires a trailing slash, or the file assets will get an incorrect path.
Expand All @@ -60,6 +61,14 @@ module.exports = function (webpackEnv) {

// common function to get style loaders
const getStyleLoaders = (cssOptions, preProcessor) => {
const resolvedCssOptions = Object.assign(
{
url: {
filter: url => !url.toLowerCase().startsWith('data:')
Copy link

Choose a reason for hiding this comment

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

[⚠️ security]
The url.filter function in resolvedCssOptions checks if a URL starts with 'data:'. Ensure that this logic aligns with your security and functionality requirements, as it could potentially allow unintended URLs if not carefully considered.

}
},
cssOptions
)
const loaders = [
isEnvDevelopment && require.resolve('style-loader'),
isEnvProduction && {
Expand All @@ -71,7 +80,7 @@ module.exports = function (webpackEnv) {
},
{
loader: require.resolve('css-loader'),
options: cssOptions
options: resolvedCssOptions
},
{
// Options for PostCSS as we reference these options twice
Expand Down Expand Up @@ -476,6 +485,13 @@ module.exports = function (webpackEnv) {
// This gives some necessary context to module not found errors, such as
// the requesting resource.
new ModuleNotFoundPlugin(paths.appPath),
// Ensure the dev client tolerates webpack 5 warning/error objects.
isEnvDevelopment &&
new webpack.NormalModuleReplacementPlugin(/\.\/formatWebpackMessages$/, (resource) => {
Copy link

Choose a reason for hiding this comment

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

[⚠️ correctness]
The NormalModuleReplacementPlugin is used to replace ./formatWebpackMessages. Ensure that the replacement path is correct and that the new module provides the expected functionality, as incorrect replacements can lead to runtime errors.

if (reactDevUtilsContextRegExp.test(resource.context || '')) {
resource.request = path.resolve(__dirname, 'formatWebpackMessages')
}
}),
// (DefinePlugin already added above with merged env)
// This is necessary to emit hot updates (currently CSS only):
isEnvDevelopment && new webpack.HotModuleReplacementPlugin(),
Expand Down
Loading
Loading