Giter Site home page Giter Site logo

canadarm's People

Contributors

garrypolley avatar loganom avatar lukasdrgon avatar roryhardy avatar

Stargazers

 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  avatar  avatar  avatar  avatar  avatar  avatar  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

canadarm's Issues

Better `local` and `watch` documentation

Currently this repository lacks detailed documentation on Canadarm.local and Canadarm.watch. I'd like to see some examples added and example use cases added.

Look into using navigator.sendBeacon

Right now we have a "beaconHandler" that is really a hack around using the Image.src.

It should get support in IE Edge in the future.

For now I think feature detection that uses navigator.sendBeacon may be the way to go. Then for browser that do not support it fall back to the hacky Image.src method.

Here is the specification for the feature: http://www.w3.org/TR/beacon/
More "user friendly" detail here: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon

@mhemesath brought this up awhile ago. I saw it again while browsing http://caniuse.com/#search=sent

Analytics and Canadarm

@mhemesath and I have had ideas about how to gather analytics using Canadarm. Since we have the beaconHandler it would work pretty nicely for sending that information.

The thought I have right now to handle this is to create a second library that "shims" to the Canadarm object a Canadarm.analytics that works similarly to how the logging works now. It'll have a lot of defaults that it will put out, but you can pass in your own custom attributes as well. Here are some ideas of how it could work:

// The normal case
Canadarm.analytics()

// Adding custom data
Canadarm.analytics(
  {
    user_id: '123-8238fj', 
    date_of_birth: '2014-05-10'
  }
);

// How setup could work:
Canadarm.analytics.session_id = 'blah'

I think implementation would be done via a custom handler that was only triggered via the Canadarm.analytics call. We would plan to use all the same Appenders so that you get the error and analytic information all the time. If desired it could also be decoupled, I'm not 100% sure yet.

Custom log breaks in node context

I'm building an isomorphic application which executes the same code both on a node-server and in the browser.
When I manually call Canadarm.warn('test') in the "node-context" I get the following error:

project/node_modules/canadarm/build/canadarm.js:472
    var scripts = window.document.getElementsByTagName('script');
                                   ^

TypeError: window.document.getElementsByTagName is not a function
    at standardLogAppender (project/node_modules/canadarm/build/canadarm.js:472:35)
    at gatherErrors (project/node_modules/canadarm/build/canadarm.js:278:18)
    at Object.warn (project/node_modules/canadarm/build/canadarm.js:337:15)
    at Object.module.exports.Object.defineProperty.value (project/dist/server/index.js:1115:19)
    at __webpack_require__ (project/dist/server/index.js:508:30)
    at fn (project/dist/server/index.js:39:20)
    at Object.<anonymous> (project/dist/server/index.js:967:13)
    at __webpack_require__ (project/dist/server/index.js:508:30)
    at fn (project/dist/server/index.js:39:20)
    at Object.module.exports.Object.defineProperty.value (project/dist/server/index.js:926:14)
error: Forever detected script exited with code: 1

The code in Canadarm which does this is:

  // If stack is not defined we are in a browser that does not fully support our logging.
  // Or one of our custom loggers was called, e.g. Logger.debug('message').
  if (exception === undefined || exception === null || exception.stack === null) {
    var scripts = window.document.getElementsByTagName('script');
    scriptURL = (window.document.currentScript || scripts[scripts.length - 1]).src;

  }

Is Canadarm supposed to work with my kind of setup?

Drop IE8 support

It's reasonable at this point to drop IE8 support and release a v2.0.0 of this project

archive this project

Due to the inactivity of this project for over 1 year, this project is marked to be archived at end of January 2024. Previously release assets will be untouched, but support will cease for this project going forward. If anyone has any reasons this project should not be archived, please comment.

Add a Sentry handler

This may be too simple to add in here, maybe just make it documentation.

Sentry is a really good log aggregation platform that has a client for logging out errors. I'm thinking we would just make a handler that wraps the Raven logger.

handle recaptcha api errors gracefully

Please fill out the below template as best you can.

Description of Issue

We're currently running into issues with the recaptcha api. It seems that an issue with the recaptcha api prevented the captcha from rendering on the page.

Here's the error seen in the browser:

canadarm.js:597 Uncaught TypeError: Cannot set property '_wrapper' of null
    at _watchFn (canadarm.js:597)
    at Object.Canadarm.watch (canadarm.js:615)
    at window.EventTarget.addEventListener (canadarm.js:767)
    at recaptcha__en.js:39
    at recaptcha__en.js:39
    at recaptcha__en.js:411
canadarm.js:471 Uncaught TypeError: Cannot read property 'stack' of null
    at standardLogAppender (canadarm.js:471)
    at gatherErrors (canadarm.js:278)
    at Object.fatal (canadarm.js:337)
    at _onError (canadarm.js:713)

We have requested a fix to google's recaptcha, but would also like to see a fix to canadarm. This fix would allow issues with the recaptcha api to pass through canadarm and not affect the application.

https://groups.google.com/forum/#!topic/recaptcha/FPkQ8VFY0zI
google/recaptcha#166

System Configuration

Project Version

Additional Details (optional)

Steps to Reproduce the Issue

  1. Navigate to: https://muhealthe.iqhealth.com/self-enroll/
  2. Inspect browser console.

Expected Outcomes

  • Logging does not break if there is an issue with Googles recaptcha api.

More Tests: standardLogAppender

Right now we have an insufficient amount of tests for the standardLogAppender. Need to add more testing all paths of possible code execution.

This could lead to rewriting the appender a little to be more unit testable.

Canadarm hosting

We need to figure out a strategy for hosting canadarm. It's a hassle to ask people to copy paste the source. If we had it on a place like cdnjs that would be great.

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.