Commit Graph

716 Commits

Author SHA1 Message Date
github-actions[bot] 7c41134684 Version Packages (next) 2026-02-10 16:14:59 +00:00
Patrik Oldsberg 15ed3f9ccb Add extension snapshot testing support to frontend-test-utils
Adds the snapshot() method to ExtensionTester, enabling snapshot
testing of extension tree structures. The snapshots use a tree-shaped
format that mirrors the extension hierarchy, with empty fields and
default values omitted for clarity.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-04 10:37:33 +01:00
Paul Schultz a7e0d506a2 feat: enable react router feature flags for v7
Signed-off-by: Paul Schultz <pschultz@pobox.com>
2026-02-03 09:37:11 -06:00
github-actions[bot] 1ea737c1e2 Version Packages (next) 2026-02-03 14:24:29 +00:00
Patrik Oldsberg 3fac11b941 Merge pull request #32617 from backstage/rugvip/api-override-test-utils
frontend-test-utils: add API override support
2026-02-03 13:55:58 +01:00
Patrik Oldsberg 8100b2a56f Merge pull request #32626 from backstage/rugvip/remove-multi-attachto-types
frontend-plugin-api: remove type support for multiple attachment points
2026-02-03 12:17:06 +01:00
Patrik Oldsberg 421770753a refactor: migrate tests to use new API override utilities
Updated tests across the repository to use the new `apis` option with
`renderInTestApp` and `createExtensionTester` instead of wrapping
components with `TestApiProvider`. This simplifies tests and demonstrates
the use of the new API override functionality.

Updated test files:
- packages/frontend-plugin-api/src/components/ExtensionBoundary.test.tsx
- packages/frontend-plugin-api/src/blueprints/AppRootElementBlueprint.test.tsx
- plugins/catalog/src/alpha/pages.test.tsx

Total: 15 test cases migrated
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-03 00:11:48 +01:00
Patrik Oldsberg 12ef180a5f Merge pull request #30092 from Sarabadu/module-id-validation
validate plugin and module ids
2026-02-02 20:13:35 +01:00
Patrik Oldsberg 10ebed46b1 frontend-plugin-api: remove type support for multiple attachment points
This is a follow-up to the deprecation in #32521, completely removing
the Array variant from the ExtensionDefinitionAttachTo type.

The runtime still supports multiple attachment points for backward
compatibility, but new code will receive type errors.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-02 16:25:14 +01:00
github-actions[bot] d4b85dddee Version Packages (next) 2026-01-27 15:51:11 +00:00
Patrik Oldsberg 3b488a071e Merge pull request #32521 from backstage/rugvip/no-multi
frontend-plugin-api: deprecate support for multiple attachment points
2026-01-27 13:52:57 +01:00
Patrik Oldsberg 3d963ae749 Merge pull request #32527 from backstage/rugvip/pluginId
frontend-plugin-api: plugins now have pluginId
2026-01-27 13:10:59 +01:00
Patrik Oldsberg 7a6683faa2 frontend-app-api: backfill pluginId field
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-01-27 12:37:03 +01:00
Patrik Oldsberg 53b6549c85 frontend-plugin-api: plugins now have pluginId
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-01-26 19:50:39 +01:00
Patrik Oldsberg 9554c36e4c frontend-plugin-api: deprecate multiple attachment points and document api pattern
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-01-26 16:53:03 +01:00
Fredrik Adelöw 69d880e171 Bump to latest zod
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-01-26 13:52:02 +01:00
Juan Pablo Garcia Ripa bd7d15dd7e add some test for invalid ids
Signed-off-by: Juan Pablo Garcia Ripa <sarabadu@gmail.com>
2026-01-26 00:04:49 +01:00
Juan Pablo Garcia Ripa bb9b471bd3 add plugin id format warning on frontend framework
Signed-off-by: Juan Pablo Garcia Ripa <sarabadu@gmail.com>
2026-01-25 16:55:44 +01:00
Patrik Oldsberg 409af724bf test and review fixes
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-01-23 12:06:21 +01:00
Patrik Oldsberg c38b74df5f frontend-plugin-api: complete deprecation of app blueprints
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-01-23 11:41:16 +01:00
Patrik Oldsberg 7edb810248 frontend-plugin-api: add new internal option for extension inputs
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-01-23 11:41:15 +01:00
github-actions[bot] 2e902e7b43 Version Packages 2026-01-20 16:40:05 +00:00
Patrik Oldsberg a1be5e1770 review fixes for plugin wrapper blueprint
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-01-20 00:11:46 +01:00
Patrik Oldsberg 768b588203 frontend-plugin-api: remove redundant cast
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-01-19 14:43:15 +01:00
Patrik Oldsberg 85c8156984 frontend-plugin-api: simplify deprecation of AppRootWrapperBlueprint
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-01-19 14:14:21 +01:00
Patrik Oldsberg d194acb0e3 frontend-plugin-api: move new PluginWrapper to alpha
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-01-16 17:08:58 +01:00
Patrik Oldsberg 7b7e547d46 frontend-plugin-api: add ExtensionBoundary test for throwing PluginWrapper
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-01-16 17:08:58 +01:00
Patrik Oldsberg c4c2419daa review fixes
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-01-16 17:08:58 +01:00
Patrik Oldsberg 9d194418e7 frontend-plugin-api: add test for PluginWrapperApi in ExtensionBoundary
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-01-16 17:08:58 +01:00
Patrik Oldsberg 0b494408a6 added new app-react library with AppRootWrapperBlueprint replacement
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-01-16 17:05:17 +01:00
Patrik Oldsberg b164e20697 frontend-plugin-api: added PluginWrapperBlueprint + implementation
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-01-16 17:02:09 +01:00
Patrik Oldsberg c4e03c31ac Merge pull request #32345 from backstage/rugvip/restrict
frontend-app-api: restrict the ability for plugins to override APIs
2026-01-16 16:48:58 +01:00
Patrik Oldsberg 9ccf84e219 frontend-plugin-api: move app blueprints to new app-react package
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-01-16 11:59:49 +01:00
Patrik Oldsberg 3bd2a1a5bf frontend-app-api: restrict the ability for plugins to override APIs
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-01-16 01:18:58 +01:00
Jon Koops 872eb91313 Upgrade zod-to-json-schema to latest version
Signed-off-by: Jon Koops <jonkoops@gmail.com>
2026-01-14 12:03:47 +01:00
github-actions[bot] c24788d5bb Version Packages 2025-12-16 14:08:20 +00:00
Patrik Oldsberg a0de7cf2b7 Merge pull request #31933 from backstage/upgrade-jsdom
chore: upgrade jsdom to v27 and Jest to v30
2025-12-15 16:01:01 +01:00
Patrik Oldsberg 9b8bde47d1 frontend-plugin-api: remove unnecessary dependencies
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-12-12 14:39:24 +01:00
Johan Persson cd0b8a11a3 chore: make jest a peer dependency with v29/v30 support
Move jest from dependencies to peer dependencies, allowing users to
choose between Jest 29 and Jest 30.

The CLI now detects the Jest version at runtime and uses the
appropriate environment:
- Jest 29: Uses standard jest-environment-jsdom
- Jest 30: Uses a custom environment based on @jest/environment-jsdom-abstract
  with fixes for Web API globals (fetch, streams, Error, etc.)

The cross-fetch polyfill is only injected for Jest 29, as with Jest 30+
our patched Jest environment is used. The network request blocker is made
MSW-compatible by checking if fetch was wrapped before blocking.

Jest 30 (with jsdom v27) fixes `Could not parse CSS stylesheet`
warnings/errors when testing components from @backstage/ui or other
packages using CSS `@layer` declarations.

New peer dependencies (install based on your Jest version):
- jest (required, ^29 or ^30)
- Jest 29 requires: jest-environment-jsdom
- Jest 30 requires: @jest/environment-jsdom-abstract, jsdom

Production code changes for jsdom 27 testability:
- AppIdentityProxy: extract navigateToUrl method for spying
- LiveReloadAddon: export utils.reloadPage for spying
- collect.ts: export internal.resolvePackagePath for mocking

MockFetchApi: evaluate global.fetch at call time instead of construction
time, allowing MSW to patch fetch after MockFetchApi is constructed.

Test adaptations for jsdom 27:
- Use RGB values instead of named colors in CSS assertions
- Update error format expectations (hyphenated type names, SyntaxError
  instead of FetchError for JSON parse errors)
- Simplify URL error assertions for cross-version compatibility
- Fix accessible name whitespace handling for external links
- Use history.replaceState for location mocking (non-configurable)
- Use fireEvent.blur for contentEditable elements
- Move async assertions inside waitFor for race conditions
- Remove Blob.prototype.text polyfill (now native)
- Remove test case using credentials in plugin:// URLs

Test adaptations for Jest 30:
- Replace `expect.objectContaining([...])` with direct array equality
- Replace `expect.objectContaining({ length: N })` with
  `expect.any(Array)` + separate `toHaveLength()` assertions
- Use child process for native Node.js module resolution in
  collect.test.ts to work around Jest 30's resolver behavior
- Update snapshot headers for new Jest format

Also removes the jest-haste-map patch which is no longer needed.

Signed-off-by: Johan Persson <johanopersson@gmail.com>
2025-12-11 18:06:55 +01:00
github-actions[bot] e08f48a9b5 Version Packages (next) 2025-12-09 15:00:09 +00:00
Patrik Oldsberg 75683ed6c0 frontend-plugin-api: new error boundary API option + boundary for app root elements
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-12-08 16:06:08 +01:00
Fredrik Adelöw f3f84f1e4b make .withOverrides have a simplified result type
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2025-12-03 16:51:12 +01:00
Patrik Oldsberg f85dafa7f2 update API reports for moduleResolution: bundler
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-12-02 22:25:00 +01:00
github-actions[bot] 756986e5e7 Version Packages (next) 2025-11-25 16:21:32 +00:00
Patrik Oldsberg debd56dcf2 frontend-plugin-api: copy SignInPageProps
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-11-23 12:43:21 +01:00
Patrik Oldsberg ebe5538d55 update API reports for core/frontend inversion
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-11-23 01:59:07 +01:00
Patrik Oldsberg 5fc53cb298 {core,frontend}-plugin-api: inverse dependency
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-11-23 01:59:06 +01:00
Patrik Oldsberg 0bc1ce919e frontend-plugin-api: fix input incompatibility crash
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-11-19 17:42:16 +01:00
github-actions[bot] 792f4d7e3d Version Packages 2025-11-18 12:23:09 +00:00
Patrik Oldsberg 83439b1539 core-plugin-api: add forwards compatibility for route refs
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-11-18 10:26:20 +01:00