Jump to content
Gigi

RuneLight - RuneScape website emulation

Recommended Posts

Love the fact that you are using Angular 2 with Typescript and Spring (Java). If you're not in love with MySQL, PostgresSQL is a great alternative and performs better in my opinion. I use all these frameworks on a daily basis at work. 

 

 

Share this post


Link to post
Share on other sites

Wait this uses Angular 2 with Typescript? Might be an interesting project to look at then.

Edited by SiniSoul

Share this post


Link to post
Share on other sites

Pff, if you had looked at the Git repository you would've known that >:( If you even looked under "Frontend" you would've known that.

Edited by Gemu

Share this post


Link to post
Share on other sites
1 hour ago, Emily said:

Love the fact that you are using Angular 2 with Typescript and Spring (Java). If you're not in love with MySQL, PostgresSQL is a great alternative and performs better in my opinion. I use all these frameworks on a daily basis at work. 

 

 

had to use Oracle SQL for a uni assignment and it fucking sucked.

Share this post


Link to post
Share on other sites

I've not touched Postgres, personally. But we do use Angular 2, TypeScript, and Spring (Spring Boot and older versions) at my work daily as well. Along with React and some other technologies. Quite a fun time to be a frontend developer. :)

 

Last I remember, I was working on forum reporting... Been a good month or so since I touched it though. We suddenly got busy at work. xd

 

I do know that I need to update Angular and my build process a bit. Little behind my latest works. 

Edited by Gigi

Share this post


Link to post
Share on other sites
On 12/17/2016 at 9:07 PM, Gigi said:

I've not touched Postgres, personally. But we do use Angular 2, TypeScript, and Spring (Spring Boot and older versions) at my work daily as well. Along with React and some other technologies. Quite a fun time to be a frontend developer. :)

 

Last I remember, I was working on forum reporting... Been a good month or so since I touched it though. We suddenly got busy at work. xd

 

I do know that I need to update Angular and my build process a bit. Little behind my latest works. 

I'm sorry, what? You use Angular 2 AND React? That's not being a good front-end developer, that's just creating chaos where you don't need. As someone that's employed professionally to use Node.js on a daily basis, I'm impressed... though you're definitely not in the right mind with your hierarchy. 

