Skip to content

Coffee fix2 - #59

Merged
bajtos merged 1 commit into
strongloop:masterfrom
TorchlightSoftware:coffee-fix2
Oct 24, 2014
Merged

bajtos merged 1 commit into
strongloop:masterfrom
TorchlightSoftware:coffee-fix2

Conversation

@bitmage

@bitmage bitmage commented Oct 21, 2014

Copy link
Copy Markdown
Contributor

Fixed CLA issues (I think), and added additional commits to comply with @bajtos requests.

@slnode

slnode commented Oct 21, 2014

Copy link
Copy Markdown

Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test."

@bitmage bitmage mentioned this pull request Oct 21, 2014
@bajtos bajtos self-assigned this Oct 21, 2014
@bitmage

bitmage commented Oct 21, 2014

Copy link
Copy Markdown
Contributor Author

Discussion continued from #55

@bajtos

bajtos commented Oct 21, 2014

Copy link
Copy Markdown
Member

@bitmage thanks for the update, I'll review the patch later this week. Could you please rebase it on top of the current master (see #58)?

@bitmage

bitmage commented Oct 21, 2014

Copy link
Copy Markdown
Contributor Author

Ok. I rebased and did a git push --force. Feels like I'm playing with fire here. :-)

@bajtos

bajtos commented Oct 21, 2014

Copy link
Copy Markdown
Member

@slnode ok to test

Comment thread lib/compiler.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather keep all extension filtering in a single place and pass files to loadModelDefinition.

@bajtos

bajtos commented Oct 21, 2014

Copy link
Copy Markdown
Member

The implementation looks good in general, I left a bunch of comments mostly related to coding style.

The tests are failing with the following error, please fix it:

1) compiler from directory loads coffeescript models from `./models`:

      AssertionError: {"name":"Car","config":{"dataSource":"db"},"definition":{"name":"Car"},"sourceFile":"[Undefined]"} must be equivalent to {"name":"Car","config":{"dataSource":"db"},"definition":{"name":"Car"},"sourceFile":"/mnt/jenkins/workspace/loopback-boot.pr/label/amazon-64-0.10/test/sandbox/e5e2279f88/models/car.coffee"}
      + expected - actual

         "definition": {
           "name": "Car"
         }
         "name": "Car"
      +  "sourceFile": "/mnt/jenkins/workspace/loopback-boot.pr/label/amazon-64-0.10/test/sandbox/e5e2279f88/models/car.coffee"
       }

@bitmage

bitmage commented Oct 23, 2014

Copy link
Copy Markdown
Contributor Author

Hmm... the failure was due to a require.cache issue (the two tests conflicted when run together). I fixed it by deleting some entries from the cache, but it's verbose. My goal was to leave the environment the way I found it (e.g. as though coffee-script had never been loaded). But maybe that doesn't actually matter.

I could:

  1. Take out the cache/extension cleanup code, leave the require/register code and just let things run happily. I don't think the coffee-script presence will interfere with anything else.
  2. Factor out the cleanup code into a helper function.
  3. Leave it the way it is.

Take a look and see what you think.

@bitmage

bitmage commented Oct 23, 2014

Copy link
Copy Markdown
Contributor Author

Ok, I think everything is in compliance. I tried rebasing on current master, but the master branch seems to have test failures... so I'll await your instructions.

@bajtos

bajtos commented Oct 23, 2014

Copy link
Copy Markdown
Member

Take out the cache/extension cleanup code, leave the require/register code and just let things run happily. I don't think the coffee-script presence will interfere with anything else.

👍

@bajtos

bajtos commented Oct 23, 2014

Copy link
Copy Markdown
Member

the master branch seems to have test failures

It passes all tests on my machine. What test failures do you see?

@bajtos bajtos removed the waiting label Oct 23, 2014
@bitmage

bitmage commented Oct 23, 2014

Copy link
Copy Markdown
Contributor Author

Ok, I removed the cleanup code. These are the failures I'm seeing on master:

https://gist.github.com/bitmage/0dbc720c4f87c993cbee

@bitmage

bitmage commented Oct 23, 2014

Copy link
Copy Markdown
Contributor Author

Ok, I just needed to run NPM install. The cache cleanup code is removed, and everything is rebased now. Should be good to go.

@bitmage

bitmage commented Oct 23, 2014

Copy link
Copy Markdown
Contributor Author

Here's the official word on require.extensions/coffee-script integration:

jashkenas/coffeescript#3692

So until further notice, using require('coffee-script/register'); is correct.

Comment thread lib/compiler.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra empty line, please remove.

@bajtos

bajtos commented Oct 24, 2014

Copy link
Copy Markdown
Member

One more nitpick, see above. Other than that, the patch LGTM.

Please rebase on top of the current master and squash the commits into a single one and provide a descriptive commit message following the 50/72 rule.

In case you are not familiar with git history rewriting: git rebase -i master && git push -f.

@bajtos

bajtos commented Oct 24, 2014

Copy link
Copy Markdown
Member

BTW it is no longer necessary to sign-off the commits, it's enough to sign the CLA via the web-based app (which you have done already).

Load models for any filetypes registered in require.extensions.

 - Server side coffee-script requires a `require('coffee-script/register');`

 - Client side coffee-script requires Coffeeify.
@bitmage

bitmage commented Oct 24, 2014

Copy link
Copy Markdown
Contributor Author

I did those things. The github statusbox in this thread now reports failures, but I'm unable to see any details.

@bajtos

bajtos commented Oct 24, 2014

Copy link
Copy Markdown
Member

@slnode test please

The error was not related to you pull request, our Jenkins is sometimes failing to fetch PR from github. @rmg is working on a fix.

 > git checkout -f 19646068e81df4db545e7826b12b682dbbe26abd
FATAL: Could not checkout null with start point 19646068e81df4db545e7826b12b682dbbe26abd

I have wiped out Jenkin's workspace, hopefully it will help.

@bajtos

bajtos commented Oct 24, 2014

Copy link
Copy Markdown
Member

@slnode test please

bajtos added a commit that referenced this pull request Oct 24, 2014
support coffee-script models and client code
@bajtos
bajtos merged commit b480efd into strongloop:master Oct 24, 2014
@bajtos bajtos removed the #review label Oct 24, 2014
@bajtos

bajtos commented Oct 24, 2014

Copy link
Copy Markdown
Member

Landed, thank you for the contribution!

@bitmage

bitmage commented Oct 25, 2014

Copy link
Copy Markdown
Contributor Author

Awesome, thanks for working through it with me!

On Oct 24, 2014, at 11:04 AM, Miroslav Bajtoš notifications@github.com wrote:

Landed, thank you for the contribution!

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

@bajtos

bajtos commented Oct 27, 2014

Copy link
Copy Markdown
Member

Released to npmjs.org as v2.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants