The web platform has a ton of warts. They're the result of historical baggage much of which could have been avoided.
As a frontend developer at Atlassian Bitbucket I've worked on apps big and small and have seen the benefits of composition and reuse of many small modules in the web browser. We compose together and compile over 1,000 modules in Bitbucket's frontend and ship them to user's browsers many times a week.
Learn how small modules solve these problems and more, how the future of the web is bright, and how to bring modularization and composition to your web app.
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
What the web platform (and your app!) can learn from Node.js
1. What the web platform can learn from Node.js
and what your web frontend can learn too!
Will Binns-Smith • Frontend Developer, Bitbucket • Atlassian • @wbinnssmith
2. var request = new XMLHttpRequest();
request.addEventListener("load", function () {
console.log(JSON.parse(this.responseText));
});
request.addEventListener("error", function (e) {
console.error("oh noes!!");
});
request.open("POST", "http://www.example.org/endpoint");
request.setRequestHeader("Accept", "application/json");
request.setRequestHeader("Content-Type", "application/json");
request.send(JSON.stringify({
my: 'data'
}));
3. POST { my: ‘data’ }
to http://example.com/endpoint
10. too bad we can’t change XHR
without breaking the internet
11. this happens a lot
DOM Mutation Events -> DOM Mutation Observers
Object.observe() -> Proxies, setters
AppCache -> ServiceWorkers
showModalDialog() -> <dialog>, Web Components
a lot of this is preventable.
12. we need a way to make mistakes and
improve upon them
16. it says what it does, not how to do it
(which in JavaScript often makes no sense anyway)
why?
var isNegativeZero = require(‘negative-zero’);
isNegativeZero(5); // false
isNegativeZero(-0); // true
isNegativeZero(0); // false