You should be using Express, and then integrating with Knex.js (since you're using primarily JavaScript, especially the frameworks like React.js and Angular.js) which would allow you to have consistency across the board. Yes, Knex.js works with MySQL as well, and unless you're simply a brute that loves writing SQL queries, it's a wonderful, wonderful touch. 

Moving from PostgreSQL to MySQL is a struggle, and vice versa, even though SQL doesn't change much from type to type (MsSQL, MySQL, PostgreSQL, ...) the small habits from one rendition of the language will eat you alive when trying to work with a different one. 

... and don't let anyone tell you otherwise, server-side rendering is the fastest and most efficient way to work with pages that require rendering with large objects or arrays. You could create a recursive function that would handle that on client-side, by why do that when you can manage the function and the production of the HTML right in the same document? Not to mention, it runs lightyears faster than API requests through AJAX. 

You're onto something! I'll keep checking back. I haven't been around RuneLocus in a long time, but I am impressed. Good job. Could work on the CSS a bit though, it looks a bit ragged. Good luck with everything, and if you have any questions, let me know.

P.S: Look into Redux. 

Edited by Atrocious

Share this post


Link to post
Share on other sites
2 hours ago, Atrocious said:

I'm sorry, what? You use Angular 2 AND React? That's not being a good front-end developer, that's just creating chaos where you don't need. As someone that's employed professionally to use Node.js on a daily basis, I'm impressed... though you're definitely not in the right mind with your hierarchy.

I think OP meant they use both frameworks in seperate projects.

 

2 hours ago, Atrocious said:

You should be using Express, and then integrating with Knex.js (since you're using primarily JavaScript, especially the frameworks like React.js and Angular.js) which would allow you to have consistency across the board. Yes, Knex.js works with MySQL as well, and unless you're simply a brute that loves writing SQL queries, it's a wonderful, wonderful touch.

Spring is easy and powerful and offers the enormous API of Java at your disposal. Using the same language for everything is not very important. Spring + Angular is a common combination in the business world. You sort of use the "best" of both worlds.

 

2 hours ago, Atrocious said:

You could create a recursive function that would handle that on client-side, by why do that when you can manage the function and the production of the HTML right in the same document? Not to mention, it runs lightyears faster than API requests through AJAX.

Yes, it runs faster than a HTTP request, but instead you do many HTTP requests to achieve the rendering of the template at the client side (such as loading sytesheets, images, ..., because server-side templates usually render an entire page). Angular (which has a template engine as well) does the same templating but on the client side, without having to reload any resources except for the data required to render said template.

I assume the Spring element in this project is used purely for API (probably REST) purposes which means it's stateless (or should be). Are server-side templates stateless? They aren't in a framework like JSF. I don't know about the other implementations such as thymeleaf for Spring, or other equivalents in JavaScript.

One could argue that, in terms of UX, in this case, the RS website does not have the same feel with Angular (because everything loads too fast :D). So you could say, emulating the RS website, includes making it feel the same as the real thing, thus serving page per page from the server.

Share this post


Link to post
Share on other sites

Cool project!

I see you are using Hibernate for persistence. Is there any reason why you don't let Hibernate create the schema directly on the database on runtime? This saves the user from having to fiddle with SQL (schemas).

By the way, if you are interested in trying out PostgreSQL. It is a matter of changing the dialect and driver in your persistence settings and installing the PostgreSQL driver.

On 12/26/2016 at 6:42 AM, Atrocious said:

... and don't let anyone tell you otherwise, server-side rendering is the fastest and most efficient way to work with pages that require rendering with large objects or arrays. You could create a recursive function that would handle that on client-side, by why do that when you can manage the function and the production of the HTML right in the same document? Not to mention, it runs lightyears faster than API requests through AJAX. 

I don't think he is denying that server-side rendering is not fast or efficient. Also, I recently saw a project that utilised server-side rendering using Sprint Boot and React. I am not sure if it is already possible for Angular 2 though. 

Share this post


Link to post
Share on other sites

Alrighty, going to try to address a lot of stuff here haha. Haven't had time to play with this over Holiday break, sadly... But here goes... (in response to the last three posts in no particular order):

1. We're not using React and Angular in the same project directly. Though other teams are writing some node modules in React that we're consuming in an Angular2 app, but that's not really a big deal. Just import it and call a function or two. It has problems with React manipulating the dom, which Angular then has a hard time collecting and communicating with, but we've managed to get it to work. Not ideal by any means, but it is what it is. 

2. I have toyed with Express, and don't dislike it. That said, for server-side stuff I generally prefer Java (personal preference). And yes, this particular project only uses REST. Right now it's all compiled into one monolithic WAR, but I may change that into micro-services as it grows.

3. Everything in the application is completely stateless, service(s) included.

4. It is very fast and that does kind of kill some of the "oldschool RuneScape" feel to be entirely honest haha. I guess "emulation" isn't the best word, maybe more of a... Modernization of technology without much modernization of the graphical look-and-feel. What's a good word for that? :(

5. Loving Hibernate! I did use it to, and have some stuff in the example properties file for, creating the schema on the fly, but prefer to hand-write my database creation. It's nice for quick development, but I just feel better writing the SQL myself. Not sure why, more of a preference I guess. :)

I have moved this into an AWS environment for a bit of production-esque testing and it ran beautifully. Very fast and responsive. Was quite happy with the performance and feel of it. I've since shut down that environment, but may spin it back up once I learn more about AWS (extreeeeme newb in that particular realm). Angular2 is substantially faster than its previous generation. Almost up to par with React from what I've read. Pretty impressive considering it's a full framework as opposed to a library. They've really made a lot of amazing improvements over Angular 1. 

Edited by Gigi

Share this post


Link to post
Share on other sites
On 12/26/2016 at 1:32 AM, Arix said:

I think OP meant they use both frameworks in seperate projects.

Spring is easy and powerful and offers the enormous API of Java at your disposal. Using the same language for everything is not very important. Spring + Angular is a common combination in the business world. You sort of use the "best" of both worlds.

Yes, it runs faster than a HTTP request, but instead you do many HTTP requests to achieve the rendering of the template at the client side (such as loading sytesheets, images, ..., because server-side templates usually render an entire page). Angular (which has a template engine as well) does the same templating but on the client side, without having to reload any resources except for the data required to render said template.

I assume the Spring element in this project is used purely for API (probably REST) purposes which means it's stateless (or should be). Are server-side templates stateless? They aren't in a framework like JSF. I don't know about the other implementations such as thymeleaf for Spring, or other equivalents in JavaScript.

One could argue that, in terms of UX, in this case, the RS website does not have the same feel with Angular (because everything loads too fast :D). So you could say, emulating the RS website, includes making it feel the same as the real thing, thus serving page per page from the server.

I think he meant they are using the two different frameworks for differing components of the website, which is as I mentioned, pretty bad form in terms of creating scalable content... just a developer's opinion, you could jump on SO and find thousands of threads arguing that... however; one main point I will disagree on you with is having everything in the same language. 

In terms of code re-usability, being able to have the server-side and client-side in the same language is a massive bonus to web developers, plus learning how to use one tool really well is better than knowing how to use three tools just decently. If you take a look -- you'll see the industry standard is slowly moving towards using a JS full-stack in web development. Typically one that utilizes Angular 1.6/2 (with UI-router), Node.js and Express/Knex. I've never dabbled in Spring, so I wouldn't know. 

I suppose, though. Being realistic, Angular 2 is a framework -- it will have much worse load-times in comparison to Angular 1.6/1, which are simply libraries. Again, I don't know. Emulating the original RS website seems like a strange task, but OP is cool like that.

On 12/27/2016 at 7:21 AM, Faab234 said:

I don't think he is denying that server-side rendering is not fast or efficient. Also, I recently saw a project that utilised server-side rendering using Sprint Boot and React. I am not sure if it is already possible for Angular 2 though. 

Server-side rendering is do-able with the Angular team's "Angular Universal" library, more info here. It's Angular 1's largest problems (SEO, pre-rendering, etc) solved in a single library, pretty impressive. I don't use Angular in the workplace, using React in my stack (for the last 6 months), but I know that a lot of jobs require it. Anyways, server-side rendering is the best.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×