Note: I'm not involved in Prepack in any way — please correct me if I say anything incorrect below!
A few people have asked me if Prepack and Svelte are similar projects with similar goals. The answer is 'no, they're not', but let's take a moment to explore why.
What is Prepack?
Prepack describes itself as a 'partial evaluator for JavaScript'. What that means is that it will run your code in a specialised interpreter that, rather than having some effect on the world (like printing a message to the console), will track the effects that would have happened and express them more directly.
So for example if you give it this code...
Run Cisco Webex on 64-bit Ubuntu 16.04
With Audio and Screen Sharing Enabled
Enable support for 32-bit executables
Add the i386
architecture to the list of dpkg
architectures :
sudo dpkg --add-architecture i386
Running nightmare on Amazon Linux
You may have thought of running nightmare on AWS Lambda. But before we can run it on Lambda, we need first to make it run on Amazon Linux.
Provision instance which replicates Lambda environment
According to AWS Documentation on Lambda Execution Environment and available Libraries we would need this AMI image with this alias amzn-ami-hvm-2016.03.3.x86_64-gp2
. Keep in mind that AMI-image-id for this instance would be different in different regions (eg):
- In
eu-west-1
-ami-f9dd458a
- In
us-east-1
-ami-6869aa05
/* | |
TODO: | |
- Option to wait to apply anything until all <link>s are parsed or inject what we have and update as each <link> returns | |
*/ | |
var cssVarPoly = { | |
init: function() { | |
if (window.CSS && window.CSS.supports && window.CSS.supports('(--foo: red)')) { | |
return; | |
} | |
cssVarPoly.ratifiedVars = {}; |
What forces layout / reflow
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Element
Box metrics
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent
elem.clientLeft
,elem.clientTop
,elem.clientWidth
,elem.clientHeight
elem.getClientRects()
,elem.getBoundingClientRect()
Setup
Replace IRB with Pry (in your Gemfile) and Byebug with pry-byebug
.
gem 'pry-rails', group: [:development, :test]
gem 'pry-byebug', group: [:development, :test]
Using PRY
var ChatAppDispatcher = require('../dispatcher/ChatAppDispatcher'); | |
var ChatConstants = require('../constants/ChatConstants'); | |
var ChatMessageUtils = require('../utils/ChatMessageUtils'); | |
var EventEmitter = require('events').EventEmitter; | |
var ThreadStore = require('../stores/ThreadStore'); | |
var merge = require('react/lib/merge'); | |
var ActionTypes = ChatConstants.ActionTypes; | |
var CHANGE_EVENT = 'change'; |
Installing V8 on a Mac
Prerequisites
- Install Xcode (Avaliable on the Mac App Store)
- Install Xcode Command Line Tools (Preferences > Downloads)
- Install depot_tools
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
sudo nano ~/.bash_profile
- Add
export PATH=/path/to/depot_tools:"$PATH"
(it's important that depot_tools comes first here)
The introduction to Reactive Programming you've been missing
(by @andrestaltz)
This tutorial as a series of videos
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.