jadjoubran / laravel5-angular-material-starter

Get started with Laravel 5.3 and AngularJS (material)
https://laravel-angular.readme.io/
MIT License
1.66k stars 400 forks source link

Upcoming version - 3.3.0 #340

Closed jadjoubran closed 8 years ago

jadjoubran commented 8 years ago

Just before the final Angular 2 release, I'm working on an intermediary release that's focusing on one main aspect for Laravel & Angular 1

I'm trying to make it a Progressive Web App by providing support for the cool stuff that are recently made available in some browsers

It's still way too early in development, but everything's happening on branch feature-pwa Also some early planning is happening on trello

The goal is to have an architecture that is similar to the voice memos app (when you refresh, the main app shell is loaded from Service Workers allowing for a native like user experience) or any other Progressive Web App (http://pwa.rocks/)

I haven't seen any Angular 1 that's made into a progressive web app before, so it seems that it's challenging 😄 However Angular 2 can be configured to have a pwa support easily

The first step was to optimize the critical rendering path and by immediately painting the app shell.. which is kind of working but the fonts are still messing up

I will keep on pushing regular updates here, as usual feedback is highly appreciated (although it's barely usable right now) and we can always chat on gittr

jadjoubran commented 8 years ago

Things are still under construction, but I was able to make the whole page load in under 1 second on recurrent visits (with minified js and css). Service workers can now serve those resources instead of going to the network! 😄

If anyone would like to try it, you can follow these steps:

git clone this branch npm install gulp open first time recurrent visit should be super fast 🚀

flick36 commented 8 years ago

Looking forward to this i'll try it in the next couple of hourse great job @jadjoubran !!

Just to anyone that wants to try it you also have to composer install and bower install before using gulp and of course fix credentials in .env as well as creating the app key with: php artisan key:generate :P

jadjoubran commented 8 years ago

hahaha yes indeed

jadjoubran commented 8 years ago

I'm really excited about this 😄

In the gif below, first refresh is a hard refresh (cmd + shift + r) then all the other subsequent refreshes are regular refreshes (cmd + r).. You can see how fast the first paint is happening the first time because I'm inlining the critical css (critical path rendering) and for recurrent refreshes, everything is being served from the service worker

I still have a couple of chores left before I start working on the developer experience and fixing the design (especially the fonts 🔥 )

gif

I just realized that the gif is not continuous, so click on it to preview in a new tab

flick36 commented 8 years ago

@jadjoubran Gif is broken i get Not Found

Ok i can see it now :laughing:

jadjoubran commented 8 years ago

New updates!! Even faster initial load is achieved by caching the initial request (this can be changed to networkFirst strategy depending on the app) First time the app loads, it shows a toast saying that the app is ready for offline use And then newer versions show a toast: A newer version of this app is available - Refresh I still have an issue with the fonts though :/

milocosmopolitan commented 8 years ago

OMG so excited!

flick36 commented 8 years ago

What's wrong with the fonts? maybe i can help?

jadjoubran commented 8 years ago

@milocosmopolitan indeed :D @flick36 I wasn't able to load them without creating a FOUC (flash of unstyled content) or without blocking rendering which slows down things a lot on the initial load

That's why I left it to be the last task.. feel free to clone and give it a shot, but make sure to emulate 3g connections if you're on a fast one (I'm always on a slow connection here in my country 💩 )

jadjoubran commented 8 years ago

Fixed the fonts issue!

flick36 commented 8 years ago

Wom im good hahaha xD what did you do?

jadjoubran commented 8 years ago

Haha, downloaded the files rather than using them off Google webfonts

jadjoubran commented 8 years ago

Here's a demo 😄 https://test.laravel-angular.io/ I'd love to get some feedback but not that it's not ready for prime time yet, lots of Developer Experience fixes need to be done

You can also try it from your phone, if you've got an android you can add it to homescreen and it'll behave like a native app (works offline) and later on you can configure it to send push notifications

followtheart commented 8 years ago

How can i add it to homescreen?

jadjoubran commented 8 years ago

@followtheart just like this add to homescreen

jadjoubran commented 8 years ago

Now you can generate your own manifest.json by just running artisan pwa:manifest 🚀

screen shot 2016-06-28 at 9 08 16 pm
jadjoubran commented 8 years ago

So this should be stable by now 😄 Is anyone interested in testing this with me once I launch the beta?

flick36 commented 8 years ago

:raising_hand: never done testing before, so i might not be that useful :v

jadjoubran commented 8 years ago

@flick36 awesome, no worries 😄 @hackur would you also be interested? It seems you're already trying it

hackur commented 8 years ago

Sure. I'll let you know if I run into any issues.

jadjoubran commented 8 years ago

Just tagged 3.3.0-beta, it would be great if you guys can tell me what can be improved in the process 😄

jadjoubran commented 8 years ago

I'm also working on a progressive web app based on this that I will open source later on as a demo

followtheart commented 8 years ago

Really need more demo project based on this project

jadjoubran commented 8 years ago

I'm developing a blog app to see what can be improved for 3.3.0 Here are the issues that I faced:

And btw Chrome canary makes it easier to use new features for service workers (I'll document that)

jadjoubran commented 8 years ago

Update: networkFirst and networkOnly are working, but chrome shows that they're being served by the service worker, because the server worker is handling them by forwarding them to the network.. so nothing is wrong for this 👍 This can be verified by watching the response time when choosing networkFirst or cacheFirst

jadjoubran commented 8 years ago

I will probably skip Live Reload over https because I can't seem to make it work.. unless someone has done it before Also, @hackur and @flick36 do you have any comments before the 3.3.0 release?

hackur commented 8 years ago

Nothing from me yet. I was able to generate the manifest without any issues. I just don't know enough about PWA's yet - so I'm probably going to have to give my input once I get a little bit better idea of how it's all suppose to work.

Can you suggest any additional resources I should read to learn more about your approach to PWA's?

I've mostly been referencing these: https://developers.google.com/web/progressive-web-apps/ https://developers.google.com/web/fundamentals/getting-started/?hl=en https://developers.google.com/web/updates/2015/11/app-shell?hl=en

jadjoubran commented 8 years ago

Those are the best resources, I'd add this one by @addyosmani https://medium.com/google-developers/instant-loading-web-apps-with-an-application-shell-architecture-7c0c2f10c73#.d9hypdfhz I'll also explain a lot of topics during the screencasts

jadjoubran commented 8 years ago

I've also watched all of 2015's Chrome dev summit Especially the below:

flick36 commented 8 years ago

Hi @jadjoubran been really bussy to answer anything x.x i haven't found nothing strange yet, so my only comment for now would be AWESOME JOB!

jadjoubran commented 8 years ago

Just tagged 3.3.0-rc Feel free to send in your suggestions before I publish 3.3.0 😄 I'm also starting to work on the documentation & screencasts which are going to take some time

jadjoubran commented 8 years ago

3.3.0 has been released 😄 I started working on the documentation and I'll record screencasts soon

mvpasarel commented 8 years ago

@jadjoubran Great news!

jadjoubran commented 8 years ago

@mvpasarel did you have any comments so far? 😄

mvpasarel commented 8 years ago

@jadjoubran I haven't found any issues and it looks great! I managed to easily use it on what I had to do until now. But I haven't got to the part where I need to use business logic, I only implemented some HTML templates which worked like a charm without too much setup.

jeslomo commented 8 years ago

Oooh! Great!! @jadjoubran

I've a comment (or sugggest).

I've change reference in the index.blade.php to css/js.

I use apache for serve the app, and when use localhost/ the dependences crash because the route it's absolute. I fix it using : asset function of laravel.

I've problem too with CORS because the .htaccess not woring if use php artisan serve (this is the motive for put the app in apache folder).

jadjoubran commented 8 years ago

ah true.. that's a problem that we also faced here in #337 Didn't you also have to change the generated code for components? because it starts with an absolute path..

I just published the Progressive Web App docs for 3.3.0, I'm now drafting the upgrading guide and changelog 😄

jadjoubran commented 8 years ago

First progressive web app tutorial for version 3.3 😄 https://www.youtube.com/watch?v=qe5dJdPYvfA