You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 10, 2018. It is now read-only.
In general, you want client-side JavaScript in a separate, external file -- good for cacheability, separation of concerns, etc.
There are occasions though where you want a snippet of inline JavaScript in a <script> block. Maybe it's something page-specific, or something dynamically generated, or maybe this is just a quick prototype.
It would be super awesome and convenient if I could write that code in CoffeeScript, e.g. via <script type="text/coffeescript">, and have Eco automatically compile that to JavaScript. <3
The text was updated successfully, but these errors were encountered:
Actually, <script type="text/coffeescript"> is both verbose and probably dangerous/tricky/non-trivial since it'd be part of regular HTML markup. So maybe something like:
<% _script: %>
# This block of CoffeeScript will get compiled to JS and
# sent back in a `<script>` block.
console.log 'This will get logged in the browser.'
<% end %>
Not sure about _script, but I'm thinking some means similar to this.
Just an idea / feature request:
In general, you want client-side JavaScript in a separate, external file -- good for cacheability, separation of concerns, etc.
There are occasions though where you want a snippet of inline JavaScript in a
<script>
block. Maybe it's something page-specific, or something dynamically generated, or maybe this is just a quick prototype.It would be super awesome and convenient if I could write that code in CoffeeScript, e.g. via
<script type="text/coffeescript">
, and have Eco automatically compile that to JavaScript. <3The text was updated successfully, but these errors were encountered: