Code Monkey home page Code Monkey logo

Comments (11)

adamschwartz avatar adamschwartz commented on July 24, 2024 1

This is now in the docs.

screen shot 2013-12-11 at 4 18 49 pm

from vex.

adamschwartz avatar adamschwartz commented on July 24, 2024

Can you be more specific about what you mean when you you can't make it work with requireJS?

Including vex.js and vex.dialog.js (in that order) should be equivalent to including vex.combined.js.

from vex.

m4nuC avatar m4nuC commented on July 24, 2024

It does work by including vex and vex.dialog separately. But I can't not make it work using vex.combined. when using vex.combined only the main vex object get exposed but not vex.dialog. is this a known bug ?

from vex.

m4nuC avatar m4nuC commented on July 24, 2024

Still hoping to get that figured out if i have to go to production with this.. Are you aware of this issue or I am doing something wrong.

from vex.

adamschwartz avatar adamschwartz commented on July 24, 2024

Sorry, my previous statement was incorrect. The vex.combined.min.js file has two define statements in it, so it cannot be used with RequireJS. We will add a note to the docs stating this.

If your goal is to use vex.dialog, you should be able to just require that, since it itself requires vex. If you need to use both vex and vex.dialog, you'll need to require them separately. There really would be no good way of requiring them as a single statement since they are separate modules. Hope this helps!

from vex.

m4nuC avatar m4nuC commented on July 24, 2024

Ok thanks, would love to seem the AMD version only expose one object tho

from vex.

adamschwartz avatar adamschwartz commented on July 24, 2024

@m4nuC can you elaborate?

from vex.

m4nuC avatar m4nuC commented on July 24, 2024

I meant just having one object exposed in the vex.combined.min to make it usable when using AMD. Obviously not a big deal but that would to me look a bit nicer in my list of dependencies.

from vex.

adamschwartz avatar adamschwartz commented on July 24, 2024

Unfortunately (and @zackbloom or @timmfin please correct me if i'm wrong), I believe the only way to accomplish this would be to actually combine the source code of vex.coffee and vex.dialog.coffee, thus limiting others' ability to depend on only one or the other separately.

Generalized, this is an interesting AMD question, and one I'd certainly like an answer to: Can one structure her code such that modules A and B (in which B depends on A) can be required as a single module C or individually as modules A and B respectively? If you figure it out, please report back and let us know. 😉

from vex.

m4nuC avatar m4nuC commented on July 24, 2024

Well can't module C require B (which require A) and then just expose a C module that can itself expose B module through a member on itself ? I would try it out but I am not exactly a coffee scripter :(

from vex.

adamschwartz avatar adamschwartz commented on July 24, 2024

That sounds reasonable. I can give it shot next week. Thanks!

from vex.

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.