Skip to content

Replace CoffeeScript block into JavaScript in Views.

Created by: huacnlee

Use CoffeeScript in View will compile again and again in each requests, because there have variables, Rails view can't caching them.

:coffeescript
  projectId = #{@project.id}

By my benchmark test for shared/issuable/_context render time:

  • CoffeeScript: 190ms
  • JavaScript: 19.7ms

I have enabled all caching config like production environment.

Merge request reports