+ All Categories
Home > Technology > The journey from ActionScript to TypeScript

The journey from ActionScript to TypeScript

Date post: 14-Apr-2017
Category:
Upload: mcrtechnights
View: 445 times
Download: 0 times
Share this document with a friend
17
The Journey from ActionScript to TypeScript By Dan Gwynne [email protected] https://uk.linkedin.com/in/dangwynne V 1.1
Transcript
Page 1: The journey from ActionScript to TypeScript

The Journey from ActionScriptto TypeScript

By Dan Gwynne

[email protected]://uk.linkedin.com/in/dangwynne

V 1.1

Page 2: The journey from ActionScript to TypeScript

bet365, first, some numbers

£34 billion annual turnover

£60 million annual IT budget

1.5 million markets on site

600,000 concurrent users

600 IT employees

18 Languages

15 Data centres

6 Flash UI Devs

Page 3: The journey from ActionScript to TypeScript

Flash, the end is near…

• 2005 - Introduced In-Play to the site using Flash ActionScript 2• 2011 - Full Flash desktop site using ActionScript 3• 2016 - Continues to be industry leading website

Page 4: The journey from ActionScript to TypeScript

JavaScript

• In 2013 we started to look for alternatives to Flash…• JavaScript was the only choice

Page 5: The journey from ActionScript to TypeScript

• 1000’s of lines of code in one file• Hard to govern the coding pattern• ES6 (ECMAScript6, ES2015)• Types

The problems with JavaScript

Page 6: The journey from ActionScript to TypeScript

Solutions

Page 7: The journey from ActionScript to TypeScript

• Strict Typing• Classes• Modules• Accessors• Type Definitions• JavaScript• Microsoft

TypeScript

Page 8: The journey from ActionScript to TypeScript

Time to make the move?

• Merging of UI teams• Flash more mature product, Mobile needed the same quality• Typescript was proposed for Mobile

Page 9: The journey from ActionScript to TypeScript

Just one small problem…

Page 10: The journey from ActionScript to TypeScript

No time to wait around

• Mobile In-Play needed to be completed by the end of 2013• In-Play was written in JavaScript with strict coding standards• Deadline was achieved

Page 11: The journey from ActionScript to TypeScript

• Was TypeScript still right for us• What problems would we be solving by migrating

• Difficult to maintain large codebase• Missing the features of strongly typed languages

• How would we approach converting 40,000+ lines of JavaScript?• Carefully• Code had good structure – one class per file• Namespacing• In-line comments

18 months later, decision time…

Page 12: The journey from ActionScript to TypeScript

How did we do it?

• We’re a team of coders!• Successfully converted 85% of the JavaScript automatically• Conversion rate was around 6,000 lines per day

Page 13: The journey from ActionScript to TypeScript

Did it work?

• Not only did it work it made the product better• Compared output to focus our test efforts• Manual QA team found zero bugs• 10 days to convert, fix, test, update build tools and deploy to

production

Page 14: The journey from ActionScript to TypeScript

• Increase in quality• Faster development time• Happier developers

Was it worth it?

Page 15: The journey from ActionScript to TypeScript

• Platform independent development environment• Quality through tooling – linting, unit tests, Selenium, test harness• Gaming product has adopted TypeScript • TypeScript 2.0 – check out TypeScript roadmap on github.com• Sportsbook rewrite

• Replace Flash Desktop site• Rewrite remaining Mobile site

• Rewrite benefits developers as well as customers…

What next?

Page 16: The journey from ActionScript to TypeScript

• TypeScript• Guarantees quality• Saves time• Creates happy developers• Assists us to react quickly to change• Helps us maintain our market leading position

To conclude…

Page 17: The journey from ActionScript to TypeScript

The Journey from ActionScriptto TypeScript

By Dan Gwynne

[email protected]://uk.linkedin.com/in/dangwynne


Recommended