Skip to content

Handlebars requires eval #14404

Closed
Closed

Description

@LukasReschke

Needs research how we can integrate precompilation into our dev process: https://github.com/wycats/handlebars.js/blob/3133af2a210a15223f441d75aa795f3e44bab3dd/FAQ.md#L17

Approach 1

Disable CSP when DEBUG mode is enabled and build the templates using Jenkins.

Pro:

  • Not much changes for developers required

Contra:

  • We're not testing the real deployment scenario, so CSP would be disabled and developers might do things that are forbidden with CSP which screws up on real live instances.
    • … however we might be able to configure JSHint and Scrutinizer to detect this.

Approach 2

We tell the developers to execute Handlebars precompiler manually everytime they did a change.

Pro:

  • No changes on CI environment required.

Contra:

  • Needs to run handlebars --extension=tmpl tags.tmpl -f tags.tmpl.js before seeing the changes.
  • Artifacts in GIT.

… your approach …

Activity

  1. added this to the milestone on Feb 20, 2015
  2. LukasReschke commented on Feb 20, 2015

    @LukasReschke
    ContributorAuthor

    @Raydiation told me that we maybe could use grunt…

  3. MorrisJobke commented on Feb 20, 2015

    @MorrisJobke
    Contributor

    @Raydiation told me that we maybe could use grunt…

    Or Make or Bash or PHP ;)

  4. LukasReschke commented on Feb 20, 2015

    @LukasReschke
    ContributorAuthor

    But that wouldn't be a fancy tool for web 3.0 hipsters :(

  5. BernhardPosselt commented on Feb 20, 2015

    @BernhardPosselt
    Contributor

    Well, since we should probably also use it for JS development it just makes sense to also let it do that.

    The News app watches js, templates and css https://github.com/owncloud/news/blob/master/js/Gruntfile.js#L125

    If any file changes, the stuff is minimized and the page is then refreshed using live reload. How does that sound ;D?

  6. BernhardPosselt commented on Feb 20, 2015

    @BernhardPosselt
    Contributor

    You may want to run jshint for instance while developing

    cc @PVince81

  7. DeepDiver1975 commented on Feb 20, 2015

    @DeepDiver1975
    Contributor

    You may want to run jshint for instance while developing

    not really - my IDE shows this inline ;-)

  8. DeepDiver1975 commented on Feb 20, 2015

    @DeepDiver1975
    Contributor

    bäääh - I really don't like to have build artifacts in git (minizied and generated stuff)

  9. BernhardPosselt commented on Feb 20, 2015

    @BernhardPosselt
    Contributor

    @DeepDiver1975 ok, another thing: what about wrapping your stuff in a function to not pollute the global namespace :D? http://markdalgleish.com/2011/03/self-executing-anonymous-functions/

    Running Unittests on file save?

    I doubt we can handle everything through the asset pipeline.

  10. LukasReschke commented on Feb 20, 2015

    @LukasReschke
    ContributorAuthor

    Lets add some options in the top post for easier discussion later…

  11. PVince81 commented on Feb 20, 2015

    @PVince81
    Contributor

    I guess it might be possible to configure JSHint to detect uses of eval + Function (and scrutiinizer).
    If we find a way to catch that early it might work ?

  12. LukasReschke commented on Feb 20, 2015

    @LukasReschke
    ContributorAuthor

    Yes. That might indeed be a possibility. Remains the question how we handle the real life deployment scenario 🙈

  13. 10 remaining items

  14. modified the milestones: , on Sep 21, 2015
  15. PVince81 commented on Sep 21, 2015

    @PVince81
    Contributor

    Still haven't found a good way to make Handlebars work with our project restrictions (no build scripts) and unit tests. Moving to 9.0

  16. ghost added this to the milestone on Feb 20, 2016
  17. ghost removed this from the milestone on Feb 20, 2016
  18. modified the milestones: , on Jun 14, 2016
  19. PVince81 commented on Sep 1, 2016

    @PVince81
    Contributor

    Requires #26006 to compile JS template thanks to the new Makefile

  20. PVince81 commented on Jan 27, 2017

    @PVince81
    Contributor

    and also needs porting all the existing handlebar templates to precompiled templates

  21. modified the milestones: backlog, 10.0 on Jan 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions