Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMD module support #4

Open
veeenu opened this issue Feb 10, 2014 · 6 comments
Open

AMD module support #4

veeenu opened this issue Feb 10, 2014 · 6 comments
Assignees

Comments

@veeenu
Copy link

veeenu commented Feb 10, 2014

I've been able to make Phoria work inside my AMD based workflow but only exploiting some quirks -- the culprit was mainly the bundled version of gl-matrix, actually, and its usage of global namespace; newer versions seem to have introduced AMD though and an upgrade should fix the issue. Anyway it would be awesome if you introduced support for AMD in Phoria.

Keep up the great work. :)

@kevinroast kevinroast self-assigned this Feb 10, 2014
@kevinroast
Copy link
Owner

Thanks. I will upgrade to latest gl-matrix. Yes I need to add AMD support I have been poor doing that :)

@veeenu
Copy link
Author

veeenu commented Feb 10, 2014

As soon as I have a little time if you haven't done it yet I might give it a try and send a pull request. ;)

@kevinroast
Copy link
Owner

That would be great. I have found that gl-matrix have fixed quite a few bugs, some of which were affecting users - noticeably strange translation issues and quat->matrix - I will try and upgrade gl-matrix ASAP so it is easy to add AMD to rest of phoria scripts.

@veeenu
Copy link
Author

veeenu commented Feb 26, 2014

I've been working on it but I found that due to the way the code is structured, it gets a little hairy to simply add the calls to define(). I'm working on a lightweight AMDization which only requires external files and is not really super-clean and compliant but should be backward-compatible. I'll push it so you may evaluate it as soon as it is ready. I'd suggest a full refactoring though, which would mean taking apart the current code structure in favor of a more AMD-compliant one. With the proper tools, generating a general-purpose, one-file release usable both standalone and as an AMD module will be possible, but heavy adjustments may be necessary. Let me know your opinion on this.

@kevinroast
Copy link
Owner

OK I'd like to see the kind of refactoring that is need, so feel free to push it so I can take a look.

@veeenu
Copy link
Author

veeenu commented Mar 15, 2014

Hi Kevin!
I finally got me some free time and I sent a pull request. I did the full refactoring in the end (despite the branch name light-amd :D), I did my best and I hope it doesn't look too scruffy. Comments and in-code documentation might need some polishing and in-depth testing is necessary, but overall I hope you like it. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants