- View: Also called a "template", a file that contains markup (like HTML) and optionally additional instructions on how to generate snippets of HTML, such as text interpolation, loops, conditionals, includes, and so on.
- View engine: Also called a "template library" or "templater", ie. a library that implements view functionality, and potentially also a custom language for specifying it (like Pug does).
- HTML templater: A template library that's designed specifically for generating HTML. It understands document structure and thus can provide useful advanced tools like mixins, as well as more secure output escaping (since it can determine the right escaping approach from the context in which a value is used), but it also means that the templater is not useful for anything other than HTML.
- String-based templater: A template library that implements templating logic, but that has no understanding of the content it is generating - it simply concatenates together strings, potenti
// given a commit function from useMutation | |
// return a promisfied version of the commit function that resolves to the mutation data | |
// and rejects with the mutation error | |
export function promisfy<TMutation extends MutationParameters>(commit: (config: UseMutationConfig<TMutation>) => Disposable) { | |
return (config: UseMutationConfig<TMutation>) => { | |
return new Promise<TMutation['response']>((resolve, reject) => { | |
// override the onComplete and onError callbacks to promisfy commit | |
const newConfig: UseMutationConfig<TMutation> = { | |
...config, | |
onCompleted: (data, errors) => { |
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
{ | |
"scripts": { | |
"build": "npm run build:es2015 && npm run build:esm && npm run build:cjs && npm run build:umd && npm run build:umd:min", | |
"build:es2015": "tsc --module es2015 --target es2015 --outDir dist/es2015", | |
"build:esm": "tsc --module es2015 --target es5 --outDir dist/esm", | |
"build:cjs": "tsc --module commonjs --target es5 --outDir dist/cjs", | |
"build:umd": "rollup dist/esm/index.js --format umd --name YourLibrary --sourceMap --output dist/umd/yourlibrary.js", | |
"build:umd:min": "cd dist/umd && uglifyjs --compress --mangle --source-map --screw-ie8 --comments --o yourlibrary.min.js -- yourlibrary.js && gzip yourlibrary.min.js -c > yourlibrary.min.js.gz", | |
} | |
} |
/** | |
* Globals | |
*/ | |
var Carrousel = function(elem) { this.init() }; | |
Carrousel.prototype = { init: function() {} }; | |
new Carrousel(); | |
/** | |
* Namespacing | |
* - No globals (only the namespace variable itself is global) |
Attendees: Norbert, Filipp, Chak Shun, Wei Wei, Neville, Gytis, Zol, Michael
Rough agenda: https://gist.github.com/shilman/815fe665614f552d72c504f357d6c6b1
Recorded video: https://www.youtube.com/watch?v=KnCV_Wu8Rbs&feature=youtu.be
- Filipp: Update the release process after 4.0:
- release 4.0 off
master
Keynote Day 1 - Mark Zuckerberg talks about data privacy and our responsibility as developers.
Type-Checked Python at Instagram - static typing using mypy (maintained by Dropbox) and how we can eliminate possible test cases so we can focus on tests with high granularity. Gradual typing of large codebases. Using MonkeyType to use runtime analysis to generate possible static types (e.g using tests).
How React Native Helps Companies Build Better Mobile Apps - Panel including Sophie Alpert, Engineering Manager for the React team. Reduce code duplication in codebases (iOS + Android). Learn once, write anywhere. Developers who have experience using React or React Native ca
Note:
When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.
If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:
- Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.