Git Product home page Git Product logo

Comments (5)

huntc avatar huntc commented on June 19, 2024

Sbt-web's approach is quite different. Rjs is now configured exactly as if you were using it outside of Play.

The purpose of WebJars is to leverage existing tooling and infrastructure.

My guess here is that an older version of play is included given the dependency on WebJars-play.

I'm going to close this issue for now.

from angular-seed-play.

hsyed avatar hsyed commented on June 19, 2024

Yes I thought that might be the case (new way of doing this), in this case could you give me some pointers as to how best achieve my use-case with sbt-web (loading the webjars-requirejs.js automatically based on the web jars dependencies declare in the build file) ?

We are considering moving to web jars at work and would need the use-case above. We are loading dozens of dependencies at the moment manually, and this is without any other tools --i.e., no NPM or requires etc, just the angular module loader / injector. I need to nail this down so we can begin porting our in house JS modules to web jars, but it wouldn't be worth the investment for the next project unless I can remove the boilerplate above.

Sorry, I'm really new to web-development and play in general. Learning the whole stack --i.e., angular, css, requires, JS, play, web unit testing etc simultaneously :(.

We are in the process of a typesafe subscription for our team :D Guess I could raise a ticket once it goes through.

from angular-seed-play.

huntc avatar huntc commented on June 19, 2024

You'll need to declare an rjs path config in your main.js - as per the project provided. The upside of this is that sbt-rjs looks for them and automatically substitutes CDN paths for the WebJars when you create a dist for production.

from angular-seed-play.

hsyed avatar hsyed commented on June 19, 2024

So is this the currently prescribed solution ?

requirejs.config({
    paths: {
        'angular': ['../lib/angularjs/angular'],
        'angular-ui-router' : ['../lib/angular-ui-router/angular-ui-router'],
        'angular-resource' : ['../lib/angularjs/angular-resource'],
        'ui-bootstrap-tpls' : ['../lib/angular-ui-bootstrap/ui-bootstrap-tpls']
    },
    shim: {
        'angular': {
            exports: 'angular'
        },
        'angular-ui-router' : {
            deps : ['angular']
        },
        'angular-resource' : {
            deps : ['angular']
        },
        'ui-bootstrap-tpls' : {
            deps :['angular']
        }
    }
});

require(['angular', './controllers', './directives', './filters', './services',
        'angular-ui-router', 'angular-resource','ui-bootstrap-tpls'],
  function(angular, controllers) {
...
}

This would become rather unwieldy when dozens of dependencies are involved.

from angular-seed-play.

huntc avatar huntc commented on June 19, 2024

I agree with you. However do you accept that this is an rjs issue and not really a WebJars one?

That said, we could probably re-instate some support for rjs in sbt-web if this becomes a common issue.

from angular-seed-play.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.