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

Code is getting ugly again... #4

Open
formula1 opened this issue Feb 28, 2015 · 5 comments
Open

Code is getting ugly again... #4

formula1 opened this issue Feb 28, 2015 · 5 comments

Comments

@formula1
Copy link
Owner

I think I may want to start bringing in async as a clientside dependency as well. However, that in turn increases the size of the api which already takes about 500 ms to load (far longer than it should)

@piranna
Copy link
Collaborator

piranna commented Feb 28, 2015

However, that in turn increases the size of the api which already takes about 500 ms to load (far longer than it should)

I think Angular is culprit here, I would have done it in raw Javascript or maybe plain jQuery since mostly it's a XHR and we are not using dynamic binding, only client-side templating that could have been done with mustache or any other Javascript templating, but maybe better HTML Template tag that it's already supported by all current browsers except Internet Explorer.

By refactoring the web app by using standard XHR and HTML Templates instead of Angular, it will need more work but page size will drastically decrease and code will be easier to understand and maintain :-)

(Disclaimer: I'm honestly not an Angular developer, the few things that I've done showed me there's too much magic there for someone that likes to work low level and baremetal... ;-) )

@formula1
Copy link
Owner Author

formula1 commented Mar 3, 2015

I was thinking about just in jQuery however went with angular as its the standard for One app pages.

That being said, I definitely have no problems removing the dependencies on it. It probably would be easier to maintain.

Alright

  • +async
  • -angular

@piranna
Copy link
Collaborator

piranna commented Mar 3, 2015

That being said, I definitely have no problems removing the dependencies
on it. It probably would be easier to maintain.

👍

+async
-angular

Are you talking about async.js (the library for parallize code), or about
any other thing?

@formula1
Copy link
Owner Author

formula1 commented Mar 3, 2015

async.js parallize code. Though I'm currenlty using it as series

https://github.com/formula1/NodeOS-Blog/blob/master/html/footerjs/cacheOrLoad.js

The callback api is a bit ugly, however for now I'll leave it as is. I'm doing Item callbacks to reduce the amount of iterations done.

I probably want to delete everything in memory after I use it as well, however outside of that this can be somewhat closed

I'm not using the template tag due to ie, however, what I'm doing is basically the same thing

Btw, I created a big header at the top for europe ;) But obviously that is better off a little smaller.

We can also have a setting to turn of cached requests if you want. So that it becomes optional

@formula1
Copy link
Owner Author

formula1 commented Mar 3, 2015

On an obvious note, caching results also speeds up the page a ton.

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

No branches or pull requests

2 participants