Release Notes

nikhilk edited this page Apr 19, 2013 · 7 revisions

Release Notes

0.8

This version represents a large set of fundamental changes, to significantly improve script generation and various API changes to set up the project for next wave work. It also includes new functionality such as ability to build node.js-based server applications.

  • Support for AMD, and both support and leverage module pattern for structuring generated script. Assemblies map to modules. Referenced map to dependencies.
  • More efficient script generation that minimizes better ranging from changes to anonymous method declaration to locally scoped private/internal types.
  • Removed .debug and .release generated scripts. For a Foo assembly, the debug build produces Foo.js and minimized Foo.min.js matching c# debug build target, and release build also produces Foo.js and corresponding minimized Foo.min.js matching c# release build target.
  • Leverage AjaxMin tool to perform minimization (significantly better minimization as a result)
  • ssloader.js contains a compact script loader based on the AMD pattern (provides implementation of define and requires). It also supports declarative configuration of the loader, local storage integration for scripts, and auto/pre-loading of scripts.
  • Optimize mscorlib.js (now renamed to ss.js) in terms of size, more streamlined type system, as well as removal of all global extensions to existing script objects.
  • Support for new HTML5 APIs: indexed db, files, stylesheets
  • Support for node.js applications with core node APIs, support for CommonJS-style modules, as well as initial set of node modules (express, mongodb, neo4j, restify and azure)
  • Compiler changes
    • Changed the generation of ?? operator from generating a logical or (||) to a call to ss.value at runtime. Previously ?? would result in selection of first truthy value. The c# semantics are first non-null value. Example, false is valid value. The new script reflects those semantics. To get old semantics, use Script.Or instead of ??.
  • Script metadata API changes (mostly affects import libraries)
    • Removed ScriptNamespaceAttribute (instead the name specified in ScriptAssemblyAttribute provides the functionality of ScriptNamespace)
    • Removed ScriptQualifierAttribute (this was used to provide a distinguisher prefix for same named private types across assemblies, but within the same script namespace). No longer needed, as private types do not show up outside the script module scope.
    • Removed AlternateSignatureAttribute that was required to define overload signatures. Instead just the extern modifier suffices.
    • PreserveCaseAttribute and PreserveNameAttribute functionality is rolled into ScriptNameAttribute.
    • ImportAttribute renamed to ScriptImportAttribute.
    • IgnoreNamespaceAttribute renamed to SriptIgnoreNamespaceAttribute.
    • IntrinsicPropertyAttribute renamed to ScritpFieldAttribute
    • ResourcesAttribute renamed to ScriptResourcesAttribute
    • NamedValuesAttribute and NumericValuesAttribute combined into the new ScriptConstantsAttribute
    • GlobalMethodsAttribute is gone (no implicit generation of methods on to the global script object, you must instead do it explicitly by assigning a delegate to the member on the global object).
    • MixinAttribute renamed to ScriptExtensionAttribute.
    • NonScriptableAttribute renamed to ScriptIgnoreAttribute.
    • Added ScriptTemplateAttribute to provide a template for script generation instead of a template file within the project)
    • Added ScriptModuleAttribute to define top-level code that executes as a script module loads at runtime.
    • Added ScriptMethodAttribute
    • Added ScriptEventAttribute
    • Added ScriptDependencyAttribute to define a module level dependency.
    • Added ScriptReferenceAttribute to customize the semantics of a dependency (path, delay-loading etc.)
    • Added ScriptObjectAttribute (to be used instead of a Record base class) for defining literal object types.
  • Core runtime (ss.js and mscorlib.dll) changes
    • Added Stack and Queue instead of overloading Array
    • Removed Array.Clone, Array.Index, Array.GroupBy
    • Removed Format and LocaleFormat on Number (use String.Format instead)
    • Removed Date.Empty, IsEmpty - use null check instead
    • Removed Delegate.ClearExport, and DeleteExport - use Detach and Dispose methods on the new Export object returned from Delegate.Export)
    • Removed String.CompareTo, and Equals - use String.Compare
    • Removed String.HtmlEncode/Decode, IndexOfAny, LastIndexOfAny
    • Replaced Array.Extract with GetRange (consistency with .net)
    • Replaced Delegate.CreateExport with Export
    • Replaced String.LocaleFormat with an overload that takes in CultureInfo (consistency with .net)
    • Renamed RegularExpression with RegExp.
    • Added Script.Global representing the global object for easy access within a module
    • Added Script.Undefined
    • Added Script.IsNaN, IsFinite, IsTruthy and IsFalsey
    • Added Script.Or to generate script such as a || b to select first truthy script value.
    • Added Script.Require (to invoke AMD require method)
    • Added DataContractAttribute/DataMemberAttribute/IgnoreDataMemberAttribute to facilitate code sharing of data model types with .net code
  • MSBuild task changes
    • Added support for a CrunchScripts property in csproj, which determines whether minimized .min.js script file is produced.
    • Removed generation of doc-comments into script
  • Library Changes
    • Knockout: Rename DependentObservable to ComputedObservable
    • jQuery: Added Unique
  • Improved tools workflow for deploying scripts from script# projects into web projects
    • Simply use project-to-project references to have web project reference the script# project
    • Add the ScriptSharp.Runtime nuget package to web project. This brings in ss.js and related scripts, and also enumerates project references to find script# projects, and copy over generated scripts into the web project as content items.
  • Bug Fixes
    • [git #223] Special case generation of date equality checks to make them work as expected

0.7.6

Changes rolled into 0.8 from a release perspective

  • Removed script loading APIs from Script class in mscorlib.dll to Script.Web.dll
  • Removed script startup functionality from mscorlib.js ... all script loading is now in ssloader.js
  • Moved Script.Alert/Confirm/Prompt from mscorlib and moved them to Window in Script.Web
  • Moved SetTimeout, SetInterval and ClearTimeout, ClearInterval from Window object to Script object in mscorlib.
  • Removed some methods from Type as part of cleanup (AddHandler, GetProperty, RemoveHandler, SetProperty, IsEnum, IsFlags, IsNamespace, GetInterfaces, Parse)
  • Removed window dependency in mscorlib.js (so it can be used in different script hosts, eg. node.js)
  • Debug class now maps directly to console at runtime
  • Moved GetField, HasField, DeleteField, HasMethod, InvokeMethod, CreateInstance, GetScriptType off Type and onto Script while HasProperty, GetProperty, SetProperty, AddHandler, RemoveHandler are gone.
  • Optimize generation of static ctors to use a function scope only when static ctors have a local variable reference. Should help optimize generation of jQuery scripts, by reducing one extra function scope.
  • Removed Aggregate method from Array, ArrayList and List. Use Reduce instead.
  • Removed the corresponding custom implementation from mscorlib.js.
  • Issues Fixed:
    • [git #131] Correctly detect member references within array initializers
    • [git #161] Add Slice, Splice, Shift, Unshift, Reduce, ReduceRight to Array, ArrayList and List.
    • [git #228] Restore ability to generate public resource classes (Change Custom Tool property of resx file to ResxPublicScriptGenerator)
    • [git #230] Add String.IsNullOrWhitespace
    • [git #234] Knockout API update - added CompareResult status enum

0.7.5.0

  • DOM metadata update (readyState property on Document, plugins on Navigator)
  • jQuery API update (on/off methods)
  • Knockout API updates for missing APIs
  • Addition of support for jQuery validation plugin
  • jQueryUI added!
  • Issues Fixed:
    • [git #130] ReadyState property on Document
    • [git #132] DOM metadata for plugins
    • [git #139] jQuery on/off APIs
    • [git #141] Bing maps metadata missing APIs
    • [git #145] Knockout additions
    • [git #152] Knockout additions
    • [git #155] ReadyState property on Document
    • [git #156] Changed projects (incl. templates) to target .net framework v2.0
    • [git #166] Fix generic Deffered API on jQuery
    • [git #169] Missing jQuery API overload added
    • [git #170] Fix bing maps metadata bug
    • [git #173] Fix StringBuilder and appending empty string/isEmpty interaction
    • [git #178] Issues with string extensions
    • [git #180] Added workaround: Better error message for namespace-qualified name gotcha
    • [git #183] Various DOM metadata additions (eg. ClassList)
    • [git #187] Support for writing 'new Image()'
    • [git #189] Fixed jQuery.when metadata
    • [git #201] Strongly typed some Knockout API (KnockoutMapping)
  • Nuget packages for compiler, and individual import libraries
  • VSIX-based approach for getting script# and associated templates
  • Breaking changes:
    • In a csproj, the TemplateFile property has been changed to ScriptTemplate
    • When creating a project there is no prompt to setup a DeploymentPath ... but for now, msbuild support continues to exist (via manual edit) ... will potentially be replaced eventually.
    • No more support for WebAppParitioning. If you were compiling multiple script files out of a single c# project, this feature is gone. You can switch your msbuild scripts to use the ScriptCompilerExecTask, instead of ScriptCompilerTask and invoke the compiler multiple times for each script file, passing in exactly the right set of sources for each script file to be generated.
    • Removed Script.Windows.dll and gadget project

0.7.4.0

  • Fix/update bing maps metadata bug
  • Fix observable bug where access to an observed property without an observer registration would drop existing observers.
  • Remove /copyRefs flag from ssc.exe (script references are no longer copied to output folder). Same applies to ScriptCompilerExec task. The normal ScriptCompilerTask continues to provide this capability.
  • Added Sharpen.dom.js - a minimal set of helper APIs on top of HTML5 DOM APIs.
  • Some enum related changes:
    • ToString/Enum parsing support removed (it didn't work for internal enums anyway)
    • ToString on named enums (and on strings) skipped as it is redundant
    • Inline enum values in generated script
    • Skip generating internal enum types
  • [git #25] Importing multi-dimensional arrays
  • [git #56] Switch statement when used with more then 6 cases will generate a compile error
  • [git #62] Compile error due to assembly name sort order (with generic types being imported, assembly load order starts to matter)
  • [git #66] Support Nullable.GetValueOrDefault which is needed for ?? operator on nullables.
  • [git #67] BREAKING CHANGE: DateTime -> Date. Date is also no longer a value type. (partially fixes #67, and also makes Date more representative of script semantics which are not that of a value type)
  • [git #84] Raise error for code which calls Type.CreateInstance with the results of a method call/property access directly.
  • [git #92] Don't generate internal consts since their values have been inlined even in debug builds (for symmetry with release builds). Also, at the same type skip generating types for internal enums marked as Named/NumericValues, since their values have been inlined as well. Also fixes [git #42] indirectly.
  • [git #93] Error compiling cross-referenced projects in 0.7.3. Fix by requiring explicit references, and reporting failure on not doing so instead of silent failure (this is temporary ... there must be a better msbuild way of including transitive closure of assemblies, but even referencing indirect references in the targets file raises an error to include explicit references).
  • [git #94] Raise error for code which calls Type.CreateInstance with the results of a method call/property access directly.
  • [git #96] Handle '+' unary operator
  • [git #97] Unable to generate code for projects that don't reference Script.Web.dll.
  • [git #103] Fix generation of custom delegates to use "Function" as generated script name
  • [git #107] ScriptAlias is not respected on types defined in the current assembly
  • [git #114] Window.ApplicationCache.Status.ToString() generates invalid JavaScript

0.7.3.0

  • [git #71] Fix formatting of GMT dates
  • [git #70] Support for const decimal
  • [git #69] Fix LocaleFormat typo
  • [git #76] Compiler crash in 0.7.2 defining decimal type with non-integer value
  • [git #75] Defining a local variable 'ss' hides the Script# ss global
  • [git #60] List constructor with params for creating literal array
  • [git #74] Fix date formatting to make it more in sync with .net
  • [git #63] Fix internal partial class generation
  • [git #65] Calling ToString() on a constant breaks minified script
  • [git #73] Creating Record objects from another library
  • [git #80] The decimal type is missing the Parse method
  • [git #84] if( is ) not compiled properly when is a delegate.
  • Enable creating derived jQueryEvent objects
  • Knockout API updates (ability to create binding handlers for example)
  • Propagate ScriptNamespace to generic instance class
  • DOM API metadata updates
  • Separate out msbuild tasks into ScriptSharp.Build.dll and Visual Studio generators into ScriptSharp.VisualStudio.dll

0.7.2.0

  • Revert null equality check to non-falsey check
  • Switch String.empty references to in generated script to string literal
  • Fix delegate optimization bug involving Type.InvokeMember with first parameter being null
  • Remove hack in metadata importer to try import generic types first (instead design imported apis carefully so type don't have instance of generic type as return type of a member)
  • To fix above bug:
    • jQueryXmlHttpRequest replaced with jQueryDataHttpRequest and jQueryXmlHttpRequest is now non-generic
    • Added non-generic versions of various jQuery ajax callbacks
  • Improve jQuery deferred APIs
  • jQuery 1.6.1 APIs and other missing APIs added
  • [git #36] Misc jQuery apis added
  • [git #50] Fix GeoLocation API: WatchCurrentPosition -> WatchPosition
  • Added AudioElement
  • Added Tuple, Callback, various component model interfaces
  • FxCop rules for CSS Selector validation, Script.Literal usage and public fields
  • [git #45] Apply [PreserveName] semantics in debug builds as well
  • [git #52] DocumentFragment related API updates
  • [git #54] DateTime metadata update

0.7.1.0

  • [git #19] Add CssFloat to Style
  • [git #22] Fix issue with importing generic delegates - generic types were getting created before their members were being imported.
  • [git #20] If/While/For statements can have an no body statement when compiling in release mode, and the only statement in source code is a debug-conditional statement.
  • [git #27] Optimize generated script for checking equality against null, 0, true/false, empty string by generating a check that works against false-y values
  • [git #28] Fix jQueryAjaxOptions metadata
  • [git #29] Add Select() to InputElement
  • Added Observable and mscorlib infrastructure for observables, and change notification
  • Added ObservableCollection and ObservableCollection along with mscorlib implementation
  • Added Script.IsValue (equivalent of !Script.IsNullOrUndefined)
  • Added Nullable and T? syntax support; .HasValue -> Script.IsValue, .Value is a no-op at runtime
  • Added ElementQuery, ElementListQuery, and ElementReference helper classes for emitting script expressions when using AddScriptlet

0.7.0.2

  • [git #7] Add missing jQueryObject.Html overload
  • Add Document.ElementFromPoint
  • DOM events API added
  • [git #3] Fixed anonymous delegation creation by detecting use of 'this' context for variable declaration
  • [git #9] String literal optimization
  • [git #11] Added SCRIPTSHARP to the defines list in the project template
  • Remove Script.Windows.js and move the functionality into gadget project template.
  • Add ss.init/ss.ready to mscorlib.js as well, in case page is not using ssloader.js.

0.7.0.1

  • [git #4] Fixed typo in mscorlib.js
  • Fix typo in web.config in nuget package
  • Fix bug with jQuery.InArray signature

0.7.0.0

  • Added basic generic support - ability to consume some generic types such as List, Dictionary<K, V>, Action, Func etc.
  • Fix bug with NamedValues enum not working with [ScriptName]
  • New script loader
  • New asp.net mvc integration
  • Updates to project templates to match new script loader
  • Various metadata updates - eg. Canvas, Image, Document etc.
  • Replace ContextualCallback with Action
  • Replace CancelEventHandler with EventHandler
  • Replace Delegate.Null -> Delegate.Empty
  • ScriptCompilerTask msbuild task removes "DEBUG" define for release build even when building in Debug mode from an msbuild perspective.
  • Some namespace changes (eg. System.Globalization)
  • Nuget package
  • Replace XmlDocumentParser class with parseXml method