From: Kris Windham <kriswind...@gmail.com>
Date: Tue, 24 Apr 2012 11:35:41 -0400
Local: Tues, Apr 24 2012 11:35 am
Subject: Re: [npm] Re: Global vs. local require() hooks
Once again, well put @izs
Thanks for taking the time to draft your thoughts. Don't let the schism frustrate you. It is nodeJS, not nodeCS. On Apr 24, 2012, at 11:23 AM, Isaac Schlueter wrote: > This whole discussion is a little bit absurd.
> If I had a time machine, and could go back to 2010 and do it again, I > Here's a better approach than require('coffee-script') to set up the > There are a few ways to do this. The first way is to write > The second way is to write some other language, but compile it to > The third way, which is sadly very common, and also in my opinion > It is presumptuous because it places unnecessary requirements on your > It is divisive because many users will simply not use your module > Please stop requiring coffee-script at run-time. Write whatever you > On Mon, Apr 23, 2012 at 06:44, Aseem Kishore <aseem.kish...@gmail.com> wrote: >> Short of changes w/in Node, your getRequire() method would work. It loses >> require = require('coffee-script').register(require) >> Ultimately, I think all of these issues would be simplified significantly if >> CoffeeScript team, sorry -- I've been using CS as an example just because >> Aseem >> On Mon, Apr 23, 2012 at 5:21 AM, Bruno Jouhier <bjouh...@gmail.com> wrote: >>> require = require('coffee-script').require >>> won't work because it won't be able to handle relative paths. You'd need >>> require = require('coffee-script').getRequire(__dirname); >>> The require function would need to install the hooks, run the native >>> Another approach is to say that language tools should be backwards >>> On Sunday, April 22, 2012 2:52:40 AM UTC+2, Aseem Kishore wrote: >>>>> require = require('coffee-script'); >>>> Argh, sorry -- that should be something like this: >>>> require = require('coffee-script').require; >>>> Aseem >>>> On Sat, Apr 21, 2012 at 8:51 PM, Aseem Kishore <aseem.kish...@gmail.com> >>>>> (Changing to own thread) >>>>>> The "local custom require" would be a bit tricky because every module >>>>> Yep, that's why I suggested that the compiler could automatically inject >>>>> Currently, to compile CoffeeScript or Streamline, you put this at the >>>>> require('coffee-script'); >>>>> That changes global state. As our tools continue evolving, that sucks >>>>> So my suggestion is that, instead, you would put *this* one-liner: >>>>> require = require('coffee-script'); >>>>> The implementation internally would mostly be the same -- the hook would >>>>> But it would do one extra thing: inject this same one-liner to the top >>>>> What do you guys think? >>>>> Aseem >>>>> On Fri, Apr 20, 2012 at 3:24 AM, Bruno Jouhier <bjouh...@gmail.com> >>>>>> The "local custom require" would be a bit tricky because every module >>>>>> [...] >>>>>> Bruno >>>>>> On Friday, April 20, 2012 5:43:27 AM UTC+2, Aseem Kishore wrote: >>>>>>> If I have a module in e.g. CoffeeScript, I would think that clients >>>>>>> [...] >>>>>>> * I've been thinking about the global require() hooks because I've >>>>>>> require = require('coffee-script').require >>>>>>> Same could apply to Streamline, etc. You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||