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
Introduce script packs as script. #238
Comments
👍 |
👍 this is going to be AWESOME! |
Isn't #179 the same? We should close that one. |
@dschenkelman Thanks for pointing that out! |
I totally forgot about this one. Need to find some cycles to revisit it. Or maybe someone else takes it. |
Starting on this now! (finally!) How it works
Versioning enhancementsMy hope is this will introduce some new versioning sXs scenarios since the caller only cares about the name / the type reference is injected at compile time ;-) So you should be able to have (eventually) 2 diff versions of the the same script in the same app! Authoring the script pack CSX file.Planning to have 2 modes of authoring:
Within the script pack
Being able to requite other script packs is cool because it means those can also be authored in scripts. Thus an ecosystem of script "libraries" becomes possible! Gist of the syntaxes here: https://gist.github.com/glennblock/8888901 |
this is very nice! script packs as scripts are one of the great missing pieces - as they would allow us to be entirely self-contained (no need for VS to extend scriptcs)! I guess the next would be modules as scripts :-D Some comments: The second example is very intriguing, I love the direction it's going. One problem I can potentially see with manually wrapping the "script" code in a class though, is that not all of our scripting style would work. For example you could never have "global" variable declarations there, or a |
Good point on the return, yes you need to use just typeof to return, but As to the Require that we should be able to surface into the outer class On Sunday, February 9, 2014, Filip W notifications@github.com wrote:
|
Yes on modules as scripts. Once we have the infra in place should be easy. On Sunday, February 9, 2014, Glenn Block glenn.block@gmail.com wrote:
|
OK @filipw after messing with this a while, I came up with a solution that can work. Basically we can make an IRequirer which is a dependency, which can be used within the context class. You don't really need it in the main declaration. So let's say I have a context that is relying on other script packs that it needs to access, it would look like this. public class d910912a3084473395f860c67223210c : ScriptPackTemplate {
public class DooHickey : IScriptPackContext {
private ThingAMahiggy _thingamajiggy;
public DooHickey(IRequirer requirer) {
_thingamajiggy = requirer.Require<ThingAMajiggy>();
}
}
} |
@glennblock @filipw what if we change |
@glennblock @filipw |
I wouldn't do that as that would force implementing it. Having the optional On Sun, Feb 9, 2014 at 1:15 PM, Damian Schenkelman <notifications@github.com
|
@glennblock ok. I thought that since we are kind of forcing |
That would be a breaking change since all the script packs out there use We could possibly look to have a ScriptPackContext class that implements On Sun, Feb 9, 2014 at 1:22 PM, Damian Schenkelman <notifications@github.com
|
@dschenkelman something like this could work and would not break existing public abstract class ScriptPackContext : IScriptPackContext
{
public IRequirer Requirer { get; set; }
public T Require<T>() where T:IScriptPackContext
{
return Requirer.Require<T>();
}
} Now if you derive from this you get Require. |
Great! That is what I was referring to with the first option except that you named it Do we really care about breaking changes? I'd rather make the change now before 1.0.0. |
I care. We have probably 30 script packs at least that we know about, I don't want them all to break. Also I generally don't want to force people to use our base classes i.e. for testing etc. |
I've been doing a ton of work this the past week burning the midnight oil (with a bunch of help from @filipw and @dschenkelman), and I am EXTREMELY happy to tell you that tonight was a breakthrough!!! The first scripted script pack in history IS working :-) There's still a bunch to do. It needs to be optimized, code consolidated and cleaned up a bit, but you can try it out if you want by grabbing my fork! (Normal disclaimers apply). Here are the steps:
|
or, perhaps, since this is a big feature, how about we have a feature branch on the main repo and we work against that until it's mature enough to be merged? |
I like the feature branch idea. On Thu, Feb 20, 2014 at 5:34 AM, Filip W notifications@github.com wrote:
|
great - so could you please push from your repo to a new feature branch in the main repo? |
Thinking about this more, I prefer not dealing with too many moving parts On Sunday, February 23, 2014, Filip W notifications@github.com wrote:
|
that was my point though too the core is obviously done but given that (imho) there is still quite a few that's why I proposed PRs against your branch or a feature branch (more On 24 February 2014 09:39, Glenn Block notifications@github.com wrote:
|
I don't think the core is done, there is more I have no issue with addl PRs, but I would like to first get this cleaned We have waited a long time for this, can't we take it slow? On Monday, February 24, 2014, Filip W notifications@github.com wrote:
|
I created the scripted-packs branch. I will be managing the PRs to this branch, so please no one else merge. Thanks! On Mon, Feb 24, 2014 at 7:34 AM, Glenn Block glenn.block@gmail.com wrote:
|
I feel this should be more than P3 😉. It's a major win for the project. |
That's not what defines priority. It's not a blocker or something people On Tue, Jun 17, 2014 at 11:56 PM, Adam Ralph notifications@github.com
|
@glennblock it's blocking awesomeness! :p will be really awesome when this one comes through. Definitely a handy feature of node being able to call modules in like that! |
This is still in progress. I have rethought this and am taking a different route now which will be more efficient, remove any extra load-time impact and be cleaner. I hope to make progress in the next month or so. |
Dropped in favour of #909 |
Yes we're going there. This will enable to you share scripts in nuget packages as script modules.
It will work very similar to node. Module scriptcs can depend on other modules. All modules will get installed in a modules folder.
Yes, we do love the node module system!
The text was updated successfully, but these errors were encountered: