-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add IcedCoffeeScript support, add lazy loading for CoffeeScript and Iced... #2599
Conversation
I like it. I am down with that only if @mikermcneil and @sgress454 agree too. |
@internalfx Definitely appreciate the work you put in here. Merging this PR would be portentous of a future where |
I agree that its not sustainable forever, but it's probably sustainable for a couple years. I'm not too worried about there being 5 new JavaScript variants within a few years, but who knows? But long term, you are absolutely right. It's just gonna bloat into a bigger and bigger mess.
I'm not entirely sure where to start on that. I'm gonna need guidance from the core team. I'm willing to look into doing that though. The Sails project has helped me, I'm happy to give back. I do however think there is some value here in the interim though. Not even just for Thoughts? Oh and |
@internalfx would you mind implementing this as a hook config? i.e. replace the regexp def string with That way we can nip this one in the bud once and for all |
@mikermcneil Happy to do that, but I'm a little lost....
where do you want it? I haven't looked under the hood a whole lot. Also, the regex isn't the same everywhere, I'm assuming you want a global config? To be DRY'er? Compare these two lines... Some have How would you like me to proceed? |
OK @mikermcneil . I had time to rethink my situation.... I was thinking about my response, and realized I should have put more effort into this. Sorry about that. Moving on... So I "looked under the hood", and it seemed like the way you guys build
Right, so fix it. (Was the response I imagined you saying in my head) OK, how's this look now? |
@loicsaintroch @sgress454 @mikermcneil ...Bumpity Bump....busy week? |
require(path.join(localConfig.appPath, 'node_modules/coffee-script/register')); | ||
} | ||
catch (e1) { | ||
sails.log.error('Please run `npm install coffee-script` to use CoffeScript!'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/coffescript/coffeescript
progress? thoughts? anything? |
Ok, I have had my rant on #2662. Shall I update this to add livescript support? so that a merge will please everyone. Pleasing everyone was my original intent with this. |
…y_coffee Conflicts: lib/hooks/moduleloader/index.js
@@ -109,6 +80,71 @@ module.exports = function(sails) { | |||
layout: path.resolve(config.appPath, 'views/layout.ejs'), | |||
} | |||
}; | |||
|
|||
var hasCoffee = false, hasIced = false, hasLive = false; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First we find out what languages are being used by walking the source files, and flagging what we find
@internalfx send me your email address when you get a chance re #2662 : [email protected] |
done, I added some line notes. This should be ready for review |
Hey I just went through this PR, everything looks good. @internalfx would you mind adding some documentation that explains the additional features that this provides, and some info on how to use it (or, if it's magic, then say so :) ). @mikermcneil @sgress454 what are your thoughts? Things are always nicer as hooks, but I submit to you that existence is the more important feature in this case. Lots of stuff needs to be factored out into hooks anyway, and I think that will be a project in itself. |
@tjwebb I'm working on cleaning this up some more.... |
Ok thanks @internalfx. Ping me when it's ready! |
Dont merge this yet... |
oh wow...you reply fast |
@tjwebb This is ready. |
@internalfx Re: synchronous vs asynchronous loading-- I'm right there with you. This is why we pulled out Anyways, thanks! |
Add IcedCoffeeScript support, add lazy loading for CoffeeScript and Iced...
@mikermcneil Yay! My projects can finally all run master again. I wonder why require doesn't just take an optional callback? Such a system would keep all backwards compatibility. On another topic, what are your thoughts on the idea of core hooks being override-able? (is that a word?) Not sure how feasible that is, but then I could experiment with new core hooks. The |
For an update on this, see #3142 (comment) (let's funnel future discussion there as well so it's all in one place) |
...CoffeeScript
Here is a possibility for adding lazy loading for CoffeeScript and IcedCoffeeScript.
Not super happy about using synchronous APIs, but it looked like I would have to tear the whole thing apart to do it Async.
Would love feedback, thanks.