-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
netteForms.js: common js, amd #69
Comments
netteForms.js must be able to work without common js or amd environment |
common js / amd compatibility should be achievable without dependency on anything, I think. |
@JanTvrdik I know and that is why I send link to nprogress, which works great in each environment and without any dependency. Actually I had to (temporary) create custom transform function for browserify which will wrap netteForms.js into function like that: (function() {
var Nette = Nette || {};
// ...
module.exports = Nette;
}); Edit: Of course this code is just for common js |
The only thing I would do differently from nprogress is line 14, where I would use Edit: It really doesn't matter.... If I'm using browserify, than I don't need any window.. Sorry for useless comment |
Thank you sir Dne so, 14. 3. 2015 17:53 uživatel David Grudl [email protected]
|
Since nette-forms is registered in bower repository, it would be really greate if netteForms.js could work with common js or amd environments.
Eg. I'm using browserify with gulp to build my js files. But it's little bit difficult with nette forms, because I have to use something like browserify-shim to actually simulate wanted behavior.
Prons:
Environment
, so this is just another step 😉Cons:
Good example is at nprogress package.
Edit
So even browserify-shim doesn't work
The text was updated successfully, but these errors were encountered: