AngularJS for phpbb

Note: We are moving the topics of this forum and it will be deleted at some point

Publish your own request for comments/change or patches for the next version of phpBB. Discuss the contributions and proposals of others. Upcoming releases are 3.2/Rhea and 3.3.
User avatar
EXreaction
Registered User
Posts: 1555
Joined: Sat Sep 10, 2005 2:15 am

Re: AngularJS for phpbb

Post by EXreaction »

My phone running the default Android 2.3.4 browser (which was crap on its own and is now extremely outdated) runs an application built with AngularJS without any problems.

Computers have security vulnerabilities. If you don't want to worry about that, don't use a computer, or at least not one connected to the internet (there are far worse things out there than what someone can do with javascript in a browser).

If you're going to a website where you cannot trust that they do not have malicious code on their website, you probably should not be going to it.

User avatar
Kamahl19
Registered User
Posts: 161
Joined: Thu Dec 27, 2007 10:31 am

Re: AngularJS for phpbb

Post by Kamahl19 »

+1 EX

wGEric
Registered User
Posts: 521
Joined: Wed Jun 11, 2003 2:07 am
Contact:

Re: AngularJS for phpbb

Post by wGEric »

Since this feature is probably years away, it is silly to be talking about how you are browsing the web today as a pro or con to this discussion.

Using angular or any javascript framework would be a huge change to phpBB. The PHP code would be used mostly for passing data between the DB and the client. The client is where most of the work would be done. I can't speak for the future but if the trend continues then traditional websites that refresh the entire page are going to become archaic.
Eric

User avatar
Sumanai
Registered User
Posts: 95
Joined: Sat Aug 31, 2013 11:12 am

Re: AngularJS for phpbb

Post by Sumanai »

My opinion, you can write a one-page application and without the use of frameworks.
You just need to provide a stripped-down version of the page (without header and footer) when a query POST with parameter "Ajax=enabled".
It does not require significant alterations in the engine forum, will speed up the pages by eliminating the need javascript initialization, while remaining fully functional client with off Javascript, will enable the search engines to index the normal page, and so on.
Sorry for my English.

User avatar
brunoais
Registered User
Posts: 964
Joined: Fri Dec 18, 2009 3:55 pm

Re: AngularJS for phpbb

Post by brunoais »

Why is a single page better than a multiple page application like phpBB? I don't get it.

Alien_Time
Registered User
Posts: 165
Joined: Fri Apr 05, 2013 3:38 am

Re: AngularJS for phpbb

Post by Alien_Time »

brunoais wrote:Why is a single page better than a multiple page application like phpBB? I don't get it.
There are plenty of reasons. Just google it and you will find out why a lot of sites are going towards a javascript FW for client side than the old school static pages that refreshes completely for each page loads. Also once you know what Angular can do, its hard to discard it. Its just simply amazing and phpbb can benefit a lot from it!

User avatar
brunoais
Registered User
Posts: 964
Joined: Fri Dec 18, 2009 3:55 pm

Re: AngularJS for phpbb

Post by brunoais »

I seriously thing you are in the wrong page.
AngularJS is for javascript applications. phpBB is not a javascript application.
Yeah, it has js to improve the user's interaction with the website but it is definitely not a client side application.

I have already tried AngularJS to do some stuff (including simple games) and it is ok.I still prefer the DOM or the DOM with a simple facade (not a library like jQuery or mootools), though.

I searched for: "Why is a single page better than a multiple web page application"
None of the results on the 1st 2 pages answer my question.

Why is a single page website better for server programs like phpBB than multiple pages?

It works well with linkedin, it works well with google search(when js off), it works well with jsperf, it works well with github, it works well with stackexchange (&cia), it works well with blogspot, it works well with wordpress, etc... Why change it?

Also, AngularJS is awful when dealing with multiple tabs, same content. For instance, I like opening different topics in different tabs and also having multiple tabs each one working with its relevant information (happens a lot with phpBB). Are you going to tell me that links will stop working mostly like it is with facebook? I already use much less facebook because of that.
Also, are you going to use something that works with pushState()? I still want my back and forward buttons to work and hashes are a terrible PITA hack. AngularJS does not deal well with multiple urls meaning multiple pages (in my tests and research), btw.

There are some advantages having phpBB in a single page but, IMO, the disadvantages just outrun the advantages.

Alien_Time
Registered User
Posts: 165
Joined: Fri Apr 05, 2013 3:38 am

Re: AngularJS for phpbb

Post by Alien_Time »

brunoais, from your post I can understand that you barely even scratched the surface of Angular and hence you feel it doesnt suit phpbb. Actually, some of the things you have stated about Angular is not right. With the multiple tabs, Angular should have no problem in handling it. Also the urls works as per routing that Angular manages and each page that you visit in Angular will have its own url. So when you do open multiple tabs with different urls, Angular can fetch that page using ng-route. Angular also works when you use the normal browser back / forward buttons with no issue. The big difference (although there are many huge differences other than this) is, instead of loading the entire page each time, the main page frame with its resources are loaded once which will have the header, footer, navbar , etc.. and then the main page's content will be placed inside a "view". Angular then takes care of changing the view based on the url without needing to refresh the entire page. This is based on MVC architecture where the controller passes a scope to the view and the view is created based on the model. It also increases the page loading speed (ofcourse after the first load), faster and intuitive UI and gives a much richer interactions between UI components if you look at it from the user's perspective. Again, this is just one feature that I am highlighting and there are so much more you can do with AngularJS. We can take phpbb to a whole new level by using Angular (so any similar JS FW). Once we have the RESTful API done with phpbb, we can use the php for all server side processes like communicating with the db, use this server-side API for Dynamic data loading, submitting and processing forms and photos, fetch results and return back to Angular, etc.. and Angular takes care of the client side processes like showing the right contents to the user, form validations, displaying views, async processing, providing a more fluid user experience, etc.. etc.. Honestly, its too early to discard JS FW like Angular before even diving into it.

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1904
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: AngularJS for phpbb

Post by DavidIQ »

Does this work side by side with jQuery or other libraries?
Image

Alien_Time
Registered User
Posts: 165
Joined: Fri Apr 05, 2013 3:38 am

Re: AngularJS for phpbb

Post by Alien_Time »

DavidIQ wrote:Does this work side by side with jQuery or other libraries?
Yeah it does. Angular comes with JQLite built in and we can use jquery instead if we want. It is fully extensible and works well with other libraries. Here is a quote from Angular site:
AngularJS is a toolset for building the framework most suited to your application development. It is fully extensible and works well with other libraries. Every feature can be modified or replaced to suit your unique development workflow and feature needs. Read on to find out how.
Having said that, a lot of things done by jquery can be done easily with Angular itself and we may not even need to use jquery. But if we still like to use jquery alongside for something that cant be done from Angular (I cant think anything in particular), you can do so with no issue.

Post Reply