All Projects → lucasklaassen → angular-rollbar-source-maps

lucasklaassen / angular-rollbar-source-maps

Licence: MIT license
Angular 2+ implementation to upload sourcemaps to Rollbar

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to angular-rollbar-source-maps

Nebular
💥 Customizable Angular UI Library based on Eva Design System 🌚✨Dark Mode
Stars: ✭ 7,368 (+43241.18%)
Mutual labels:  angular2, angular4, angular5, angular6, angular7
Ng Select
⭐ Native angular select component
Stars: ✭ 2,781 (+16258.82%)
Mutual labels:  angular2, angular4, angular5, angular6, angular7
angular-progress-bar
This component allow you to easy incorporate progress-bar to angular/ionic project, providing binding and color options
Stars: ✭ 26 (+52.94%)
Mutual labels:  angular2, angular4, angular5, angular6, angular7
Angular5 Seed
Angular5 Seed for Application
Stars: ✭ 222 (+1205.88%)
Mutual labels:  angular2, angular4, angular5, angular6
Ngx Daterangepicker Material
Pure Angular 2+ date range picker with material design theme, a demo here:
Stars: ✭ 169 (+894.12%)
Mutual labels:  angular2, angular4, angular5, angular6
angularx-qrcode-sample-app
Angular5/6/7/8/9/10+ sample apps with working implementations of angularx-qrcode
Stars: ✭ 15 (-11.76%)
Mutual labels:  angular4, angular5, angular6, angular7
Ngx Monaco Editor
Monaco Editor component for Angular 2 and Above
Stars: ✭ 347 (+1941.18%)
Mutual labels:  angular2, angular4, angular5, angular6
Springbootangularhtml5
♨️ Spring Boot 2 + Angular 11 + HTML5 router mode + HTTP interceptor + Lazy loaded modules
Stars: ✭ 89 (+423.53%)
Mutual labels:  angular2, angular4, angular5, angular6
Ngx Papaparse
Papa Parse wrapper for Angular
Stars: ✭ 83 (+388.24%)
Mutual labels:  angular2, angular4, angular5, angular6
Angular4-seed
Angular 4 Seed for Angular Forms
Stars: ✭ 37 (+117.65%)
Mutual labels:  angular2, angular4, angular5, angular3
Aspnetcore Angular Universal
ASP.NET Core & Angular Universal advanced starter - PWA w/ server-side rendering for SEO, Bootstrap, i18n internationalization, TypeScript, unit testing, WebAPI REST setup, SignalR, Swagger docs, and more! By @TrilonIO
Stars: ✭ 1,455 (+8458.82%)
Mutual labels:  angular2, angular4, angular5, angular6
Angular File Uploader
Angular file uploader is an Angular 2/4/5/6/7/8/9/10 + file uploader module with Real-Time Progress Bar, Responsive design, Angular Universal Compatibility, localization and multiple themes which includes Drag and Drop and much more.
Stars: ✭ 92 (+441.18%)
Mutual labels:  angular2, angular4, angular5, angular6
Ng Simple Slideshow
A simple, responsive slideshow for Angular 4+.
Stars: ✭ 119 (+600%)
Mutual labels:  angular2, angular4, angular5, angular6
Angular Froala Wysiwyg
Angular 4, 5, 6, 7, 8 and 9 plugin for Froala WYSIWYG HTML Rich Text Editor.
Stars: ✭ 696 (+3994.12%)
Mutual labels:  angular2, angular4, angular5, angular6
spring-websocket-angular6
Example for using Spring Websocket and Angular with Stomp Messaging
Stars: ✭ 18 (+5.88%)
Mutual labels:  angular2, angular4, angular5, angular6
Angular Material App
基于最新Angular 9框架与Material 2技术的web中后台前端应用框架。
Stars: ✭ 509 (+2894.12%)
Mutual labels:  angular2, angular4, angular5, angular6
ng-toggle
Bootstrap-styled Angular Toggle Component
Stars: ✭ 14 (-17.65%)
Mutual labels:  angular2, angular4, angular5, angular6
Ngx Smart Modal
Modal/Dialog component crafted for Angular
Stars: ✭ 256 (+1405.88%)
Mutual labels:  angular2, angular4, angular5, angular6
Ng Http Loader
🍡 Smart angular HTTP interceptor - Intercepts automagically HTTP requests and shows a spinkit spinner / loader / progress bar
Stars: ✭ 327 (+1823.53%)
Mutual labels:  angular2, angular4, angular5, angular6
Ng2 Flatpickr
Angular 2+ wrapper for flatpickr (https://github.com/chmln/flatpickr)
Stars: ✭ 91 (+435.29%)
Mutual labels:  angular2, angular4, angular5, angular6

Angular 6 Rollbar Source Maps

When you minify your javascript code with the Angular CLI it is hard to debug exceptions that arise in a production environment within Rollbar. Luckily for us, Rollbar allows us to upload our javascript source maps so that we can see the original source filename, line number, method name, and code snippet the exception occurred from.

Unfortunately for us, Rollbar does not have a streamlined process for uploading these source maps within an Angular 6 deployment pipeline. There is a webpack solution but this would require you to use ng eject to gain access to the webpack configuration file which shouldn't be necessary.

I built a script that can loop through the map files within your /dist folder and upload them to rollbar when you build your angular application. After the map files have been uploaded to Rollbar via their API, it wipes them out from the /dist folder so that you can deploy the entire /dist folder to production. (Although a user can deobfuscate your code without source maps, I recommend you always cover all of your bases)

.env

Be sure to update the .env file with your Rollbar Access Token as well as your websites main URL. Rollbar uses this URL to grab your minified javascript code to compare it with the source map we upload, so be sure that it's accurate.

npm run build

As you will see the package.json file the build command looks like so:

ts-node git.version.ts && ng build --prod --source-map && node scripts/sourceMap.js

Breakdown:

  1. ts-node git.version.ts This command takes the latest git commit SHA and creates a file named versions.ts within the environments folder. Rollbar requires you to attach a version number to each source map you upload so this implementation will work as you make changes down the line and run deploys. You'll notice we use this file within src/app/factories/rollbar.factory.ts where we define the rest of our settings we send to Rollbar.
  2. ng build --prod --source-map This command is pretty straightforward. It runs the classic ng build command and passes the production flag as well as a flag that tells the CLI to generate source maps.
  3. node scripts/sourceMap.js This is the script I have written which loops through all of the .map javascript files within the /dist folder and uploads them one by one to Rollbar via their API. After it's done uploading them to Rollbar it deletes them so that you don't deploy them to production.

Disclaimer

There are probably better ways to do this but at the time of me posting this, I was unable to find ANY resources out there to copy from. This repo was created in the hopes that it would help someone save a bit of time and provide a reference for one way to do this within an Angular 6 app.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].