Upgrade to Pro — share decks privately, control downloads, hide ads and more …

JavaScript History and Workflows

Shakeel Shafiq
November 28, 2015
140

JavaScript History and Workflows

A bit of JavaScript history and it's latest workflows.

Shakeel Shafiq

November 28, 2015
Tweet

Transcript

  1. Early Days Spawned in 1995, Added support for Java applets

    more accessible to non-Java programmers Aka Mocha and LiveScript but was named JavaScript because of the popularity of Java Had low barrier to entry Went under European Computer Manufacturers Association in late 1996 JavaScript was under the commercial pressure because of the wars between Microsoft, Netscape and others. In the fall of 1996, Eich rewrite Mocha as the codebase that became known as SpiderMonkey
  2. JSON 2002 Real-time server browser communication were heavily based on

    Flash or Java applets State exchange was needed for JavaScript JavaScript Object Notation { "glossary": { "title": "example glossary", "GlossDiv": { "title": "S", "GlossList": { "GlossEntry": { "ID": "SGML", "SortAs": "SGML", "GlossTerm": "Standard Generalized Markup Language", "Acronym": "SGML", "Abbrev": "ISO 8879:1986", "GlossDef": { "para": "A meta-markup language, used to create markup languages such as DocBook.", "GlossSeeAlso": ["GML", "XML"] }, "GlossSee": "markup" } } } } }
  3. 2008 / V8 / Chrome / Node Ryan Dahl Trying

    to speed up web server Exploited Evented nature of JS Same language on Server and Client High concurrency
  4. Javascript Modules ES5 does not have any way to define

    modules AMD (Asynchronous Module Definition) 1. define('myModule', 2. ['foo', 'bar'], 3. // module definition function 4. // dependencies (foo and bar) are mapped to function parameters 5. function ( foo, bar ) { 6. // return a value that defines the module export 7. // (i.e the functionality we want to expose for consumption) 8. 9. // create your module here 10. var myModule = { 11. doStuff:function(){ 12. console.log('Yay! Stuff'); 13. } 14. } 15. 16. return myModule; 17. }); 1. // Consider 'foo' and 'bar' are two external modules 2. // In this example, the 'exports' from the two modules loaded are passed as 3. // function arguments to the callback (foo and bar) 4. // so that they can similarly be accessed 5. 6. require(['foo', 'bar'], function ( foo, bar ) { 7. // rest of your code here 8. foo.doSomething(); 9. });
  5. Workflows Node started to be used as build tool var

    _fs = require('fs'); function concat(opts) { var fileList = opts.src; var distPath = opts.dest; var out = fileList.map(function(filePath){ return _fs.readFileSync(filePath).toString(); }); _fs.writeFileSync(distPath, out.join('\n')); console.log(' '+ distPath +' built.'); } concat({ src : [ 'foo/bar.js', 'foo/lorem.js', 'foo/maecennas.js' ], dest : 'dist/myAwesomeScript.js' });
  6. Workflows Times have changed. Now distributing your JavaScript code can

    be a complex endeavor SPA’s rely on heavy libraries
  7. There are two ways that a language becomes important. “The

    first is as a source or proving ground for important ideas. This includes languages like Smalltalk and Scheme. These languages are not widely used, but are generally recognized as brilliant, but out of fashion. They have a powerful influence on language designers. The second way that a language becomes important is by becoming popular.” -Douglas Crockford