-
Notifications
You must be signed in to change notification settings - Fork 174
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
KUTE and webpack #35
Comments
npm doesn't have the latest version, my friend @IngwiePhoenix isn't available to push the new version. Also I'm working on a new version of KUTE.js with a full review of the core and plugins, a version that should fix and improve many things, so there's your chance to bring that kick. |
Thanks for quick reply! Can you suggest where should I pick the latest version from (not mentioning this repo, of course)? New version is always cool, but I think that's going to be another major release which isn't going to happen soon :) And it's okay. As for the issue itself, I think it's somehow related to missing window globals or smth. Also the mentioned function is getting called from within a loop or recursively — the number of errors increases very quickly: |
This is the place to find the latest version and it's really OK. Now, I have a question for you: does your SVG actually exist in the DOM when you create the tween object? |
Okay, I will pick up this version then. Yes, I fully copied that codepen and run my code |
Don't use zepto, try without it. And move the code to the footer. |
Well, is it fixed? |
If you remove |
I have to use |
I decided to try bower — I've seen bower releases are keeping the pace with this repo, latest version there is 1.5.2 — and ran into another issue: |
I hope someone can contribute with a better UMD definition. |
Doesn't this help in any way? |
Well I actually use |
Well ok try your best, I need to know a resolve on the issue as I'm preparing for a new release in the next days. Also please test the other plugins, some use slightly different UMD. Here is something I found interesting https://addyosmani.com/writing-modular-js/ |
Please download the latest master and do some checks, there's some overall improvements and fixes, but none of them are related to your problem unfortunately. I also want to know if you managed to solve the problem so I can look for a solution because I'm almost ready to draft a new release. |
Hello again. I've talked with a friend of mine and he suggested you should create a repository with the exact thing you are up to so we can have a look and create PR with a fix, as he thinks you aren't using the webpack stuff correctly. |
I had a few attempts to try to fix the issue (before none of my friends check it yet) and I have to say:
|
Hi @thednp, With
Uncommented:
|
Specification itself says that name should be lowercase: https://github.com/bower/spec/blob/master/json.md#name Currently it's uppercase: https://github.com/thednp/kute.js/blob/master/bower.json#L2 Though bower finds it and installs as |
I see, well nobody reported anything about npm or bower, this webpack stuff, IDK. |
Well, it looks like there are two ways of loading a bower module from webpack (http://webpack.github.io/docs/usage-with-bower.html and https://github.com/lpiepiora/bower-webpack-plugin), but none of them seems to work properly, thus it's really a webpack problem. I think this issue can be closed now, I will try to find a workaround. Thanks much! |
Hi again. I've seen you pushed new version to npm, so I successfully installed 1.5.3 + svg plugin. It seems that plugin got installed properly (I get no errors when requiring it), however, the problem from my first comment is still present — when executing a |
@lyssdod I need to see an example, I cannot guess/feel what's going on. |
@thednp https://github.com/lyssdod/kutesvg-webpack here it is. Code is from multi path svg morph example. |
@lyssdod I don't know much about webpack and require stuff, please give me something I can click and see the console. Let me ask you something else. Where is your script loaded? |
@lyssdod Hi. I am going to investigate - after all I used to be a webpack support staff member before i had to go somewhere for a while. Ill post once i have it working! |
@thednp Script is generated by webpack (all deps and |
So first off: Next, Further, your example does not show an example HTML document. So I have to assume that your DIVs are static in the document. In this case, make sure that your code executes at the bottom. <!DOCTYPE html>
<html>
<!-- ... snip ... -->
<body>
<div id="w1"></div>
<div id="w2"></div>
<!-- ... -->
<script src="path/to/webpack-output.js"></script>
</body>
</html> For example, assuming that you need to use a JS library with a document-ready function, your code would look like so: // Tell Webpack what to import:
var KUTE = require("kute.js");
var $ = require("<insert your lib here...>");
// Execute:
$.ready(function(){
var multiMorph1 = KUTE.to('...', { path: '...' }).start();
}); And that's that. If you are inserting the DIVs dynamically, then make sure that you structure your async operations - use Promises or proper async workflows. I hope it helped, feel free to ask back - im available for a little bit of time! |
@IngwiePhoenix |
That's why I use |
I think I will filter out the cases when the https://github.com/thednp/kute.js/blob/master/kute-svg.js#L43 if (!_svg && !_svg.ownerSVGElement) {return;} // if SVG API is not supported and **no SVG found**, return |
@IngwiePhoenix as for 'kute/KUTE' in https://github.com/lyssdod/kutesvg-webpack/blob/master/main.js#L1-L5:
|
@lyssdod So you say we need to connect the SVG plugin to KUTE.js core in a different manner? |
@thednp I don't know how difficult it is for you. I wonder why does it fail in such (artificial |
@lyssdod this post by @IngwiePhoenix looks solid for me, why won't you work on that idea? PS: I would love to have more people around this issue. |
@thednp @IngwiePhoenix I've added missing |
Where is the Please send over your skype via dnp.digital@gmail.com |
Thanks! |
@lyssdod Please do me a favor and test all plugins and let me know if there's anything wrong. |
@lyssdod Please test the new version and let me know if any problem. |
@thednp Sure, I will report back shortly |
It works! Thanks you very much! |
Alright, you're welcome. |
Hi,
I've stuck with a weird issue with inability to perform a simple transform (probably it's the issue with my setup). I'm using webpack to make a build of my code.
The animation code itself is actually taken from this codepen: http://codepen.io/thednp/pen/YWbpJo
However, when I try to run it in my webpack environment (not minimized, but compiled bundle), after
tween.start()
console is flooded with1.bundle.js:27189 Uncaught TypeError: Cannot read property 'length' of undefined
.I've found out that the code at line
27189
is https://github.com/thednp/kute.js/blob/master/kute-svg.js#L247What can cause this issue? Are the any globals other than
KUTE
SVG plugin relies on? My webpack configuration:kute.js is installed from npm. Fragment of
package.json
:Requiring of KUTE in
main.js
:The text was updated successfully, but these errors were encountered: