angularjs-logDecorator icon indicating copy to clipboard operation
angularjs-logDecorator copied to clipboard

Remove dependency on Require?

Open tommck opened this issue 10 years ago • 7 comments

I am contemplating using this or something like it with a project here, but we're not using Require as part of the project.

Have you thought about removing that (and other external dependencies)?

I may just fork this and remove it myself, but I wanted to see if you were interested in that. I already have some planned add-ons for it.

tommck avatar May 22 '14 19:05 tommck

I started some work with Browserify and urequire... but the initial results look complicated. Let's talk about your needs: what are you using for a package manager? If RequireJS was not used... how would you load all your classes/scripts?

ThomasBurleson avatar May 22 '14 19:05 ThomasBurleson

well, my target is to have something universally available, but my current project is using bower.

As far as not using RequireJS, I would just load classes and scripts in the normal way? I'm familiar with AMD, but it's not a requirement for Angular development and this client I'm working with now chose not to use it. It's basically orthogonal to AngularJS

tommck avatar May 22 '14 19:05 tommck

RequireJS and AngularJS are complementary.

RequireJS is a load-time dependency class manager; while AngularJS is a run-time dependency instance injector.

See the video and slidedecks @ AngularJS with RequireJ.

If you want to use these without RequireJS, I would need to:

  1. Browserify all to remove the RequireJS dependencies
  2. Publish/group these in a angular.module( 'mindspace.logX', [ ]);
  3. Concatenate these if the correct order and update the Bower install to publish the common libraries also: release/common/angular-logX.js

I actually started this efforts 3-4 weeks ago, and then was distracted with other work. Let me see if I have time this weekend to finish that effort.

Look at Gruntfile.js and its urequire task.

ThomasBurleson avatar May 22 '14 19:05 ThomasBurleson

I understand the purposes of each product, but my point is that RequireJS isn't necessary for AngularJS and many people use AngularJS without using RequireJS. Thus, there are many people who won't want to use this as-is.

My thoughts were to start with a non-AMD version of this first, then shim it to AMD in order for it to be most useful to a larger audience. I'm not familiar with Browserify, myself, but it seems like it does something like that.

I had also planned on adding a feature or two to the implementation. Are you open to new features? I'm thinking about making the "instances" have "switches" to allow people to pare down the level of output they want to see from each instance separately. Hope that makes sense

tommck avatar May 22 '14 20:05 tommck

correction, Browserify seems to do that same thing, but backwards :)

tommck avatar May 22 '14 20:05 tommck

Filters would be a great addition.

  • Thomas Burleson http://www.solutionOptimist.com

From: Tom McKearney [email protected] Reply: ThomasBurleson/angularjs-logDecorator [email protected] Date: May 22, 2014 at 3:15:55 PM To: ThomasBurleson/angularjs-logDecorator [email protected] Cc: Thomas Burleson [email protected] Subject:  Re: [angularjs-logDecorator] Remove dependency on Require? (#4)

I understand the purposes of each product, but my point is that RequireJS isn't necessary for AngularJS and many people use AngularJS without using RequireJS. Thus, there are many people who won't want to use this as-is.

My thoughts were to start with a non-AMD version of this first, then shim it to AMD in order for it to be most useful to a larger audience. I'm not familiar with Browserify, myself, but it seems like it does something like that.

I had also planned on adding a feature or two to the implementation. Are you open to new features? I'm thinking about making the "instances" have "switches" to allow people to pare down the level of output they want to see from each instance separately. Hope that makes sense

— Reply to this email directly or view it on GitHub.

ThomasBurleson avatar May 22 '14 20:05 ThomasBurleson

Cool. I'll work on that.. it's my favorite way to do things. I wrote JsTrace a few years ago to handle that (http://jstrace.codeplex.com) in order to do that in straight JS

EDIT: Oh, and much of that code is kinda nasty :)

tommck avatar May 22 '14 20:05 tommck