Giter VIP home page Giter VIP logo

ember-cli-raygun's Introduction

Ember CLI Raygun

Build Status Ember Observer Score

This addon will allow you to report errors to Raygun from your Ember CLI app using raygun4js.

❤️ Please open an issue if you run into any troubles!


CLI installation

$ ember install ember-cli-raygun --api_key='paste_your_api_key_here'

Alternatively, you can set your API key manually by starting with:

$ ember install ember-cli-raygun

Next, set your API key in config/environment.js:

var ENV = {
  // ...
  raygun: {
    apiKey:  "paste_your_api_key_here",
    enableCrashReporting: (environment === "production")
  }
  // ...

The default blueprint (which runs during ember install ember-cli-raygun) will add the above config in your app's config/environment.js file.

Release

Raygun will now track errors in your deployed application. By default, Ember CLI Raygun is disabled unless your environment is set to "production". You can configure this behavior in config/environment.js.

Additional Configruation

CORS

ember-cli-raygun will automatically inject the raygun4js bootstrap script into the head of your Ember app. This is the most reliable way to catch errors (even during app initialization).

If you’re using CORS without unsafe-inline, you’ll need to add the following directives to ensure rg4js and Raygun load correctly:

Accessing Raygun

Functions you might need on rg4js are exposed as an Ember Service, for instance tracking custom events:

import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';

export default class IndexRoute extends Route {
  @service raygun;

  beforeModel() {
    this.raygun.trackEvent({
      type: 'customTiming',
      name: 'IndexRouteBeforeModel',
      duration: 1200
    })
  }
}

User Tracking

Check out the Customers section in the raygun4js documentation for full details.

Add the following snippet into your application route in app/routes/application.js:

// ...
  @service user;
  @service raygun;

  beforeModel: () {
    this.setRaygunUser();
  },

  setRaygunUser: () {
    this.raygun.setUser({
      identifier: this.get("user.id"),
      isAnonymous: false,
      email: this.get("user.email"),
      firstName: this.get("user.firstName"),
      fullName: this.get("user.fullName")
    });    
  },
// ...

Thanks! ❤️

Thanks to:

For your contributions on the previous version of this addon :)

Contributing

Pull requests are welcome!

  • git clone this repository
  • npm install

Running tests

  • ember test OR
  • ember test --server

There’s a detailed test harness in the dummy app so please check that your changes work end-to-end by running that.

ember-cli-raygun's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ember-cli-raygun's Issues

Cannot find module 'lodash-es'

I'm getting a "Cannot find module 'lodash-es'" error after adding ember-cli-raygun. I'm seeing it in both new and pre-existing projects on this particular machine.

Environment:

  • Windows 10
  • Node v8.9.4
  • Yarn v1.3.2
  • Ember v3.0.0

Repro steps:

  • ember new test-app
  • cd test-app
  • ember install ember-cli-raygun
  • yarn install
  • ember serve

Anybody else seeing this?

FastBoot support

When using FastBoot the bower extension should not be imported.

NodeJS throws below error because of it:

