Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add ._js & ._coffee extensions for Streamline.js. #151

Merged
merged 2 commits into from
@aseemk

Streamline.js by Bruno Jouhier (@Sage) is a library/tool that lets you write
synchronous-looking JavaScript/CoffeeScript, and have it compile to Node-style
asynchronous JavasScript/CoffeeScript. (It's amazing and super elegant.)

https://github.com/Sage/streamlinejs

From the start, Streamline was designed to be exactly JavaScript/CoffeeScript,
so that it works with existing editors and tools. No new keywords or syntax --
it simply reserves _ as a function parameter name.

Streamline files have thus kept .js and .coffee as extensions, so that no
changes need to be made to tools; Streamline has just used the convention of
ending file basenames with _, like foo_.js or foo_.coffee.

Unfortunately, to get the most optimal Node.js integration, with on-the-fly
compilation (like CoffeeScript), files now need to have their own extension.
So Bruno has decided to make ._js and ._coffee the extensions of choice.

The good news is that the language is still exactly JavaScript/CoffeeScript;
it's only the extension that's changed. It's simple to add these extensions
into our editors, but I'm wondering if we can add this to GitHub too. =)

This change is super simple and shouldn't affect any other language, so I hope
you guys are open to it. Thanks for your consideration!

@aseemk aseemk Add ._js & ._coffee extensions for Streamline.js.
Streamline.js by Bruno Jouhier (@Sage) is a library/tool that lets you write
synchronous-looking JavaScript/CoffeeScript, and have it compile to Node-style
asynchronous JavasScript/CoffeeScript. (It's amazing and super elegant.)

https://github.com/Sage/streamlinejs

From the start, Streamline was designed to be exactly JavaScript/CoffeeScript,
so that it works with existing editors and tools. No new keywords or syntax --
it simply reserves `_` as a function parameter name.

Streamline files have thus kept `.js` and `.coffee` as extensions, so that no
changes need to be made to tools; Streamline has just used the convention of
ending file basenames with `_`, like `foo_.js` or `foo_.coffee`.

Unfortunately, to get the most optimal Node.js integration, with on-the-fly
compilation (like CoffeeScript), files now need to have their own extension.
So Bruno has decided to make `._js` and `._coffee` the extensions of choice.

The good news is that the language is still exactly JavaScript/CoffeeScript;
it's only the extension that's changed. It's simple to add these extensions
into our editors, but I'm wondering if we can add this to GitHub too. =)

This change is super simple and shouldn't affect any other language, so I hope
you guys are open to it. Thanks for your consideration!
54e81dd
@jeremyis

+1 - Love streamline and github. Please add support!

@aseemk

Oops, turns out that Bruno's username is @bjouhier. (@Sage is where he works, and technically the owner of Streamline.js.)

@bjouhier

+1. And, in passing, kudos to the github team for such a great collaboration tool.

@tchambard

+1. This is a very powerful API. It makes life easy for every asynchronous calls in Node.js

@nitescuc

+1, Excellent idea, please, please

@aseemk aseemk Regression fix: ensure .coffee is primary ext.
(The primary extension by default is the first extension, but the extensions
need to be in alphabetical order, and _coffee comes before coffee.)
17adccc
@eboyard

+1, very good idea

@axkibe

+1 easy to do, see nothing bad coming out of it -> win

@anodos

+1 :)

@bigeasy

+1 Use Streamline in a number of GitHub hosted projects. Becoming my default for new projects. Streamline is becoming a language in its own right. The new file extension mechanism is a real win. Please pull this request in.

@jzimmek

+1

@aseemk

Any word, @github folks? We sincerely appreciate the consideration!

@abiyani

+1

@mlin

+1

@kislyuk

Please add. Also please consider letting github users configure custom file extensions/patterns for highlighting!

@josh josh merged commit aa7c849 into github:master
@aseemk

Discovered today that Streamline files were magically highlighted -- awesome! Thanks so much. =)

