Code Monkey home page Code Monkey logo

Comments (7)

kmontag avatar kmontag commented on August 17, 2024

Currently looking into the baseUrl and paths bugs :)

As for the RequireJS src, for now you can load a local version by specifying an alternate initialize_template which extends 'HearsayRequireJSBundle::initialize.html.twig' and overrides the src block. That's something of a hack, though - currently my thought is to allow specifying either a URL or a template name as the src config option. If a template name is given, it'll be rendered to generate the src URL - that way you can use Assetic or whatever to process a local file, and spit out an asset URL to use for the RequireJS src.

Shim is also high priority - currently I'm thinking it should just live in the bundle config, similar to paths. Though in general, as the set of available RequireJS options gets more complex, I'm starting to wonder if there's a good way for the bundle to support more generic configuration setups, particularly for optimization. Writing the optimizer as an Assetic filter introduces some tricky inconsistencies with the "standard" methods of optimizing a RequireJS project, mainly because it forces optimization to happen file-at-a-time rather than directory-at-a-time. Any thoughts on a better configuration API are certainly welcome :)

from hearsayrequirejsbundle.

ruimarinho avatar ruimarinho commented on August 17, 2024

Correct, I overwrote the initialize.html.twig template, but the integration with Assetic with a custom route could be a better option.

I think shims fit on the bundle config too, although it would be optimal to dynamically generate a js config file and then dump it for Assetic processing. This way we can take advantage of some bundle processing, but still being able to tweak the settings without having to create more bundle configuration options. In a certain way, you can already do this with the initialize template, but probably not as cleanly :)

I wonder if we can run the r.js optimizer without Assetic - possibly using a Twig tag ({% requirejs %}) - that way we could take advantage of all the features of this build tool (or others, such as grunt). Not sure if this is reinventing the wheel though...

from hearsayrequirejsbundle.

pliniocsfernandes avatar pliniocsfernandes commented on August 17, 2024

Any updates on this one?

from hearsayrequirejsbundle.

adamborowski avatar adamborowski commented on August 17, 2024

in config.yml write in requirejs section:

require_js_src: /path/to/require.min.js

from hearsayrequirejsbundle.

ihortymoshenko avatar ihortymoshenko commented on August 17, 2024

I have some thoughts after reading this issue. I think possible to implement the ability to customize configuration options for each bundle using some namespaces which are reflect the bundle names. In addition, specify some global configuration options which will be applied to each bundle with the ability to override the latter at the bundle level configuration. What do you think?

from hearsayrequirejsbundle.

ihortymoshenko avatar ihortymoshenko commented on August 17, 2024

@ruimarinho, at this moment we don't have only the ability to specify a local path to the RequireJS via the require_js_src. Can you confirm? I'll add the last and close this issue. Thanks!

from hearsayrequirejsbundle.

ihortymoshenko avatar ihortymoshenko commented on August 17, 2024

I've added the ability to specify the local path to the RequireJS. If you have any questions, create a new issue please. Thanks!

from hearsayrequirejsbundle.

Related Issues (20)

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.