Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

refactor(SIGPG-7327): remove invariant dependency in favor of native …#856

Open
khamiltonuk wants to merge 1 commit into
masterfrom
SIGPG-7327-remove-invariant
Open

refactor(SIGPG-7327): remove invariant dependency in favor of native …#856
khamiltonuk wants to merge 1 commit into
masterfrom
SIGPG-7327-remove-invariant

Conversation

@khamiltonuk
Copy link
Copy Markdown
Collaborator

fixes https://jira.tools.sap/browse/SIGPG-7327

What changed

  • Replace all invariant() calls with native if/throw Error statements
  • Removing the invariant and @types/invariant packages from dependencies.

How to test

  • Open the app everything
  • Pipeline should go green
    • npm run lint — passes with zero warnings
    • npm run test — all 204 Cypress component tests pass
    • npm run test:ssr — both SSR tests pass
    • Verify invariant is no longer in node_modules after a fresh npm ci should work

Notes

  • invariant(condition, message) and if (!condition) throw new Error(message) have identical runtime behavior, so this is a pure dependency removal with no functional change.
  • This removes two production dependencies (invariant, @types/invariant), reducing bundle size and the project's supply chain surface.

…throw

Replace all invariant() calls with native if/throw Error statements,
removing the invariant and @types/invariant packages from dependencies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant