脚本#0.8更改生成的代码 [英] Script# 0.8 changes in generated code

查看:49
本文介绍了脚本#0.8更改生成的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经从Github构建了最新的script#源码,并开始在项目中使用它.看起来代码生成的方式已经改变.

I've built the latest script# source from Github and started using it in a project. It looks like the way code is generated has changed.

如何使编译器返回到生成代码的旧方法? (0.7.x方式)

How do I make the compiler go back to the old way of generating code? (the 0.7.x way)

推荐答案

没有标志可以返回到旧的输出.新的输出将用于创建脚本模块的AMD模式带到script#生成的输出中,并利用它来简化事情并使生成的脚本与可接受的模式更加一致.

There isn't a flag to go back to the old output. The new output brings the AMD pattern for creating script modules to script# generated output, and takes advantage of it to streamline things and make generated script more consistent with accepted patterns.

首先是使用模块作用域来更好地生成私有类型,以便将它们最小化.具体地说,使用"$"作为分隔符的整个标识符被最小化,而不是因为出现."而被保留为不可缩小的符号.最终,我也将其用于私有成员.

First is use of the module scope to generate private types better so they are more minimizable. Specifically the whole identifier using '$' as separator is minimized, rather than being left as unminimizable because of the "."... eventually I'll be using that for private members as well.

如果以前使用程序集ScriptNamespace属性来最小化通常较长的c#名称空间,则公共类型在模块外的公开方式相同.

Public types are exposed in the same way outside the module if you were using the assembly ScriptNamespace attribute previously to minimizing typically longer c# namespaces.

如果您不使用ScriptNamespace,而是以前公开了SomeNamespace.SomeSubnamespace.SomeType之类的类型,那么公共表面区域也会发生变化-现在,该类型公开为SomeModule.MyType(就像您使用ScriptNamespace = SomeModule)一样.每个c#程序集都映射到一个模块.

If you weren't using ScriptNamespace, and instead previously you were exposing type such as SomeNamespace.SomeSubnamespace.SomeType, then there is a change on the public surface area as well - the same type is now exposed as SomeModule.MyType (like you would with a ScriptNamespace = SomeModule). Every c# assembly maps to a module.

同样,这是为了最大程度地减少影响,并与大多数其他脚本框架采用的模式保持同步.希望能为变革提供一些背景.

Again, this is to minimize better, as well as being in sync with patterns that most other script frameworks have adopted. Hope that provides some of the context for the change.

您是否需要旧输出的特定方面,而不是本质上保持不变?如果您需要与以前完全相同的输出,那么将使用0.7.x版本.

Was there a particular aspect of the old output that you need, rather than essentially the need to keep it the same? If you need exactly the same output as before, then 0.7.x is going to be the version to use.

这篇关于脚本#0.8更改生成的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