Fullcalendar.io for Vue: No more custom scripts

Few years, ago, I had to dance around fullcalendar.io library to get it working nicely in VueJS framework. Some wrappers, custom components and lots of external jQuery code to make it work.

No more of it! Now, cakephp-calendar can be re-written using fullcalendar-vue package. And it sound like a perfect weekend task:

  • Getting rid of custom event treating
  • RFC all the way with Recurrences
  • Clean State Management and stand-alone JS npm package (instead of all-in-one solution)

Congratulations to developers from fullcalendar community, who did a great job moving away to TypeScript, and making the codebase more incorporating with modern frameworks like Vue/React/Angular.

PHP RFC: Comprehensions

Another interesting RFC recently landed to PHP community. So far the easiest way of explaining comprehensions for me comes from Python world:

Comprehensions are constructs that allow sequences to be built from other sequences.

Here’re some examples from List comprehensions in Python:

def palindromes(strings):
    return [s + s[::-1] for s in strings]

def starting_with(letter, names):
    return [name for name in names if name[0].lower() == letter.lower()]

JavaScript, however, decided to remove its support from standard in favour of filter/arrow/map functions.

The array comprehensions syntax is non-standard and removed starting with Firefox 58. For future-facing usages, consider using Array.prototype.mapArray.prototype.filterarrow functions, and spread syntax.

MDN

Speaking of PHP RFC, that’s what we might get if RFC gets approved:

$gen = [for $list as $x if $x % 2 yield $x*2];

//equivalent to:

$gen = (function() use ($list) {
  foreach ($list as $x) {
    If ($x % 2) {
     yield $x * 2;
    }
  }
})();

Personally, I would vote in favour of this. Maybe, it’s nostalgia about Perl one-liners and how elegant you can solve some basic stuff. I think PHP needs this syntactic sugar, giving people choice of using closure calls and comprehensions.

Disney to compete with Netflix

Disney executives didn’t mention Netflix once during their three-hour-plus investor presentation Thursday, at which the company laid out its plans to build up a suite of subscription streaming services — most notably Disney+, a $7-a-month service bursting with movies and TV shows. Disney+ launches in the US in November and will feature everything from Disney’s recent theatrical offerings, like Captain Marvel, to classic Disney movies like Bambi, and new, original stuff like The Mandalorian, a Star Wars TV-show spinoff.

recode

“First they ignore you, then they laugh at you, then they fight you, then you win”. (c) Gandhi

Rumours: Facebook brings back Messenger to App

FastCompany recently posted some rumours on possible integration of FB Messenger back to Facebook app:

Until 2014, Facebook users were able to send and receive Facebook messages in the primary app. But then Facebook decided to remove the messaging feature from the app and forced users to use the dedicated Facebook Messenger app to send and receive Facebook messages.

Wong speculates that the reversal of this policy is in preparation of Facebook integrating its messaging services across all its apps: Messenger, WhatsApp, and Instagram..

FastCompany

Seems that, a number of people who removed FB app from mobiles, is larger than presented on the media. It’s quiet some time since I removed FB app from my mobile, due to its constant irrelevant notifications. Less than a month ago, I gave Facebook another try. It lasted few days till I deleted it again.

I still occasionally use it through the browser, but not the app:

  • UI/UX got overwhelmed with stuff I don’t use
  • Content level reduced drastically
  • All the data leaks didn’t help bringing the trust to the brand

Most of the valuable content slowly migrated to messengers, some of which belong to Facebook, but yet again, if FB will bring Messenger back to its mobile app, it’d be easier to cross this app out as well, and move to WhatsApp/Telegram alternatives.

SPA reload after deploy

John Resig, founder of jQuery, recently raised a great discussion on how to handle Single Page Application reloading after deployment.

Some of the options included:

  • Pass build version with each Ajax response and reload if mismatched.
  • Send a version hash to a server and force 412 code if versions not matching.
  • Notification on version update to leave refresh up to user to decide.
  • Client version passed in HTTP header to check for updates.
  • Log out all the clients at midnight
  • Turning on the servers only from 9 till 5.