fix(web): simplify Helmet imports to use named ESM exports#1470
fix(web): simplify Helmet imports to use named ESM exports#1470Tobbe merged 2 commits intocedarjs:mainfrom
Conversation
`@dr.pogodin/react-helmet` v2.0.4 ships with proper ESM named exports (exports.import in package.json). The `import * as helmetPkg` pattern followed by destructuring was from before the package had ESM support. Replaced all 4 occurrences with direct named imports. Closes cedarjs#373
👷 Deploy request for cedarjs pending review.Visit the deploys page to approve it
|
Greptile SummaryThis PR replaces the Confidence Score: 5/5Safe to merge — pure import-syntax cleanup with no behavioral or API changes All four changes are mechanically equivalent to the code they replace. The package version is pinned and verified to support named ESM exports. CJS compilation is unaffected. No new logic, no new dependencies, and the public export surface of @cedarjs/web is unchanged. No files require special attention Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["@dr.pogodin/react-helmet v2.0.4\n(exports.import present)"]
subgraph Before
B1["import * as helmetPkg"]
B2["const { Helmet } = helmetPkg"]
B1 --> B2
end
subgraph After
C1["import { Helmet } from '…'"]
end
A --> Before
A --> After
Before -- "same runtime binding" --> D["Helmet / HelmetProvider used in components"]
After -- "same runtime binding" --> D
D --> E1["MetaTags.tsx"]
D --> E2["Metadata.tsx"]
D --> E3["RedwoodProvider.tsx"]
D --> E4["index.ts → exports Head, Helmet"]
Reviews (1): Last reviewed commit: "refactor: simplify Helmet imports to use..." | Re-trigger Greptile |
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run-many -t build:pack --exclude create-ceda... |
✅ Succeeded | 2s | View ↗ |
nx run-many -t test --minWorkers=1 --maxWorkers=4 |
✅ Succeeded | 4m 14s | View ↗ |
nx run-many -t build |
✅ Succeeded | 3m 56s | View ↗ |
nx run-many -t test:types |
✅ Succeeded | 12s | View ↗ |
☁️ Nx Cloud last updated this comment at 2026-03-27 16:38:28 UTC
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run-many -t build |
✅ Succeeded | 1m 3s | View ↗ |
nx run-many -t build:pack --exclude create-ceda... |
✅ Succeeded | <1s | View ↗ |
☁️ Nx Cloud last updated this comment at 2026-03-27 07:45:50 UTC
|
@mvanhorn Thanks for submitting one more PR 🙏 Do you want to look at the lint issue, or should I take care of it? |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Fixed in 52acb94 - added the missing blank line between import groups in MetaTags.tsx. |
|
@mvanhorn Thanks for another good PR 🙏 |
|
The changes in this PR are now available on npm. Try them out by running |

Summary
Replaced
import * as helmetPkg+ destructuring with direct named imports from@dr.pogodin/react-helmet.Why this matters
The
import * aspattern was needed when the package lacked ESM support.@dr.pogodin/react-helmetv2.0.4 ships withexports.importin its package.json, making named imports work correctly. The old pattern added unnecessary indirection.Changes
packages/web/src/components/MetaTags.tsx:import { Helmet as HelmetHead }packages/web/src/components/Metadata.tsx:import { Helmet as HelmetHead }packages/web/src/components/RedwoodProvider.tsx:import { Helmet, HelmetProvider }packages/web/src/index.ts:import { Helmet }4 files, net -7 lines.
Testing
Verified
@dr.pogodin/react-helmet@2.0.4hasexports.importandmodulefields in its npm registry entry. No behavioral change - same symbols imported, just cleaner syntax.Closes #373
This contribution was developed with AI assistance (Claude Code).