add runtime option#25
add runtime option#25guzart wants to merge 4 commits intothlorenz:masterfrom guzart:feature/add-runtime-option
Conversation
|
Thanks for taking a stab at this, but as far as I understand this you'd prepend the runtime for every file. |
Have you tested the PR, because it's all working for me. |
|
Let me have another look later, but maybe in the meantime you could add some tests to show that and how this works? As far as I can see the only thing wrt traceur runtime that changes is that we pass a boolean flag to have it prepended instead of explicitly adding it to browserify. I'm not even sure if that is that much of an improvement since sometimes explicitness is preferred. However once I see some tests we can think about which one makes more sense. At any rate the So keep in mind that at this point I'm somewhat on the fence about this feature as I'm not convinced that it is a better API even though it is more terse. However I'm more open to just adding another way to specify traceurOverrides via |
|
This PR's were just to start the conversation. However, the PR's are backward compatible with:
And they enhance the functionality with:
I am also on the fence about the terse options, I guess I do prefer the traceur options being explicit. So I'll spend some time tonight refactoring towards: What do you think? (Of course, w/ backward compat) Edit: Now that I look at it, |
|
BTW, this change also allows this usage: as opposed to having to add the entry file using the |
|
Actually this is due to a change in browserify (the examples are old), but has nothing to do with your changes IMO. |
|
will have a closer look later today, thanks. |
|
I am using But this does not: With traceurify I was specifying browserify entry point using the latter. But maybe am missing something. |
|
Ah, that is actually quite odd, but I guess you are right. I like some of these ideas however, so we could also say just screw it lets overhaul the entire API without staying backwards compat and publish as a major release. The requirement to stay useful as pure transform remains however. In that case I'd also opt for including the Disabling that could be an advanced feature. I'd like to see some examples that show how to use that new API (at this point forget about backwards compat). You don't have to implement it either. We should also think about how to configure es6ify from the Extra bonus for sticking with this despite me being so conservative about these changes. :) Thanks. |
|
I feel like I've always left the plugin with the "pure transform" functionality intact, but maybe we have a different idea of what "pure transform" means. For me a "pure transform" means a function that takes a file path as parameter and returns a Stream.
|
I believe you did, I may have misinterpreted what you did previously, but as long as es6ify is |
|
hey @thlorenz, I've modified the example to look more like the api I suggested before, and refactored the existing code just to enough to support it. build.js
I think everything is still backwards compatible |
|
Thank you for being open to my suggestions and for your feedback |
|
This is great, keep 'em coming! I'll create a separate branch tomorow to allow us to play with these ideas. |
|
I created a branch with your changes and added you as collaborator. Feel free to experiment to your delight there, just please don't merge anything into master. Thanks. |
|
As far as I can see you did some nice work making the API smart enough to work with either options or just a file. So As I can see we'll just expose one function, The only additional function we'll expose is
The point is that you are just overriding default options vs. setting them. I picked the name to make that clear and would like to keep it that way. |
|
Actually for now instead of deleting Also we'd need to add some tests that use the new API and move the current ones into So lots of work, but we got time :) |
|
Thank you for adding me as a collaborator. So I think this is what's on the
Are you ok with creating separate issues for each item? |
|
Let's keep the discussion central. We'll just add commits that take on each task an put enough comments in order to not even need too much discussion. |
|
Haven't heard about this in a while. Thanks. |
|
Sorry @thlorenz I've been busy with other projects, I will spend some time later this week to work the bullet points. In terms of the API, I think am happy with this, but I'll setup the examples and the tests Cheers, |
|
No worries, this is not urgent at all, so take your time and make it pretty :) |
|
Updated the "agenda comment" I think I finally understand why the The reason I wasn not thinking of overrides, is because on my PR you might pass the options the first time but next time, you get the defaults. I think we could keep both for maximum flexibility, have the traceur overrides the way it is currently implemented, and allow to pass specific options for each transform. Tho it might get more complicated to explain, understand the difference on which one to use. |
|
Do you have any update on that feature? I was surprised not to be able to use the |
|
@oncletom this has been in the works for a while now. I suppose we should start focusing on this again @guzart and also get @domenic's opinion on some of this. We should also consider turning es6ify into a plugin. This has been done quite successfully for proxyquireify. |
|
Cool thank you :-) |
add a runtime option that includes the traceur runtime file, references #23 and #5