GithubHelp home page GithubHelp logo

anaisbetts / sassandcoffee Goto Github PK

View Code? Open in Web Editor NEW
199.0 199.0 37.0 27.08 MB

SassAndCoffee adds support in ASP.NET MVC to (you guessed it!) Sass/SCSS and CoffeeScript

Home Page: http://blog.paulbetts.org/index.php/2011/06/06/new-release-sassandcoffee-0-9-now-not-glacially-slow/

License: Microsoft Public License

Shell 0.07% C# 8.53% CSS 0.06% ASP 0.01% CoffeeScript 0.02% TypeScript 0.04% JavaScript 61.63% PowerShell 0.10% Ruby 29.04% XSLT 0.49%

sassandcoffee's People

Contributors

anaisbetts avatar austinsc avatar dylanbeattie avatar grumpydev avatar kogir avatar mmanela avatar nathanpalmer avatar radiy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sassandcoffee's Issues

Create a SASS compiler into a standalone executable

Will it be possible and feasible to package the Sass compiler into a standalone executable (and without installing Ruby)?

It already exist for the .Less files (with the dotLess project) and CoffeeScript, but not for Sass, which is I think a big lack for this metalanguage.

I thinks a command line compiler should give us a lots of new ways to compile Scss files and to make solutions self-contained. For example to kick off the executable compiler as a build task, or with a PowerShell script (would be very useful in the case of a SharePoint project).

We could use it as this way:
$(SolutionDir)Tools\sass.compiler.exe $(ProjectDir)\css\styles.scss $(ProjectDir)\css\styles.css -minified

Thanks!
Etienne.

Avoid writing and loading V8Bridge_x86.dll to temp

Looking at this code, the V8Bridge dll is loaded from resources, then written to the temp folder before being loaded with Assembly.Load(). This currently fails on AppHarbor (where I happen to work) for unknown reasons. Is there any way SassAndCoffee could just load the assembly from resource directly? I tried to poke around a little, but couldn't get it to work.

The relevant code is here:
https://github.com/xpaulbettsx/SassAndCoffee/blob/master/SassAndCoffee.Core/JavascriptInterop.cs#L168

Michael

Add support for :load_paths

We are porting a large web system from Ruby to .NET. We make extensive use of compass mixins. Can you add support for this please?

I dug around the code a bit, and was able to 'hack' this by modifying in SassCompiler the line:

_scssOption = _engine.Execute("{:cache => false, :syntax => :scss}");

to

_scssOption = engine.Execute(@"{:cache => false, :syntax => :scss, :load_paths => [""C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/compass-0.12.2/frameworks/compass/stylesheets""]}");

Of course the actual solution should not hardcode the path. I wasn't able to build the whole solution, so can't offer a pull request. Plus I'm not sure how you'd want to handle the actual compass mixins? Should they be distributed with the Nuget package? Or downloaded separately and pointed to using a configuration value.

Could not load type 'SassAndCoffee.AspNet.SassInterceptorModule'.

I am deploying my project on Azure websites using Deployment from Source Control. NuGet package restore is switched on and everything was working as expected. I installed SassAndCoffee.AspNet using NuGet and built the application and then deployed to Azure using git.

I received this error:

Could not load type 'SassAndCoffee.AspNet.SassInterceptorModule'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

        Exception Details: System.Web.HttpException: Could not load type 'SassAndCoffee.AspNet.SassInterceptorModule'.

        Source Error:

        An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

        Stack Trace:


        [HttpException (0x80004005): Could not load type 'SassAndCoffee.AspNet.SassInterceptorModule'.]
           System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +9793404
           System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +38

        [ConfigurationErrorsException: Could not load type 'SassAndCoffee.AspNet.SassInterceptorModule'.]
           System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +348
           System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, Boolean checkAptcaBit) +19
           System.Web.Configuration.Common.ModulesEntry.SecureGetType(String typeName, String propertyName, ConfigurationElement configElement) +39
           System.Web.Configuration.Common.ModulesEntry..ctor(String name, String typeName, String propertyName, ConfigurationElement configElement) +42
           System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList) +158
           System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +950
           System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +82
           System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
           System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336
           System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296

        [HttpException (0x80004005): Could not load type 'SassAndCoffee.AspNet.SassInterceptorModule'.]
           System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9930568
           System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
           System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254