ReferenceError: document is not defined
    at Object._private.readCookie (/Users/melvin/Projects/bazaar/dist/fastboot/vendor.js:73910:34)
    at ensureUser (/Users/melvin/Projects/bazaar/dist/fastboot/vendor.js:74105:37)
    at Object.init (/Users/melvin/Projects/bazaar/dist/fastboot/vendor.js:73683:13)
    at /Users/melvin/Projects/bazaar/dist/fastboot/vendor.js:77878:16
    at exports.default (/Users/melvin/Projects/bazaar/dist/fastboot/vendor.js:77905:9)
    at Object.initialize (/Users/melvin/Projects/bazaar/dist/fastboot/bazaar.js:973:71)
    at /Users/melvin/Projects/bazaar/dist/fastboot/vendor.js:16073:23
    at Vertices.each (/Users/melvin/Projects/bazaar/dist/fastboot/vendor.js:14140:13)
    at Vertices.topsort (/Users/melvin/Projects/bazaar/dist/fastboot/vendor.js:14107:14)
    at DAG.topsort (/Users/melvin/Projects/bazaar/dist/fastboot/vendor.js:14052:24)
    at Class._runInitializer (/Users/melvin/Projects/bazaar/dist/fastboot/vendor.js:16101:13)
    at Class.runInitializers (/Users/melvin/Projects/bazaar/dist/fastboot/vendor.js:16062:12)
    at Class._bootSync (/Users/melvin/Projects/bazaar/dist/fastboot/vendor.js:15260:14)
    at Class.boot (/Users/melvin/Projects/bazaar/dist/fastboot/vendor.js:15227:14)
    at EmberApp.buildAppInstance (/Users/melvin/Projects/bazaar/node_modules/fastboot/src/ember-app.js:211:21)
    at EmberApp.visitRoute (/Users/melvin/Projects/bazaar/node_modules/fastboot/src/ember-app.js:234:17)
    at EmberApp.visit (/Users/melvin/Projects/bazaar/node_modules/fastboot/src/ember-app.js:309:17)
    at FastBoot.visit (/Users/melvin/Projects/bazaar/node_modules/fastboot/src/index.js:79:22)
    at /Users/melvin/Projects/bazaar/node_modules/fastboot-express-middleware/src/index.js:32:14
    at Layer.handle [as handle_request] (/Users/melvin/Projects/bazaar/node_modules/express/lib/router/layer.js:95:5)
    at next (/Users/melvin/Projects/bazaar/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/Users/melvin/Projects/bazaar/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/Users/melvin/Projects/bazaar/node_modules/express/lib/router/layer.js:95:5)
    at /Users/melvin/Projects/bazaar/node_modules/express/lib/router/index.js:281:22
    at param (/Users/melvin/Projects/bazaar/node_modules/express/lib/router/index.js:354:14)
    at param (/Users/melvin/Projects/bazaar/node_modules/express/lib/router/index.js:365:14)
    at Function.process_params (/Users/melvin/Projects/bazaar/node_modules/express/lib/router/index.js:410:3)
    at next (/Users/melvin/Projects/bazaar/node_modules/express/lib/router/index.js:275:10)
    at SendStream.error (/Users/melvin/Projects/bazaar/node_modules/serve-static/index.js:121:7)
    at emitOne (events.js:96:13)
    at SendStream.emit (events.js:188:7)
    at SendStream.error (/Users/melvin/Projects/bazaar/node_modules/send/index.js:282:17)
    at SendStream.onStatError (/Users/melvin/Projects/bazaar/node_modules/send/index.js:433:12)
    at next (/Users/melvin/Projects/bazaar/node_modules/send/index.js:743:16)
    at onstat (/Users/melvin/Projects/bazaar/node_modules/send/index.js:732:14)
    at FSReqWrap.oncomplete (fs.js:123:15)

The import can be made conditionally by checking for `` as such:

if (!process.env.EMBER_CLI_FASTBOOT) {
  app.import('bower_components/.../dist/raygun.js');
}

Ideas?

New release

@NZKoz Could you please create a new release with latest changes, I think a lot of people will benefit from it.

Thank you!

Raygun doesnt detach

If "enabled" changes in "env", there is an console statement, but Raygun is still active.

Is this maintained?

As far as I see, there as been no maintainer activity since last August, including no publication of the changes that were merged then.

Is this addon maintained? If not, would you guys be up for a member of the community taking it over and maintaining it?

Re-implement because of the deprecation of Ember.logger

Howdy 👋

I'm just raising this issue because it's something that is going to affect you directly quite soon, there is an RFC in Ember that is currently going into Final Comment Period that is planning to remove support for Ember.logger: emberjs/rfcs#297

I don't know if I have enough knowledge of what is going on in your internals to comment directly on that RFC but I would strongly recommend that you do 👍

Also if you accept what they are doing we should start development on the migration.

Octane Support

This plugin appears to have last been updated prior to the release of Ember Octane. Does it work with Ember Octane? Are there plans to update it to Ember Octane and beyond?

New Release

Would it be possible to get a new release published with the changes from #4?

Switch to/support distributing via npm

A few reasons:

  • The Ember ecosystem is rapidly moving away from the use of Bower
  • Bower itself is deprecated:

    ...psst! While Bower is maintained, we recommend yarn and webpack for new front-end projects!

  • Raygun4js is available via npm

If you good folks would be so kind, we'd really appreciate it!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.