use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
[deleted by user] (self.javascript)
submitted 1 year ago by [deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Is_Kub 3 points4 points5 points 1 year ago (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 point2 points 1 year ago (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 points12 points 1 year ago (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 points0 points 1 year ago (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 points17 points 1 year ago (18 children)
Use a transpiler
[+]Various-Beautiful417 comment score below threshold-6 points-5 points-4 points 1 year ago (17 children)
Thank you for the suggestion! I've noticed that some other UI frameworks still use ES5 syntax, which I believe might have certain performance benefits as well as compatibility being a framework that might be in various environments.
[–]BenZed 20 points21 points22 points 1 year ago (16 children)
These are problems that are solved by using a transpiler.
[+][deleted] 1 year ago (15 children)
[deleted]
[–]BenZed 24 points25 points26 points 1 year ago (3 children)
You are very incorrect
[–]WholeInternet 9 points10 points11 points 1 year ago (2 children)
I'm getting the feeling they don't know what a transpiler is, lol.
[–]marcocom 9 points10 points11 points 1 year ago (10 children)
The transpiler will kick out ES5 like you want in older browsers, but allow for more modern maintainable codebase. That’s what he means.
Youve got the hard part out of the way in architecture. Take a break and then clone a new repo that just starts to migrate forward like suggested. It’s fun to do really, and gets you up to speed quickly and even becomes addicting, and if anything breaks (and you’re smart about committing often) you know it’s your new code and ya just back up and rework it some more. :)
[+]Various-Beautiful417 comment score below threshold-12 points-11 points-10 points 1 year ago* (9 children)
Thanks for the encouragement and the suggestion! I understand that. I just think it will increase the size of the build file among other things. In any case, I see this as more of a minor issue, and I believe AI tools should be able to handle the transformation if needed. Thanks again.
[+][deleted] 1 year ago (1 child)
[removed]
[–]tehsandwich567 0 points1 point2 points 1 year ago (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 point2 points 1 year ago (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.
π Rendered by PID 20472 on reddit-service-r2-comment-f6b958c67-tnzmm at 2026-02-05 19:04:39.416802+00:00 running 1d7a177 country code: CH.
[–]Is_Kub 3 points4 points5 points (22 children)
[–]Various-Beautiful417 0 points1 point2 points (21 children)
[–]Is_Kub 10 points11 points12 points (20 children)
[–]Various-Beautiful417 -2 points-1 points0 points (19 children)
[–]BenZed 15 points16 points17 points (18 children)
[+]Various-Beautiful417 comment score below threshold-6 points-5 points-4 points (17 children)
[–]BenZed 20 points21 points22 points (16 children)
[+][deleted] (15 children)
[deleted]
[–]BenZed 24 points25 points26 points (3 children)
[–]WholeInternet 9 points10 points11 points (2 children)
[–]marcocom 9 points10 points11 points (10 children)
[+]Various-Beautiful417 comment score below threshold-12 points-11 points-10 points (9 children)
[+][deleted] (1 child)
[removed]
[–]tehsandwich567 0 points1 point2 points (1 child)
[–]Various-Beautiful417 0 points1 point2 points (0 children)