It'd be great if GitHub would send a notification email when issues/pull requests you created or follow were closed/opened/merged/etc.!

@aseemk

Hey @josh, I saw a ._js file highlighted fine in one repo, but ._coffee files in another aren't:

https://github.com/thingdom/node-neo4j/blob/develop/lib/PropertyContainer._coffee

Is this expected? (E.g. a propagation or caching issue?) Or is this a bug somewhere?

Thanks!

@bigeasy

Wonderful! Thank you all so much.

@bjouhier

Cool! Thanks Josh (and Aseem for submitting the pull request).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 2, 2012
  1. @aseemk

    Add ._js & ._coffee extensions for Streamline.js.

    aseemk authored
    Streamline.js by Bruno Jouhier (@Sage) is a library/tool that lets you write
    synchronous-looking JavaScript/CoffeeScript, and have it compile to Node-style
    asynchronous JavasScript/CoffeeScript. (It's amazing and super elegant.)
    
    https://github.com/Sage/streamlinejs
    
    From the start, Streamline was designed to be exactly JavaScript/CoffeeScript,
    so that it works with existing editors and tools. No new keywords or syntax --
    it simply reserves `_` as a function parameter name.
    
    Streamline files have thus kept `.js` and `.coffee` as extensions, so that no
    changes need to be made to tools; Streamline has just used the convention of
    ending file basenames with `_`, like `foo_.js` or `foo_.coffee`.
    
    Unfortunately, to get the most optimal Node.js integration, with on-the-fly
    compilation (like CoffeeScript), files now need to have their own extension.
    So Bruno has decided to make `._js` and `._coffee` the extensions of choice.
    
    The good news is that the language is still exactly JavaScript/CoffeeScript;
    it's only the extension that's changed. It's simple to add these extensions
    into our editors, but I'm wondering if we can add this to GitHub too. =)
    
    This change is super simple and shouldn't affect any other language, so I hope
    you guys are open to it. Thanks for your consideration!
Commits on Apr 3, 2012
  1. @aseemk

    Regression fix: ensure .coffee is primary ext.

    aseemk authored
    (The primary extension by default is the first extension, but the extensions
    need to be in alphabetical order, and _coffee comes before coffee.)
This page is out of date. Refresh to see the latest.
Showing with 10 additions and 1 deletion.
  1. +3 −1 lib/linguist/languages.yml
  2. +7 −0 test/test_language.rb
View
4 lib/linguist/languages.yml
@@ -216,8 +216,9 @@ CoffeeScript:
ace_mode: coffee
aliases:
- coffee
+ primary_extension: .coffee
extensions:
- - .coffee
+ - ._coffee
filenames:
- Cakefile
@@ -586,6 +587,7 @@ JavaScript:
- node
primary_extension: .js
extensions:
+ - ._js
- .bones
- .jake
- .js
View
7 test/test_language.rb
@@ -252,6 +252,11 @@ def test_find_by_extension
assert_equal Language['PHP'], Language.find_by_extension('php5')
assert_equal Language['PowerShell'], Language.find_by_extension('psm1')
assert_equal Language['PowerShell'], Language.find_by_extension('ps1')
+
+ # Aliases for Streamline.js ( https://github.com/Sage/streamlinejs )
+ assert_equal Language['JavaScript'], Language.find_by_extension('_js')
+ assert_equal Language['CoffeeScript'], Language.find_by_extension('_coffee')
+
assert_nil Language.find_by_extension('.nkt')
end
@@ -332,6 +337,8 @@ def test_primary_extension
assert_equal '.pl', Language['Perl'].primary_extension
assert_equal '.py', Language['Python'].primary_extension
assert_equal '.rb', Language['Ruby'].primary_extension
+ assert_equal '.js', Language['JavaScript'].primary_extension
+ assert_equal '.coffee', Language['CoffeeScript'].primary_extension
# This is a nasty requirement, but theres some code in GitHub that
# expects this. Really want to drop this.
Something went wrong with that request. Please try again.