Skip to content

Raise on accidental intermediate file format use #327

Closed
@schneems

Description

@schneems

This is going to be a tough one. Right now if you accidentally

env["application.scss"]

Then sprockets will render you the contents of the scss file, however you probably wanted the compiled CSS results that would come from env["application.css"].

I'm proposing we either register file formats as "internal" so that if you tried to render .scss you get an error. Alternatively we could register end user formats like .css and raise an exception if you use any format other than that. The problem with the second approach I see is that there's a ton of file formats and we would have to keep track of most of them by default. It seems easier to special case these internal formats.

The reason I think this will be hard is that sprockets works like a reactor reactor for example if you do an env["application.css"] It will internally use the same API to eventually call env[application.scss"] to get its contents until it has all the info it needs to actually build the application.css file.

Either way this is an unexpected way for your code to fail silently, instead we should fail loudly.

Related sass/sassc-rails#65 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions