Skip to content
This repository has been archived by the owner on Jan 25, 2020. It is now read-only.

Changes to become v1.x #30

Merged
merged 42 commits into from
Jun 3, 2015
Merged

Changes to become v1.x #30

merged 42 commits into from
Jun 3, 2015

Conversation

aredridel
Copy link
Contributor

No description provided.

aredridel added 29 commits June 1, 2015 11:56
This exposes the (potential) express 5 style asynchronous locate, and by
blessing the view.locate() function, engines can use this to look up
resources.
since i18n for a dust engine makes no sense as Kraken uses it, this test
can be much simpler.
} else if ((!err && stat.isDirectory()) || (err && err.code === 'ENOENT')) {
next();
} else {
cb(err);
Copy link
Member

Choose a reason for hiding this comment

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

I guess it looks like there is no need to check that err is defined here..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah. I'm not super happy with that logic -- it works, it's correct, but it's not obvious.

To run lint
$ npm run-script lint
```shell
npm run cover
Copy link
Member

Choose a reason for hiding this comment

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

I had to run npm run-script cover. Is this due to my npm version? (2.5.1)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, run has always been an alias for run-script. What happened when you did npm run cover?

Copy link
Member

Choose a reason for hiding this comment

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

oh. sorry. i was simply using npm cover and then straight to npm run-script cover.. I didn't properly read the doc above and try npm run. That works for me now that I've tried it.

Copy link
Member

Choose a reason for hiding this comment

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

Awesome coverage metrics btw!!

@@ -2,3 +2,6 @@
node_modules/
coverage/
npm-debug.log
*.swp
test/fixtures/tmp/
nyc_output/
Copy link
Member

Choose a reason for hiding this comment

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

I think this needs to be .nyc_output/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@grawk
Copy link
Member

grawk commented Jun 2, 2015

Is there a sample express app anywhere currently using the v1.x pre-release version of engine-munger?

@aredridel
Copy link
Contributor Author

Working on integrating it into a kraken app right now.

@aredridel
Copy link
Contributor Author

Also, the tests fire up a complete app.

@grawk
Copy link
Member

grawk commented Jun 2, 2015

Ah right. I guess the root of my question was really "which versions of adaro and other things go along with this?" but it's really right there in package.json already! Aside from the picky stuff I already noted I don't have any other concerns. But let me digest this some more to make sure I can learn as much as possible before giving a thumbs up.

@aredridel
Copy link
Contributor Author

awesome. It's really the design and redrawing of module boundaries I want to make sure make sense.

@grawk
Copy link
Member

grawk commented Jun 2, 2015

In terms of structure, what do you think about externalizing the proto patch from the exported makeViewClass function? I'm just thinking in terms of the fact that the patch will hopefully go away when the PR is accepted to express and this module is released to match [email protected].

edit: Let me restate this: would there be sufficient value to include the express view patch verbatim in this module, and then externalize all the "non-patch" stuff (like bcp47/i18n resolution)? That could make more clear how we will eventually utilize express once 5.x is released.

freshy = require('freshy');

var test = require('tap').test;
var freshy = require('freshy');
Copy link
Member

Choose a reason for hiding this comment

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

freshy isn't used in this module

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch

@aredridel
Copy link
Contributor Author

Mostly the prototype creation is inside makeViewClass because the conf variable is shared with the internals but private.

None of that is performance critical, since a new view class is created once per app in normal use, so having it be properly private by scoping made me happy.

@grawk
Copy link
Member

grawk commented Jun 3, 2015

Ok. Officially in love with this PR. 👍

@pvenkatakrishnan
Copy link
Member

👍

pvenkatakrishnan pushed a commit that referenced this pull request Jun 3, 2015
Changes to become v1.x
@pvenkatakrishnan pvenkatakrishnan merged commit bbcd258 into v1.x Jun 3, 2015
@aredridel aredridel deleted the next branch June 3, 2015 19:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants