Skip to content

Conversation

matux
Copy link
Contributor

@matux matux commented Jul 18, 2025

Description of the change

Updates all example projects to properly reference the local rollbar package and fixes compatibility issues discovered during ESM migration testing.

Changes

Example Infrastructure

  • Added examples/README.md documenting all example projects and their purposes.
  • Created examples/.gitignore to exclude build outputs and package-lock files.
  • Updated react, angular and vuejs3 examples to use local rollbar package ("rollbar": "file:../..")

Compatibility Fixes

Vue.js 3 Example

  • Created missing src/assets/main.css file that was causing build failures
  • Fixed syntax error in src/rollbar.js (unclosed string)
  • Added "module" field to root package.json to support Vite's ES module resolution

No-Conflict Example

  • Updated webpack config to exclude dist directory from babel transpilation
  • Prevents babel from attempting to process already-transpiled distribution files

Angular Example

  • Added "analytics": false to angular.json to prevent CLI from waiting for user input during CI builds

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

SDK-518/make-sure-all-sdk-examples-work-properly

@matux matux requested a review from Copilot July 18, 2025 22:13
@matux matux self-assigned this Jul 18, 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 updates all example projects to properly reference the local rollbar package and fixes compatibility issues that were preventing examples from building and running correctly. The changes ensure that examples use the local development version of rollbar rather than published versions, and resolve several build-breaking issues discovered during ESM migration testing.

  • Updates package references in example projects to use local rollbar package
  • Fixes syntax errors and missing files in Vue.js 3 example
  • Resolves webpack configuration and Angular CLI issues

Reviewed Changes

Copilot reviewed 10 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
package.json Adds "module" field to support ES module resolution
examples/vuejs3/src/rollbar.js Fixes syntax error in console.log statement
examples/vuejs3/package.json Updates to use local rollbar package
examples/universal-node/package.json Standardizes local package path format
examples/no-conflict/webpack.config.js Excludes dist directory from babel transpilation
examples/no-conflict/package.json Updates to use local rollbar package
examples/angular/package.json Updates to use local rollbar package
examples/angular/angular.json Disables analytics to prevent CI build hangs
examples/README.md Adds comprehensive documentation for all examples
examples/.gitignore Excludes build outputs and package-lock files

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.

❤️

@matux
Copy link
Contributor Author

matux commented Jul 19, 2025

@waltjones I had to revert the examples/react/dist/main.js and examples/react/dist/bundle.js since now that they use the local package ("rollbar": "file:../.."), the resulting js built includes the entire UMD file for a reason that's not entirely clear to me.

I'm gonna solve this by integrating yalc only for the examples. I'm gonna do this on a separate PR so I can merge this.

So the tests were timing out trying to load those js files.

This wasn't affecting the vuejs3 example because we don't have a test/examples for vuejs3, only react, webpack and universalBrowser.

@matux matux merged commit a0bac8c into master Jul 19, 2025
4 checks passed
@matux matux deleted the matux/examples branch July 19, 2025 13:22
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.

2 participants