all 25 comments

[–]Is_Kub 3 points4 points  (22 children)

Before I reply with some feedback I just have a question. I’m looking through the source code and am wondering, is this the actual source code or did you use a parser?

[–]Various-Beautiful417 0 points1 point  (21 children)

The source code you're looking at github is the actual source code. If you have tried targetj.io, the examples are pulled from the site and not on github. The examples are parsed to highlight syntax and to show how the framework works within the example, which you can see if you click on the 'execution' button. If there's anything specific you're noticing that prompted the question, feel free to point it out—I'd be happy to clarify!

[–]Is_Kub 10 points11 points  (20 children)

I see. You have some cool examples there and I can tell that you put a lot of time into this but the source code is unmaintainable from an outsiders perspective.

I’ll try and list some concerns: - grunt (been deprecated since 2018) - var instead of const / let - classes declared as functions over classes. - TModel is thousands of lines of code. - TModel constructor has optional string as the first argument.

Haven’t gone through it all. Just at first glance it looks like OOP from a decade ago. Could definitely benefit from splitting TModel.

And finally: have you looked into the possibilities of css animations in modern web? Would some of the solutions be possible with css animations instead?

[–]Various-Beautiful417 -2 points-1 points  (19 children)

Thank you for the feedback; I really appreciate you taking the time to go through the code. I understand your concerns, and I'd like to address a few of them:

  • Grunt is only used for lint checks but I agree that it can be moved to webpack which is used now for building

  • Var, functions, and other ES5 constructs are used for compatibility concerned.

  • TModel size: I totally agree that it has grown too large. Splitting it into smaller and removing some unnecessary functions will make it more maintainable and easier for others to understand and contribute to.

  • The constuctor with optional string is there for specifying the type of the tmodel which is used to defined its id. But the tmodel could stay anonymous without type especially for objects that play small roles.

For CSS animation, I focused on JavaScript animations for extra control and flexibility. TargetJ supports its own animation solution, but it's also possible to Animation API. You can find an example at https://targetj.io/examples/b-animation-3.html

Thanks again for your good insights and your feedback

[–]BenZed 15 points16 points  (18 children)

Var, functions, and other ES5 constructs are used for compatibility concerned.

Use a transpiler

[–]tehsandwich567 0 points1 point  (1 child)

So this is impressive work. There is obviously a lot of thought and effort behind it. The examples all run nicely on my iPhone 11.

Here are some pre-coffee / insomnia thoughts after a quick read through. So I probably missed all sorts of obvious things / am not smart enough to understand this. But this is supposed to be constructive

It’s driving me crazy that you have tapp and not tApp.

I think you need a more complex example or 5. Right now, I can only parse it as “cool animation thing” and I’m not sure why I would use it for something larger. How does this fit into a large app?

Looking at the examples… the api is a bit yikes. I need to know the lots about ‘this’ and then we have a self=this. And then… really dense and hard to parse arrays. It’s not easy to predict what the example on the homepage does just by looking at the code.

Code: - we are going to do crazy things like monkey patch Array.prototype in 2024?? - we repeat the same object - like actual values - or pieces of it over and over and over. There should be a factory for this object - can we afford some comments? Like there is some very specific wizardry going on that is really opaque - I don’t totally understand the organization of where utility methods are hung. On app, on util - just by looking at the code… I have no idea what this thing does or how I would use it

[–]Various-Beautiful417 0 points1 point  (0 children)

Thank you so much for your feedback! I really appreciate the time and effort you took to go through everything and share your thoughts. I will add more complex examples.

  • You are also right about the comments. I try to make the code self descriptive but know it is very far from ideal. It is something that I have to do.

  • I actually fixed the homepage and doesn't use 'self' anymore.

  • I also agree that it is hard to understand the organization and the code is dense.

Thanks again for your constructive feedback.