Add postinstall patch for postcss-safe-parser and harden FloorProfile variation handling#5
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cf39dcc6ba
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let { loading, error, floor } = this.props; | ||
|
|
||
| if (loading) return <LoadingPage/> | ||
| if (!floor) return <LoadingPage/> |
There was a problem hiding this comment.
Handle error before floor-null loading fallback
When the floor fetch fails (for example a 404), Redux can provide error while floor remains undefined. With the new if (!floor) return <LoadingPage/> check placed before the error branch, the component now exits early and never renders E404 or ERROR, leaving users on a permanent loading state for failed requests.
Useful? React with 👍 / 👎.
Motivation
postcss-safe-parserrequiring internalpostcssmodules that can be hoisted or renamed during install.FloorProfileroute.Description
buildscript inpackage.jsontoCI=false NODE_OPTIONS=--openssl-legacy-provider react-scripts buildto avoid OpenSSL-related build failures.postinstallscript inpackage.jsonto runnode scripts/patch-postcss-safe-parser.jsafter install.scripts/patch-postcss-safe-parser.jswhich patchesnode_modules/postcss-safe-parser/lib/safe-parser.jsto resolvepostcssinternals viarequire.resolve('postcss')andpath.join(...), with safety checks and logging.src/routes/FloorProfile/index.jsby adding helper methodsgetWearLayerOptions,getVariationMilType, andgetMatchingVariation, guard against missingfloorandvariation, provide safe defaults for stock/price calculations, add akeyprop to mapped elements, and ensurerequestStockInfohandles absent variations gracefully.Testing
npm installto trigger thepostinstallscript and observed the patch script run or skip with a log message depending onpostcss-safe-parserpresence.npm run buildto validate the updated build command and it completed successfully.npm testto execute the test suite and tests passed.Codex Task