Git Product home page Git Product logo

Comments (8)

papandreou avatar papandreou commented on June 24, 2024

Thanks for the detailed report. I know there are some race conditions where the require.js configuration won't yet be extracted at the time when the require/define calls are resolved. Could you try defining the require.js config in an inline script in your HTML instead using this syntax?

<script>
    var require = {
        paths:
            backbone         : 'vendor/backbone-amd/backbone' 
            deepmodel        : 'vendor/deep-model'
            ...
    };
</script>
<script src="/js/vendor/requirejs/require.js" data-main="/js/app"></script>

from assetgraph-builder.

mreinstein avatar mreinstein commented on June 24, 2024

That's a lot of stuff to jam into the index file. It's a sizable app. Can the race conditions be fixed? Based on the numerous examples Ive seen, this is a very common way apps are set up. If requirejs compatibility is a goal, this is important IMO.

from assetgraph-builder.

papandreou avatar papandreou commented on June 24, 2024

I agree, and it's certainly on my list. I asked you to try the above so I'd know whether this is a separate issue.

from assetgraph-builder.

mreinstein avatar mreinstein commented on June 24, 2024

Fair enough. Ill wire it up and let you know what happens

from assetgraph-builder.

papandreou avatar papandreou commented on June 24, 2024

Hmm, that turned out not to be the problem. I've created a stripped-down test case based on your description, and it does indeed look like the module names aren't resolved relative to your data-main module. I'm working on a fix. In the mean time you can avoid the bug by using an explicit baseUrl setting:

require.config {
    baseUrl: '/js'
    paths:
        backbone         : 'vendor/backbone-amd/backbone' 
        deepmodel        : 'vendor/deep-model'
        ...
}

from assetgraph-builder.

mreinstein avatar mreinstein commented on June 24, 2024

@papandreou sorry I didn't get to the test before you did. the baseUrl does indeed bypass the problem for now. Thanks!

from assetgraph-builder.

papandreou avatar papandreou commented on June 24, 2024

No prob, had all the info I needed in your report. Fixed in 1.7.5.

from assetgraph-builder.

mreinstein avatar mreinstein commented on June 24, 2024

nice!

from assetgraph-builder.

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.