Comments (11)
The "crazy" //@@include
s 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.
It's about interoperability, not adding dependencies.
from gamekit.
It is well known that globals are bad. Why choose one pattern (promises) and be so against others (proper modules)?
from gamekit.
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.
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.
So, tell me. How do I get AMD modules in my browser without relying on something like requireJS. I am very curious...
from gamekit.
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.
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.
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.
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gamekit.