Giter Site home page Giter Site logo

Comments (11)

Paratron avatar Paratron commented on August 14, 2024

The "crazy" //@@includes are resolved by grunt on build time - if you take a look into the dist/ folder, you can see them resolved.

I don't want to bloat the codebase by adding define wrappers - also I try to keep this thing dependency free.

from gamekit.

phated avatar phated commented on August 14, 2024

It's about interoperability, not adding dependencies.

from gamekit.

phated avatar phated commented on August 14, 2024

It is well known that globals are bad. Why choose one pattern (promises) and be so against others (proper modules)?

from gamekit.

Paratron avatar Paratron commented on August 14, 2024

As I mentioned: I want to keep this dependency free. No jQuery, no Underscore, no requireJS.

Globals aren't "bad" at all - you just need to be clean. Everything that gamekit exposes is available under one global: "gamekit". Also, I don't need to start a discussion about the correctness of a global variable at this thread ;)

from gamekit.

phated avatar phated commented on August 14, 2024

RequireJS isn't a dependency of AMD or UMD, just as node isn't a dependency of CommonJS modules. That is where you are wrong/mistaken.

Globals are bad, even under a terrible namespace - all good libraries support module systems these days, typically with UMD.

from gamekit.

Paratron avatar Paratron commented on August 14, 2024

So, tell me. How do I get AMD modules in my browser without relying on something like requireJS. I am very curious...

from gamekit.

phated avatar phated commented on August 14, 2024

That is up to the consumer. UMD is a pattern that exposes the module as AMD or if no AMD, CommonJS or if neither as global.

You shouldn't tie your library to a particular consumption mechanism. By breaking it into modules and letting consumers choose, they can bring in pieces they need and ignore pieces they don't.

from gamekit.

Paratron avatar Paratron commented on August 14, 2024

Well, I really love AMD and use it in nearly all of my projects. Just not in this one - it doesn't fit. The core of the engine is too much interconnected internally for performance reasons, so its very hard to keep the stuff in modules.
Also, the engine is very minimalistic - if you strip something out of it, you are unable to build a game with it ;)

from gamekit.

phated avatar phated commented on August 14, 2024

Not necessarily. I see that the RAF shim is embedded at the top of the library, but if I wanted to use a different shim (such as one that doesn't have the setTimeout part), I wouldn't be able to.

from gamekit.

Paratron avatar Paratron commented on August 14, 2024

Well, I prefer to keep the style as it is. Thanks for your insight and feedback, tough! :)

You should consider visiting #bbg on irc.freenode.net and/or http://html5gamedevs.com so we can have a good talk about game developing again!

from gamekit.

monteslu avatar monteslu commented on August 14, 2024

If performance is a concern you should use a module system so that you can have proper dependency management and avoid bloat.
As it stands, this library can't be part of a build process that only brings in necessary code.

from gamekit.

Related Issues (6)

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.