Sorry about the presentation of the stack trace!

.combine not working for jQuery.validate.min.js

Hi Paul I have just downloaded and ran the SassAndCoffee.WebTest website.

I changed it to use the minified javascript and get errors on page load in firebug

<script src="@Url.Content("~/Scripts/prod_all.js")" type="text/javascript"></script>

I think there is a problem with the way jQuery.validate.min.js and jquery.validate.unobtrusive.min.js have been minified?

Cheers
Jake

Add support for $warn and $debug

Would be nice if $warn and $debug would write to VS Output Window. I think:

$warn == Trace.WriteLine
$debug == Debug.WriteLine

Awesome if we could get this in the Browser's output window, but that's a significant effort, in VS's window is plenty for me.

Two crash reports using .combine

Currently only using .combine for javascript files - these errors have been generated multiple times since installing about a week ago on the web server using SassandCoffee 1.0 on ASP.NET MVC3 on IIS 7.5 on Windows Server 2008 R2 x64.


Application: w3wp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Reflection.TargetInvocationException
Stack:
at System.RuntimeTypeHandle.CreateInstance(System.RuntimeType, Boolean, Boolean, Boolean ByRef, System.RuntimeMethodHandleInternal ByRef, Boolean ByRef)
at System.RuntimeType.CreateInstanceSlow(Boolean, Boolean, Boolean)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean, Boolean, Boolean, Boolean)
at System.Activator.CreateInstance(System.Type, Boolean)
at SassAndCoffee.Core.JS.CreateJavascriptCompiler()
at SassAndCoffee.Core.JavascriptBasedCompiler.<.cctor>b__0()
at System.Threading.ExecutionContext.runTryCode(System.Object)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode, CleanupCode, System.Object)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.ThreadHelper.ThreadStart()


An unhandled exception occurred and the process was terminated.

Application ID: /LM/W3SVC/1/ROOT

Process ID: 9300

Exception: System.Reflection.TargetInvocationException

Message: Exception has been thrown by the target of an invocation.

StackTrace: at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at SassAndCoffee.Core.JS.CreateJavascriptCompiler()
at SassAndCoffee.Core.JavascriptBasedCompiler.<.cctor>b__0()
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

InnerException: System.AccessViolationException

Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

StackTrace: at v8.HandleScope.{ctor}(HandleScope* )
at NativeV8ScriptCompiler.{ctor}(NativeV8ScriptCompiler* )
at V8Bridge.V8ScriptCompiler..ctor()

Command line interface

I would love to be able to use Sass and Coffee on a appharbor hosted site but they don't give you disk access and I am not sure of any other limitations there may be in generating files on appharbor.

What would be involved in building a command line tool that we can use to statically generate css or js files?

System.NullReferenceException on Mono (Jurassic removed)

It seems that Jurassic dependency was removed and SassAndCoffee is no longer compatible with (it uses only ie com objects) mono. Please bring back mono compatibility (with Jurassic, Jint whatever).

error:
System.NullReferenceException: Object reference not set to an instance of an object
at SassAndCoffee.JavaScript.IEJavaScriptRuntime.Initialize () [0x00000] in :0
at SassAndCoffee.JavaScript.JavaScriptCompilerBase.Initialize () [0x00000] in :0
at SassAndCoffee.JavaScript.JavaScriptCompilerBase.Compile (System.String source, System.Object[] args) [0x00000] in :0
at SassAndCoffee.JavaScript.JavaScriptCompilerContentTransformBase.Execute (SassAndCoffee.Core.ContentTransformState state, System.Object[] args) [0x00000] in :0
at SassAndCoffee.JavaScript.CoffeeScript.CoffeeScriptCompilerContentTransform.Execute (SassAndCoffee.Core.ContentTransformState state) [0x00000] in :0
at SassAndCoffee.Core.ContentPipeline.ProcessRequest (System.String physicalPath) [0x00000] in :0
at SassAndCoffee.AspNet.PipelineHandler.ProcessRequest (System.Web.HttpContext context) [0x00000] in :0
at System.Web.HttpApplication+c__Iterator6.MoveNext () [0x00000] in :0
at System.Web.HttpApplication.Tick () [0x00000] in :0

