Skip to content
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

POC/WIP: port to CommonJS #269

Closed
wants to merge 4 commits into from
Closed

POC/WIP: port to CommonJS #269

wants to merge 4 commits into from

Conversation

necolas
Copy link
Contributor

@necolas necolas commented Jun 24, 2014

Working proof-of-concept to have a look at.

Sane diff without whitespace changes: https://github.com/flightjs/flight/pull/269/files?w=1

@alexgorbatchev
Copy link
Contributor

👍

@angus-c
Copy link
Contributor

angus-c commented Jun 25, 2014

looks good - as discussed. adding an issue to test index.js. We needed it before this, but these changes highlight it.

Some apprehension about defineComponent -> flight.component in terms of lost descriptive power. But not sure I have a better solution right now.

@@ -0,0 +1,17 @@
var BannerPlugin = require('webpack/lib/BannerPlugin');
var version = require('./package.json').version;
var webpack = require('webpack');
Copy link
Contributor

Choose a reason for hiding this comment

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

used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh yeah, good spot

@wwwsevolod
Copy link

Why not es6 modules? Handlebars.js using it, for example

@necolas
Copy link
Contributor Author

necolas commented Jun 26, 2014

none of our codebases use es6 modules. commonjs is widespread and not going away any time soon.

@wwwsevolod
Copy link

@necolas but es6 transpilers can compile it to commonjs, or amd or standalone with change in build command one param, look at handlebars source, it is really awesome example of es6 module system.

@necolas
Copy link
Contributor Author

necolas commented Jun 26, 2014

yeah i know, but we write all our code as commonjs.

@andrewk
Copy link

andrewk commented Jun 27, 2014

Is the idea here that a new major version would ship using CommonJS instead of RequireJS?
Very much in favour of this PR 👍

@necolas
Copy link
Contributor Author

necolas commented Jun 27, 2014

Yes I hope so. And available on npm.

[ES5-shim](https://github.com/kriskowal/es5-shim) and
[jQuery](http://jquery.com) – and use an AMD module loader like
[Require.js](http://requirejs.org/) or
You will have to reference [jQuery](http://jquery.com) and use a CommonJS build
Copy link
Contributor Author

Choose a reason for hiding this comment

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

need to add webpack here

@necolas
Copy link
Contributor Author

necolas commented Jul 23, 2014

Changes to jasmine-flight to support a switch to commonjs: flightjs/jasmine-flight#44

@alexgorbatchev
Copy link
Contributor

@angus-c is something blocking this PR?

@angus-c
Copy link
Contributor

angus-c commented Jul 23, 2014

@alexgorbatchev AFAIK it's still a WIP

@necolas
Copy link
Contributor Author

necolas commented Jul 23, 2014

Would want more review of the changes to the test extensions and the consequences that might have on testing your app. Wasn't so keen on having to let the karma preprocessor/files know about every commonjs file in your dependency tree.

@alexgorbatchev
Copy link
Contributor

Does it make sense to do a major semver change on this broad change? Technically API doesn't change here, but it's large enough change and it would be nice not to scare folks away by "sneaking" it under more liberal semver requirements using ^.

@@ -6,7 +6,10 @@ VERSION = `node -pe "require('./package.json').version"`
clean:
@ rm -rf $(BUILD_DIR)

standalone: clean
setup:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

do this in a separate PR so we can apply it now; not related to the commonjs port

@angus-c
Copy link
Contributor

angus-c commented Jul 31, 2014

looks good

@necolas necolas mentioned this pull request Aug 6, 2014
@necolas
Copy link
Contributor Author

necolas commented Sep 3, 2014

the commonjs stuff has been in limbo for a while and isn't a requirement of getting flight registered with npm. so instead, we could publish the UMD build to npm (using a prepublish script to build it) and make sure the test extensions work with node's require.

@necolas
Copy link
Contributor Author

necolas commented Oct 21, 2014

Closing. Will leave the branch in place if there's interest in picking it up in the future.

@necolas necolas closed this Oct 21, 2014
@peruggia
Copy link

Too sad that @necolas closed this PR. I had hoped that one day I could use FlightJS with Browserify.

@andrewk
Copy link

andrewk commented Oct 25, 2014

You can use Flight and CommonJS right now if you swap browserify for
webpack.
On 25 Oct 2014 13:57, "Rafael Peruggia" notifications@github.com wrote:

Too sad that @necolas https://github.com/necolas closed this PR. I had
hoped that one day I could use FlightJS with Browserify.


Reply to this email directly or view it on GitHub
#269 (comment).

@necolas
Copy link
Contributor Author

necolas commented Oct 25, 2014

Added npm support f462336

I published 1.3.0 to npm.

@peruggia
Copy link

@andrewk Thank you for the tip. I'm gonna give it a try.

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.

None yet

6 participants