Comments (7)
Just to explain the context, while this seems to be originally reported by Debian/Ubuntu folks, I'm coming with from Fedora. The issue is that the abandoned coffee-script-source gem prevents update of the Coffescript compiler. While Tilt users would likely preferred to use the most recent Coffeescript for all possible purposes, they won't be able to do that due to that gem.
I would guess it more likely that Tilt users would be using Coffeescript for legacy projects that used Coffeescript 1.x and have not yet migrated off of it, as opposed to active projects using Coffeescript 2.x with the enivronment variable to force the gem to load the external Coffeescript source.
So this is catch 22. Coffeescript upstream would probably like everybody to use Coffeescript 2.x, users would probably like to use Coffeescript 2.x, Tilt probably supports Coffeescript 2.x, but nothing of this happens, because there is abandoned coffee-script-source gem which won't be ever updated.
I'm sure Coffeescript upstream would prefer that everyone use the latest release of Coffeescript. However, I doubt Tilt users care much about Coffeescript 2.x.
On Fedora, we could probably update the coffee-script-source gem to provide the Coffeescript 2.x, but in that case, we will face the failing test suite and the solution would be to ignore the test cases, i.e. to drop the coffee-script dependency.
I would recommend against that approach.
However, given that Rails does not use Coffeescript anymore (and I believe that is the reason behind abandoned coffee-script-source gem), the solution for Fedora will likely be dropping the coffee-script dependency from Tilt package and the test suite can ignore the test cases in such situation just fine. I'll also likely drop the entire coffee-script gem package from Fedora. Therefore it won't be issue for Fedora anymore, but still, this situation is unfortunate.
That sounds like a better approach to me.
FWIW, The spec failures you are seeing with CoffeeScript 2.x appear to be due to fragile tests, and not the underlying support being broken.
That also seems to be correct. If the tests were adjusted to support CoffeeScript 2.x and they were also really tested against CoffeeScript 2.x, that would possibly make the situation less unfortunate.
We would accept patches that allow the specs to pass with both CoffeeScript 1.x and 2.x.
from tilt.
Tilt doesn't depend on coffee-script
. Tilt will allow use of coffee-script
if it is installed, but if not installed, the tests will only give a warning. coffee-script
is included in the Gemfile, so that it is tested in CI. That part could probably be made optional, such as only including it when an environment variable is given.
from tilt.
Thanks for the quick reply @jeremyevans !
I see you have been cautious in those tests, thanks for that. Maybe the Gemfile change you mentioned would be great. I also think we could let users know that those coffee-script related features are going to be deprecated, so they can move away from it without getting surprised. WDYT?
from tilt.
I'm not sure if we'll be deprecating tilt's support for coffee-script. The tests still pass, so even if the coffee-script gem is no longer actively maintained, tilt's support is still usable. Tilt tends to be conservative in terms of deprecation, only deprecating support when it causes issues in CI. I'll submit a PR for the Gemfile change.
from tilt.
I'm not sure if we'll be deprecating tilt's support for coffee-script. The tests still pass
I am afraid they don't pass with with Coffeescript 2.x, which was released in 2017:
$ ruby -Ilib:test -e 'Dir.glob "./test/**/*coffee*_test.rb", &method(:require)' - -v
Run options: -v --seed 48633
# Running:
LiterateCoffeeScriptTemplateTest#test_disabling_coffee_script_wrapper = 0.34 s = F
LiterateCoffeeScriptTemplateTest#test_is_registered_for_litcoffee_files = 0.00 s = .
LiterateCoffeeScriptTemplateTest#test_bare_is_disabled_by_default = 0.00 s = .
LiterateCoffeeScriptTemplateTest#test_can_be_rendered_more_than_once = 0.18 s = .
LiterateCoffeeScriptTemplateTest#test_compiles_and_evaluates_the_template_on_render = 0.19 s = .
LiterateCoffeeScriptTemplateTest::TestWrapperGloballyEnabled#test_overridden_by_no_wrap = 0.19 s = F
LiterateCoffeeScriptTemplateTest::TestWrapperGloballyEnabled#test_is_registered_for_litcoffee_files = 0.00 s = .
LiterateCoffeeScriptTemplateTest::TestWrapperGloballyEnabled#test_no_options = 0.18 s = F
LiterateCoffeeScriptTemplateTest::TestWrapperGloballyEnabled#test_overridden_by_bare = 0.17 s = F
CoffeeScriptTemplateTest#test_disabling_coffee_script_wrapper = 0.19 s = F
CoffeeScriptTemplateTest#test_is_registered_for_coffee_files = 0.00 s = .
CoffeeScriptTemplateTest#test_bare_is_disabled_by_default = 0.00 s = .
CoffeeScriptTemplateTest#test_can_be_rendered_more_than_once = 0.18 s = .
CoffeeScriptTemplateTest#test_compiles_and_evaluates_the_template_on_render = 0.18 s = .
LiterateCoffeeScriptTemplateTest::TestWrapperGloballyDisabled#test_overridden_by_no_wrap = 0.17 s = F
LiterateCoffeeScriptTemplateTest::TestWrapperGloballyDisabled#test_is_registered_for_litcoffee_files = 0.00 s = .
LiterateCoffeeScriptTemplateTest::TestWrapperGloballyDisabled#test_no_options = 0.19 s = F
LiterateCoffeeScriptTemplateTest::TestWrapperGloballyDisabled#test_overridden_by_bare = 0.19 s = F
CoffeeScriptTemplateTest::TestWrapperGloballyEnabled#test_overridden_by_no_wrap = 0.19 s = F
CoffeeScriptTemplateTest::TestWrapperGloballyEnabled#test_is_registered_for_coffee_files = 0.00 s = .
CoffeeScriptTemplateTest::TestWrapperGloballyEnabled#test_no_options = 0.17 s = F
CoffeeScriptTemplateTest::TestWrapperGloballyEnabled#test_overridden_by_bare = 0.17 s = F
CoffeeScriptTemplateTest::TestWrapperGloballyDisabled#test_overridden_by_no_wrap = 0.20 s = F
CoffeeScriptTemplateTest::TestWrapperGloballyDisabled#test_is_registered_for_coffee_files = 0.00 s = .
CoffeeScriptTemplateTest::TestWrapperGloballyDisabled#test_no_options = 0.20 s = F
CoffeeScriptTemplateTest::TestWrapperGloballyDisabled#test_overridden_by_bare = 0.22 s = F
Finished in 3.515684s, 7.3954 runs/s, 15.9286 assertions/s.
1) Failure:
LiterateCoffeeScriptTemplateTest#test_disabling_coffee_script_wrapper [/builddir/build/BUILD/tilt-2.0.10/usr/share/gems/gems/tilt-2.0.10/test/tilt_coffeescripttemplate_test.rb:27]:
Expected /puts\("Hello,\ "\ \+\ name\);\n/ to match "(function() {\n // This is some comment.\n var name;\n\n name = \"Josh\";\n\n puts(`Hello, ${name}`);\n\n // This is a comment too.\n\n}).call(this);\n".
2) Failure:
LiterateCoffeeScriptTemplateTest::TestWrapperGloballyEnabled#test_overridden_by_no_wrap [/builddir/build/BUILD/tilt-2.0.10/usr/share/gems/gems/tilt-2.0.10/test/tilt_coffeescripttemplate_test.rb:62]:
Expected /puts\("Hello,\ "\ \+\ name\);/ to match "// This is some comment.\nvar name;\n\nname = \"Josh\";\n\nputs(`Hello, ${name}`);\n\n// This is a comment too.\n".
3) Failure:
LiterateCoffeeScriptTemplateTest::TestWrapperGloballyEnabled#test_no_options [/builddir/build/BUILD/tilt-2.0.10/usr/share/gems/gems/tilt-2.0.10/test/tilt_coffeescripttemplate_test.rb:50]:
Expected /puts\("Hello,\ "\ \+\ name\);/ to match "(function() {\n // This is some comment.\n var name;\n\n name = \"Josh\";\n\n puts(`Hello, ${name}`);\n\n // This is a comment too.\n\n}).call(this);\n".
4) Failure:
LiterateCoffeeScriptTemplateTest::TestWrapperGloballyEnabled#test_overridden_by_bare [/builddir/build/BUILD/tilt-2.0.10/usr/share/gems/gems/tilt-2.0.10/test/tilt_coffeescripttemplate_test.rb:56]:
Expected /puts\("Hello,\ "\ \+\ name\);/ to match "// This is some comment.\nvar name;\n\nname = \"Josh\";\n\nputs(`Hello, ${name}`);\n\n// This is a comment too.\n".
5) Failure:
CoffeeScriptTemplateTest#test_disabling_coffee_script_wrapper [/builddir/build/BUILD/tilt-2.0.10/usr/share/gems/gems/tilt-2.0.10/test/tilt_coffeescripttemplate_test.rb:27]:
Expected /puts\("Hello,\ "\ \+\ name\);\n/ to match "(function() {\n var name;\n\n name = \"Josh\";\n\n puts(`Hello, ${name}`);\n\n}).call(this);\n".
6) Failure:
LiterateCoffeeScriptTemplateTest::TestWrapperGloballyDisabled#test_overridden_by_no_wrap [/builddir/build/BUILD/tilt-2.0.10/usr/share/gems/gems/tilt-2.0.10/test/tilt_coffeescripttemplate_test.rb:91]:
Expected /puts\("Hello,\ "\ \+\ name\);/ to match "(function() {\n // This is some comment.\n var name;\n\n name = \"Josh\";\n\n puts(`Hello, ${name}`);\n\n // This is a comment too.\n\n}).call(this);\n".
7) Failure:
LiterateCoffeeScriptTemplateTest::TestWrapperGloballyDisabled#test_no_options [/builddir/build/BUILD/tilt-2.0.10/usr/share/gems/gems/tilt-2.0.10/test/tilt_coffeescripttemplate_test.rb:79]:
Expected /puts\("Hello,\ "\ \+\ name\);/ to match "// This is some comment.\nvar name;\n\nname = \"Josh\";\n\nputs(`Hello, ${name}`);\n\n// This is a comment too.\n".
8) Failure:
LiterateCoffeeScriptTemplateTest::TestWrapperGloballyDisabled#test_overridden_by_bare [/builddir/build/BUILD/tilt-2.0.10/usr/share/gems/gems/tilt-2.0.10/test/tilt_coffeescripttemplate_test.rb:85]:
Expected /puts\("Hello,\ "\ \+\ name\);/ to match "(function() {\n // This is some comment.\n var name;\n\n name = \"Josh\";\n\n puts(`Hello, ${name}`);\n\n // This is a comment too.\n\n}).call(this);\n".
9) Failure:
CoffeeScriptTemplateTest::TestWrapperGloballyEnabled#test_overridden_by_no_wrap [/builddir/build/BUILD/tilt-2.0.10/usr/share/gems/gems/tilt-2.0.10/test/tilt_coffeescripttemplate_test.rb:62]:
Expected /puts\("Hello,\ "\ \+\ name\);/ to match "var name;\n\nname = \"Josh\";\n\nputs(`Hello, ${name}`);\n".
10) Failure:
CoffeeScriptTemplateTest::TestWrapperGloballyEnabled#test_no_options [/builddir/build/BUILD/tilt-2.0.10/usr/share/gems/gems/tilt-2.0.10/test/tilt_coffeescripttemplate_test.rb:50]:
Expected /puts\("Hello,\ "\ \+\ name\);/ to match "(function() {\n var name;\n\n name = \"Josh\";\n\n puts(`Hello, ${name}`);\n\n}).call(this);\n".
11) Failure:
CoffeeScriptTemplateTest::TestWrapperGloballyEnabled#test_overridden_by_bare [/builddir/build/BUILD/tilt-2.0.10/usr/share/gems/gems/tilt-2.0.10/test/tilt_coffeescripttemplate_test.rb:56]:
Expected /puts\("Hello,\ "\ \+\ name\);/ to match "var name;\n\nname = \"Josh\";\n\nputs(`Hello, ${name}`);\n".
12) Failure:
CoffeeScriptTemplateTest::TestWrapperGloballyDisabled#test_overridden_by_no_wrap [/builddir/build/BUILD/tilt-2.0.10/usr/share/gems/gems/tilt-2.0.10/test/tilt_coffeescripttemplate_test.rb:91]:
Expected /puts\("Hello,\ "\ \+\ name\);/ to match "(function() {\n var name;\n\n name = \"Josh\";\n\n puts(`Hello, ${name}`);\n\n}).call(this);\n".
13) Failure:
CoffeeScriptTemplateTest::TestWrapperGloballyDisabled#test_no_options [/builddir/build/BUILD/tilt-2.0.10/usr/share/gems/gems/tilt-2.0.10/test/tilt_coffeescripttemplate_test.rb:79]:
Expected /puts\("Hello,\ "\ \+\ name\);/ to match "var name;\n\nname = \"Josh\";\n\nputs(`Hello, ${name}`);\n".
14) Failure:
CoffeeScriptTemplateTest::TestWrapperGloballyDisabled#test_overridden_by_bare [/builddir/build/BUILD/tilt-2.0.10/usr/share/gems/gems/tilt-2.0.10/test/tilt_coffeescripttemplate_test.rb:85]:
Expected /puts\("Hello,\ "\ \+\ name\);/ to match "(function() {\n var name;\n\n name = \"Josh\";\n\n puts(`Hello, ${name}`);\n\n}).call(this);\n".
26 runs, 56 assertions, 14 failures, 0 errors, 0 skips
Admittedly, I have tested with tilt-2.0.10, but checking the source code, the test cases were not updated yet.
BTW the coffee script path can be modified via env variable:
from tilt.
The specs pass in CI, which uses the latest version of the coffee-script gem, which appears to use CoffeeScript 1.12.2. FWIW, The spec failures you are seeing with CoffeeScript 2.x appear to be due to fragile tests, and not the underlying support being broken.
We don't generally deprecate/remove support unless something is actually broken on modern Ruby or we cannot properly test it in CI. See #382 for the last time we deprecated template engines. Are you OK with the change proposed in #385?
from tilt.
Just to explain the context, while this seems to be originally reported by Debian/Ubuntu folks, I'm coming with from Fedora. The issue is that the abandoned coffee-script-source gem prevents update of the Coffescript compiler. While Tilt users would likely preferred to use the most recent Coffeescript for all possible purposes, they won't be able to do that due to that gem.
So this is catch 22. Coffeescript upstream would probably like everybody to use Coffeescript 2.x, users would probably like to use Coffeescript 2.x, Tilt probably supports Coffeescript 2.x, but nothing of this happens, because there is abandoned coffee-script-source gem which won't be ever updated.
On Fedora, we could probably update the coffee-script-source gem to provide the Coffeescript 2.x, but in that case, we will face the failing test suite and the solution would be to ignore the test cases, i.e. to drop the coffee-script dependency.
However, given that Rails does not use Coffeescript anymore (and I believe that is the reason behind abandoned coffee-script-source gem), the solution for Fedora will likely be dropping the coffee-script dependency from Tilt package and the test suite can ignore the test cases in such situation just fine. I'll also likely drop the entire coffee-script gem package from Fedora. Therefore it won't be issue for Fedora anymore, but still, this situation is unfortunate.
And just FTR, I am certainly not blaming Tilt here.
The specs pass in CI, which uses the latest version of the coffee-script gem, which appears to use CoffeeScript 1.12.2.
Correct
FWIW, The spec failures you are seeing with CoffeeScript 2.x appear to be due to fragile tests, and not the underlying support being broken.
That also seems to be correct. If the tests were adjusted to support CoffeeScript 2.x and they were also really tested against CoffeeScript 2.x, that would possibly make the situation less unfortunate.
We don't generally deprecate/remove support unless something is actually broken on modern Ruby or we cannot properly test it in CI. See #382 for the last time we deprecated template engines. Are you OK with the change proposed in #385?
This won't help, because we don't use Bundler to run tests on Fedora. Can't speak for others, though.
from tilt.
Related Issues (20)
- SyntaxError when rendering ERB `<%=` with a block HOT 3
- Eliminate dependency on deprecated 'sass' Gem HOT 6
- HAML SASS Directive fails when passed an 8-digit hex value HOT 2
- Push tag v2.0.9 HOT 1
- How do you pass Redcarpet render options through Tilt? HOT 2
- Missing extensions for markdown when using Redcarpet HOT 4
- Pug support HOT 3
- [2.0.10 Regression] Methods defined in a template can't be used later in the template HOT 22
- Slim fails since tilt 2.0.10 HOT 1
- Uninitialized constant problem in Heroku / Sinatra HOT 3
- Test failure: TestSlimEmbeddedEngines#test_render_with_markdown HOT 1
- CVE-2020-14001 Kramdown gem version HOT 8
- Opal support outdated HOT 2
- Not support all options for CommonMarker HOT 1
- uninitialized constant Tilt::Dummy on special conditions HOT 1
- Trying to get in touch regarding a security issue HOT 2
- Haml::TempleEngine: Option :line is invalid HOT 2
- Warnings when running tests with ruby 3.0 and 3.1 in Debian and Ubuntu HOT 2
- Can we have a Gem release of the current state of Tilt? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tilt.