High RAM/CPU use

I tried deploying an app using SassAndCoffee today. When I fired up the site in IIS, and made an initial request, memory usage spiked to about 700MB, and pegged one of the cores. The process itself was non-responsive. After a bit of trial and error, I disabled SassAndCoffee, and the memory/cpu usage went down to about 100MB, and minimal CPU.

No files were written to App_Data. As a test, I set the perms on App_Data to Everyone:Full Control; it didn't make a difference.

Is there anyway to get some sort of diagnostic information out of SassAndCode to figure out what's going on?

I successfully ran the same app build on a staging server prior to moving it out to the production server. There were zero issues on the staging server, which has a similar, but not identical, configuration as the production server. Both are Win2K8 R2/IIS 7.5.

All code for the app is available here: http://code.geekwerks.ca/clientprefs

Far Future Caching

It looks as though SassAndCoffee does not currently support far future caching. From what I can tell based on a brief inspection of the source, it currntly sets a max-age header to no longer than 1 hour. I don't see a codeless way to override that. Just curious if I am missing something, if this is intentional, or if its just something no one has gotten to.

Very slow compilation of SCSS scripts

Hi,

I have a bundle transform written using SassaAndCoffee. Initially it worked great but now it takes 42s to process 500 lines of SCSS code. I did a bit of profiling and it looks like most of the time is spent in Ruby code so I don't know if there is anything that can be done about it.
Results:
Run1 :42s
Run2: 23s
Run3: 22s

I'm more than happy to help but need some hints to get started.
Test app can be downloaded from here: http://dl.dropbox.com/u/7579883/SassPerfTest.zip

Thanks

Pawel

IIS hanging on CS requests

Hi, I have just deployed a web app that's using coffeescript compilation and IIS is hanging on requests for these files. When I look at incoming requests for the worker process there are a number of requests for js files which stay in either the ExecuteRequestHandler or ResolveRequestState for a v. long time. Any thoughts on what could be the issue (It works fine in my local environment)

Set default build action for .sass, .scss and .coffee files to "content"

According to http://blog.andreloker.de, this can be accomplished by placing a file with a pkgdef extension anywhere in VS's Extensions directory with this content:

; Visual Basic
[$RootKey$\Projects{F184B08F-C81C-45f6-A57F-5ABD9991F28F}\FileExtensions.coffee]
"DefaultBuildAction"="Content"

[$RootKey$\Projects{F184B08F-C81C-45f6-A57F-5ABD9991F28F}\FileExtensions.sass]
"DefaultBuildAction"="Content"

[$RootKey$\Projects{F184B08F-C81C-45f6-A57F-5ABD9991F28F}\FileExtensions.scss]
"DefaultBuildAction"="Content"

; C#
[$RootKey$\Projects{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\FileExtensions.coffee]
"DefaultBuildAction"="Content"

[$RootKey$\Projects{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\FileExtensions.sass]
"DefaultBuildAction"="Content"

[$RootKey$\Projects{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\FileExtensions.scss]
"DefaultBuildAction"="Content"

IndexOutOfRangeException

We use the SassCompiler in our existing css combination and minification pipeline to compile scss files to css.
Our integration looks like this:

using (var compiler = new SassCompiler())
    {
        return compiler.Compile(AppDomain.CurrentDomain.BaseDirectory + path, false, new List<string>());
    }

In production we get the following error several times a day, but i have not been able to reproduce it.
I don't know much about IronRuby, but i suppose this is either a problem in IronRuby or the sass_in_one.rb file.

Any hints as to what i should investigate is much appreciated.

Time:
09.03.2012 09:42:44

URL:
http://www.trustpilot.de/MinSources?s=/Styles/shared/standard.css;/Styles/domains/index.css&t=129736951656140000

Error:
IndexOutOfRangeException: Index was outside the bounds of the array.

StackTrace:
at Microsoft.Scripting.Interpreter.ThrowInstruction.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
at IronRuby.Runtime.Calls.RubyObjectMethodDispatcherWithScope.Invoke[TScope](CallSite callSite, TScope scope, Object self)
at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
at Microsoft.Scripting.Interpreter.DynamicInstruction3.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1) at IronRuby.Runtime.Calls.RubyObjectMethodDispatcherWithScope.Invoke[TScope](CallSite callSite, TScope scope, Object self) at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at Microsoft.Scripting.Interpreter.DynamicInstruction3.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
at IronRuby.Runtime.Calls.RubyObjectMethodDispatcherWithScope.Invoke[TScope](CallSite callSite, TScope scope, Object self)
at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
at Microsoft.Scripting.Interpreter.DynamicInstruction3.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3) at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at CallSite.Target(Closure , CallSite , Object , String , Object ) at SassAndCoffee.Ruby.Sass.SassCompiler.Compile(String path, Boolean compressed, IList1 dependentFileList)
at Trustpilot.WebExtension.Compression.MinSources.CompileScss(String path) in d:\TeamcityAgent\work\Stormhawk\Lib\WebExtension\Compression\MinSources.cs:line 302
[...]

Changes to imported sass files don't trigger a recompile

In application.scss I'm importing a bunch of partials: _screen.scss, _mobile.scss, _ie.scss, and _print.scss. Within my markup, I'm only referencing application.css. This works well until I make a change to any of the partials. The CSS only seems to be recompiled when a change to application.scss is detected.

Error in [Microsoft JScript runtime error]: Out of stack space

After upgrading from 1.x to 2.x I'm now getting the following error when attempting to retrieve any js file. However Sass/Css is working ok and all 5 Core tests are passing. This happens either when upgrading via Nuget to 2.0 or via Git to 2.1.

I suspect this issue was introduced in v2.x.

Please let me know if you need any more info.

Thanks,
Andy.

[ActiveScriptException: Error in [Microsoft JScript runtime error]:
Out of stack space
at line 8(154022)
Error Code: -2146828260 (0x800A001C)
Error WCode: 0

]
SassAndCoffee.JavaScript.IEJavaScriptRuntime.ThrowError() in P:\DEV.OPENSOURCE\DotNet\SassAndCoffee\SassAndCoffee.JavaScript\IEJavaScriptRuntime.cs:90
SassAndCoffee.JavaScript.IEJavaScriptRuntime.ExecuteFunction(String functionName, Object[] args) in P:\DEV.OPENSOURCE\DotNet\SassAndCoffee\SassAndCoffee.JavaScript\IEJavaScriptRuntime.cs:67
SassAndCoffee.JavaScript.JavaScriptCompilerBase.Compile(String source, Object[] args) in P:\DEV.OPENSOURCE\DotNet\SassAndCoffee\SassAndCoffee.JavaScript\JavaScriptCompilerBase.cs:35
SassAndCoffee.JavaScript.JavaScriptCompilerContentTransformBase.ExecuteWithArguments(ContentTransformState state, Object[] args) in P:\DEV.OPENSOURCE\DotNet\SassAndCoffee\SassAndCoffee.JavaScript\JavaScriptCompilerContentTransformBase.cs:33
SassAndCoffee.JavaScript.CoffeeScript.CoffeeScriptCompilerContentTransform.Execute(ContentTransformState state) in P:\DEV.OPENSOURCE\DotNet\SassAndCoffee\SassAndCoffee.JavaScript\CoffeeScript\CoffeeScriptCompilerContentTransform.cs:45
SassAndCoffee.Core.ContentPipeline.Execute(String physicalPath) in P:\DEV.OPENSOURCE\DotNet\SassAndCoffee\SassAndCoffee.Core\Pipeline\ContentPipeline.cs:63
SassAndCoffee.Core.InvalidatingCache.GetOrAdd(String key, Func`2 generator) in P:\DEV.OPENSOURCE\DotNet\SassAndCoffee\SassAndCoffee.Core\Caching\InvalidatingCache.cs:64
SassAndCoffee.Core.ContentPipeline.ProcessRequest(String physicalPath) in P:\DEV.OPENSOURCE\DotNet\SassAndCoffee\SassAndCoffee.Core\Pipeline\ContentPipeline.cs:50
SassAndCoffee.AspNet.PipelineHandler.ProcessRequest(HttpContext context) in P:\DEV.OPENSOURCE\DotNet\SassAndCoffee\SassAndCoffee.AspNet\PipelineHandler.cs:38
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +625
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +270

Intermittent NullReference and Sass::SyntaxError exceptions

My server application event logs are showing the following errors which appear to occur intermittently and usually after a period of inactivity. In each case, immediately resubmitting the same request then works without error.

Running v2.0 with file cache enabled and output cache disabled.

Exception information: 
Exception type: IndexOutOfRangeException 
Exception message: Index was outside the bounds of the array.
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at IronRuby.Runtime.RubyUtils.RecursionTracker.TrackObject(Object obj)
at IronRuby.Builtins.RubyArray.GetHashCode(UnaryOpStorage hashStorage, ConversionStorage`1 fixnumCast, IList self)
at Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
at IronRuby.Runtime.EqualityComparer.System.Collections.Generic.IEqualityComparer<System.Object>.GetHashCode(Object obj)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at IronRuby.Runtime.RubyUtils.SetHashElement(RubyContext context, IDictionary`2 obj, Object key, Object value)
at IronRuby.Builtins.HashOps.CreateSubclass(ConversionStorage`1 toAry, RubyClass self, IList list)
at Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3)
at Microsoft.Scripting.Interpreter.DynamicInstruction`4.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2)
at IronRuby.Runtime.Calls.RubyObjectMethodDispatcherWithScope`1.Invoke[TScope](CallSite callSite, TScope scope, Object self, T0 arg0)
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
at Microsoft.Scripting.Interpreter.DynamicInstruction`4.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2)
at IronRuby.Runtime.Calls.RubyObjectMethodDispatcherWithScopeAndBlock`1.Invoke[TScope,TProc](CallSite callSite, TScope scope, Object self, TProc proc, T0 arg0)
at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
at Microsoft.Scripting.Interpreter.DynamicInstruction`5.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
at IronRuby.Runtime.RubyScriptCode.Run(Scope scope, Boolean bindGlobals)
at SassAndCoffee.Ruby.Sass.SassCompiler.Initialize()
at SassAndCoffee.Ruby.Sass.SassCompiler.Compile(String path, Boolean compressed, IList`1 dependentFileList)
at SassAndCoffee.Ruby.Sass.SassCompilerContentTransform.Execute(ContentTransformState state)
at SassAndCoffee.Core.ContentPipeline.ProcessRequest(String physicalPath)
at SassAndCoffee.AspNet.PipelineHandler.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)


Exception information: 
Exception type: SystemException$1 
Exception message: Sass::SyntaxError
at Microsoft.Scripting.Interpreter.ThrowInstruction.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.HandleException(InterpretedFrame frame, Exception exception)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2)
at IronRuby.Runtime.Calls.RubyObjectMethodDispatcherWithScope`1.Invoke[TScope](CallSite callSite, TScope scope, Object self, T0 arg0)
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
at IronRuby.Runtime.Calls.RubyObjectMethodDispatcherWithScope`1.Invoke[TScope](CallSite callSite, TScope scope, Object self, T0 arg0)
at IronRuby.Builtins.KernelOps.SendMessage(RubyScope scope, Object self, String methodName, Object arg1)
at Microsoft.Scripting.Interpreter.FuncCallInstruction`5.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run5[T0,T1,T2,T3,T4,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
at Microsoft.Scripting.Interpreter.DynamicInstruction`5.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3)
at Microsoft.Scripting.Interpreter.FuncCallInstruction`6.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3)
at Microsoft.Scripting.Interpreter.DynamicInstruction`4.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
at IronRuby.Runtime.Calls.RubyObjectMethodDispatcherWithScope.Invoke[TScope](CallSite callSite, TScope scope, Object self)
at Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
at IronRuby.Runtime.Calls.RubyObjectMethodDispatcherWithScope.Invoke[TScope](CallSite callSite, TScope scope, Object self)
at Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
at IronRuby.Runtime.Calls.RubyObjectMethodDispatcherWithScope.Invoke[TScope](CallSite callSite, TScope scope, Object self)
at Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3)
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
at CallSite.Target(Closure , CallSite , Object , String , Object )
at SassAndCoffee.Ruby.Sass.SassCompiler.Compile(String path, Boolean compressed, IList`1 dependentFileList)

Caching broken under certain configurations in v2.1(pre)

After upgrading from 1.x to 2.1(pre) the caching seems to be broken under certain configurations...

    SassAndCoffee   IIS Output      SASS/CSS    Coffee/JS
Id  cache type      Caching ?       working ?   working ?   Notes

1   NoCache         N               Y           Y           slow
2   NoCache         Y               Y           N
3   File            N               N           Y
4   File            Y               N           N
5   InMemory        N               Y           Y           slow after change then fast
6   InMemory        Y               N           N

A result of 'N' means a stale file gets served.

I'll use configuration #5 for now. Please let me know if you need more info.

Cheers,
Andy.

xunit console runner hangs after running coffee script tests

I'm using v1.1.5 of SassAndCoffee.Core (the latest nuget version) and have Unit Tests around my coffee compilation. They all pass and everything works fine with test driven.net but after all my tests pass using the xunit console runner in my build script, XUnit hangs and the entire build freezes. I've tried calling JS.Shutdown() and new CoffeeScriptCompiler().Dispose() but the runner still hangs.

I've noticed this project uses xunit as well and am curious if you have seen this. BTW: I've testing on both 32 and 64 bit laptop.

Tests are here:
https://github.com/mwrock/RequestReduce/blob/master/RequestReduce.Facts/SassLessCoffee/CoffeeHandlerFacts.cs

Class tested:
https://github.com/mwrock/RequestReduce/blob/master/RequestReduce.SassLessCoffee/SassAndCoffeeHandler.cs

Thanks!

PipelineHandler should NOT send out 404's

Specifically this code:

if (result == null) {
    response.StatusCode = (int)HttpStatusCode.NotFound;
    return;
}

It's a little arrogant to think that the PipelineHandler is the only IHttpHandler that could possibly handle that filetype.

This leads to fun bugs, such as StackOverflow's MiniProfiler no longer working, because it requests a file such as:

/mini-profiler-resources/includes.css?v=sdjkfsdf

Which PipelineHandler (when trying to handle .css) says "oh, it doesn't exist" and sends a 404, killing the response instantly.

Intermittent IndexOutOfRangeException causing 100% cpu

My server event log shows the following error after a request causes the cpu to peg at 100% requiring a kill of w3wp.exe, at which point a new w3wp.exe starts and the request completes.

Running v2.0 with file cache enabled and output cache disabled.

I've logged it here as a separate issue to aid with tracking. Hope that's ok.

Cheers!
Andy.

Exception information: 
Exception type: IndexOutOfRangeException 
Exception message: Index was outside the bounds of the array.
at System.Collections.Generic.Dictionary`2.Resize()
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at IronRuby.Runtime.RubyUtils.RecursionTracker.TrackObject(Object obj)
at IronRuby.Builtins.RubyArray.GetHashCode(UnaryOpStorage hashStorage, ConversionStorage`1 fixnumCast, IList self)
at Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
at IronRuby.Runtime.EqualityComparer.System.Collections.Generic.IEqualityComparer<System.Object>.GetHashCode(Object obj)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at IronRuby.Runtime.RubyUtils.SetHashElement(RubyContext context, IDictionary`2 obj, Object key, Object value)
at IronRuby.Runtime.RubyUtils.SetHashElements(RubyContext context, Hash hash, Object[] items)
at Microsoft.Scripting.Interpreter.FuncCallInstruction`3.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
at IronRuby.Runtime.RubyScriptCode.Run(Scope scope, Boolean bindGlobals)
at SassAndCoffee.Ruby.Sass.SassCompiler.Initialize()
at SassAndCoffee.Ruby.Sass.SassCompiler.Compile(String path, Boolean compressed, IList`1 dependentFileList)
at SassAndCoffee.Ruby.Sass.SassCompilerContentTransform.Execute(ContentTransformState state)
at SassAndCoffee.Core.ContentPipeline.ProcessRequest(String physicalPath)
at SassAndCoffee.AspNet.PipelineHandler.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

