Skip to content

Conversation

matux
Copy link
Contributor

@matux matux commented Aug 6, 2025

Description of the change

This PR enables individual Rollbar component imports by adding component-specific exports to package.json, addressing TypeScript compatibility issues. It provides modular access to Rollbar's core functionality and validates the implementation through comprehensive examples.

  • Add package.json exports for 8 individual Rollbar components (core, telemetry, wrapGlobals, scrub, etc.)
  • Create three example projects demonstrating component-based imports in React (JS/TS) and Node.js environments
  • Validate component import functionality through working example implementations

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Maintenance
  • New release

Related issues

@matux matux requested a review from Copilot August 6, 2025 21:13
@matux matux self-assigned this Aug 6, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enables individual Rollbar component imports by adding component-specific exports to package.json, addressing TypeScript compatibility issues. It provides modular access to Rollbar's core functionality and validates the implementation through comprehensive examples.

  • Add package.json exports for 8 individual Rollbar components (core, telemetry, wrapGlobals, scrub, etc.)
  • Create three example projects demonstrating component-based imports in React (JS/TS) and Node.js environments
  • Validate component import functionality through working example implementations

Reviewed Changes

Copilot reviewed 35 out of 44 changed files in this pull request and generated 4 comments.

File Description
package.json Adds component-specific export definitions for browser/core, telemetry, and other Rollbar modules
examples/react-ts-components/* TypeScript React example demonstrating component imports with proper typing
examples/react-js-components/* JavaScript React example validating component import functionality
examples/node-components/* Node.js example testing component imports in server-side environment

Copy link
Contributor

@waltjones waltjones left a comment

Choose a reason for hiding this comment

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

Works for esm. Approved with cjs support to come in a follow up PR.

@matux matux enabled auto-merge (squash) August 7, 2025 19:51
@matux matux merged commit cd5a2bc into master Aug 7, 2025
4 checks passed
@matux matux deleted the matux/fix-components branch August 7, 2025 19:56
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.

3.0.0-alpha.4 and 5 do not support component based import in TS
2 participants