Skip to content

Instantly share code, notes, and snippets.

@bbenjamin
bbenjamin / promise-vs-async-await
Created February 13, 2022 23:10
Async await vs promise chain
const callDataMuse = function() {
const parseJson = function(response) {
return response.json();
}
const logParsedJson = function(parsedJson) {
console.log('parsed json!', parsedJson);
}
@bbenjamin
bbenjamin / drupalJqueryRemoval.md
Last active February 7, 2023 13:21
Issues relevant to Drupal JavaScript modernization and jQuery removal

Presentation Slides

https://docs.google.com/presentation/d/17Zpy5fZQsWsoZBhisA3rQiZy_JrK9MPR_HdgAisQ9XI/edit?usp=sharing

jQuery UI

@bbenjamin
bbenjamin / gist:13a44ce70cbed9d05061713b0c118cb0
Created March 26, 2018 02:44
Transpile Drupal Module/Theme ES6 to ES5 in PHPStorm
In PHPStorm, go to Preferences > Tools > File Watchers
Click the plus sign to add a new watcher, and choose Babel
Set "Program" to the babel-cli executable. On OSX this might be /usr/local/bin/babel.
Or, if babel-cli is installed in node_modules, you can use the version found in node_modules/.bin
Set "Arguments" to $FileDirRelativeToProjectRoot$/$FileNameWithoutAllExtensions$.es6.js --out-file $FileDirRelativeToProjectRoot$/$FileNameWithoutAllExtensions$.js
Set "Output Paths To Refresh" to
$FilePathRelativeToProjectRoot$/$FileNameWithoutAllExtensions$.es6.js:$FilePathRelativeToProjectRoot$/$FileNameWithoutAllExtensions$.js