De-duplicate cache requests

If multiple requests come in for a non-cached resource, start generation on the first request and hold all other requests for the same resource until they can be served from the new, cached copy.

Right now this is most noticeable when three or four Sass/SCSS requests for the same thing come in concurrently, and they all spin up Ruby runtimes at the same time.

CoffeeScript files can't have the same name

When using a .combine manifest, an issue occurs when 2 or more files have the same name, e.g.

app/feature/main.js
app/main.js

Perhaps an md5 should be used for the App_Data files instead of a timestamp?

IIS hanging on CS requests

Hi, I have just deployed a web app that's using coffeescript compilation and IIS is hanging on requests for these files. When I look at incoming requests for the worker process there are a number of requests for js files which stay in either the ExecuteRequestHandler or ResolveRequestState for a v. long time. Any thoughts on what could be the issue (It works fine in my local environment)

Bring back extensible caching

IIS caching is insufficient. Bring back the old extensible caching support, but this time with proper invalidation.

Longer precompiled JS files not reliably returned

To repeat the problem in chrome, get an existing JS file, say unminified jQuery multiple times.

In Chrome, about on alternating requests I get the following:

This webpage is not available
The webpage at https://localhost:44300/Scripts/jquery-1.5.2.js might be temporarily down or it may have moved   permanently to a new web address.
Error 330 (net::ERR_CONTENT_DECODING_FAILED): Unknown error.

In FF 3.6 I get

Content Encoding Error
The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.

and IE 10 is

 Internet Explorer cannot display the webpage 

I've tried to find the source of the error, so far no luck.

Support CSS passthroughs

Consider implementing something similar to SassAndCoffee.Core/Compilers/JavascriptPassthroughCompiler.cs for CSS files. In an IIS6 environment, I have registered the .css file suffix to the aspnet_isapi.dll executable (disabling the verification that the file exists). This works wonderfully for .css urls which are handled by the SassFileCompiler. However, for actual .css files where no corresponding .sass or .scss file exists, an empty response is returned to the client.

Need a way to enable Sass' debug information

Sass' (or Compass') debug information in conjunction with FireSass is one of Sass' biggest advantages. It shows you the file names and line numbers of the source files inside Firebug. It's almost as if Firefox would understand Sass directly.

There absolutely needs to be a way to enable it. It's an essential feature.

Problem combining + minifying jQuery with plugins

I'm using jQuery together with jQuery.tmpl and would like to minify and combine them into a single .js file referenced by the web app. I've added them to a base.combine file that looks like this:

jquery-1.6.2.min.js
jQuery.tmpl.min.js

However, when the page is loaded I get a Javascript error that says:

Uncaught TypeError: undefined is not a function

If I instead use pre-minified versions of the files (which I've named *.minorig.js) like this...

jquery-1.6.2.minorig.js
jQuery.tmpl.minorig.js

...everything works. So that's a workaround, but it would feel a lot cleaner to let SassAndCoffee handle all minifications.

fallback to jurassic should be invoked on 32 bit, not 64

From the comment i would guess this check in Core.JS should be inverted?
// Jurassic completely bites it on 64-bit, we just need to abort
if (Environment.Is64BitProcess == false) {
throw;
}

The jurassic fallback seems to work for me on 32 bit instance when i change this code to
if (Environment.Is64BitProcess) {
throw;
}

Ruby Sass compiler chokes on Unicode characters in ASP.NET MVC 4 default stylesheet

Taking my first steps with SassAndCoffee, I created a new ASP.NET MVC 4 Internet project, installed the NuGet package, renamed /Content/Site.css to /Content/Site.scss and ran the project. I got the following:

[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index]
    Microsoft.Scripting.Interpreter.ThrowInstruction.Run(InterpretedFrame frame) +156
    Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) +211
    Microsoft.Scripting.Interpreter.LightLambda.Run2(T0 arg0, T1 arg1) +276
    IronRuby.Runtime.Calls.RubyObjectMethodDispatcherWithScope.Invoke(CallSite callSite, TScope scope, Object self) +131
    Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame) +253
    Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) +211
    Microsoft.Scripting.Interpreter.LightLambda.Run2(T0 arg0, T1 arg1) +276
    IronRuby.Runtime.Calls.RubyObjectMethodDispatcherWithScope.Invoke(CallSite callSite, TScope scope, Object self) +131
    Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame) +253
    Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) +211
    Microsoft.Scripting.Interpreter.LightLambda.Run2(T0 arg0, T1 arg1) +276
    IronRuby.Runtime.Calls.RubyObjectMethodDispatcherWithScope.Invoke(CallSite callSite, TScope scope, Object self) +131
    Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame) +253
    Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) +211
    Microsoft.Scripting.Interpreter.LightLambda.Run4(T0 arg0, T1 arg1, T2 arg2, T3 arg3) +328
    SassAndCoffee.Ruby.Sass.SassCompiler.Compile(String path, Boolean compressed, IList`1 dependentFileList) +7510
    SassAndCoffee.Ruby.Sass.SassCompilerProxy.Compile(String path, Boolean compressed, IList`1 dependentFileList) +65
    SassAndCoffee.Ruby.Sass.SassCompilerContentTransform.Execute(ContentTransformState state) +268
    SassAndCoffee.Core.ContentPipeline.ProcessRequest(String physicalPath) +330
    SassAndCoffee.AspNet.PipelineHandler.ProcessRequest(HttpContext context) +215
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +341
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

This appears to be because there are extended Unicode characters in the site.css file that's included with the ASP.NET MVC project template.

Lines 572-578 are:

th.asc a:after {
    content: '▲';
}

th.desc a:after {
    content: '▼';
}

and I've verified that replacing the ▲▼ glyphs with regular ASCII characters fixes the problem.

Can't access minified JS

I've just done a fresh install of SassAndCoffee and created a simple test.coffee file in my scripts folder. When attempting to access this as /scripts/test.js everything works fine but when I attempt to load /scripts/test.min.js I get the following error:

TypeError: Cannot call method 'parse' of undefined

This is returned with status 200. Any ideas? Thanks!

API for compilation

It would be awesome to have an API that can be properly used from other code and what asks for a string and gives a compiled string back. The current Compile() method on SassCompiler is problematic, because the assumption that a SASS content is always a physical file on the local file system isn't always true.

Throwing 404.x errors

I installed this package into an existing project. The project happns to be a Sitecore project, but I don't think that should matter.

The documentation says nothing about any further steps, so all you're supposed to need to do is create a SCSS file and request it as if it were a CSS file. I did that.

I created a test.scss file right next to an existing style.css file.
The style.css file is requestable just like it's always been.
The newly-created test.scss is not requestable at all:

test.css returns:
HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

test.scss returns:
HTTP Error 404.3 - Not Found
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

Again, I just installed SassAndCoffee fresh. I've never had it anywhere before. I did nothing after install, beside creating a scss-file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.