SlideShare uma empresa Scribd logo
1 de 22
SLODUG - Slovenian Developers User Group

Posladkajmo si
JavaScript z uporabo
TypeScript-a

1.10.2013, @papsl
Peter?
•
•
•
•
•
•
•
•
•

Since 1986
IT SysAdmin (MCSE NT 4.0 :)
C#, T-SQL
Web and Mobile
Security & WhiteHacks
Computer history
Agile practices
Working at pixi* labs d.o.o.
Moje Kartice project

@papsl
peterpsi.blogspot.com
Svetla stran
• „JavaScript is x86 of the web“
• Deluje na vseh platformah
• Hiter začetek; Široka uporaba
• dynamic, prototype; closure, curry, …
Temna stran
• Standardizacija
• Kompleksna sintaksa, nejasna koda
• JS postal programski jezik tudi za strežniški del (svetla

stran)
• Težavno strukturiranje, uporaba razredov, modulov
• Pomanjkljivo znanje
Umetna sladila
• Prevajalniki
• CoffeScript
• Google Closure (JSDoc)
• Orodja za preverjanje kvalitete
• JSLint, JSHint, …
• Drugo
• Dart „Ultimately to replace JavaScript as the
lingua franca of web development on
the open web platform“
Kaj pa TypeScript?
• TypeScript se prevede v JavaScript
• JavaScript je TypeScript (superset)
• Pripravljen z mislijo na ECMAScript 6
• Deluje na vseh platformah, ki podpirajo JavaScript
• Prinaša:
• Optional static typing
• Clean syntax
• Class based Objet Oriented Programing, Interface, Modules…
• Is just a syntactic sugar
• Header (definition) files for existing JavaScript libs.
• Great tools (VS+InteliSense)
Kratka zgodovina
• Razvija ga Microsoft

• Izdan v December 2012 Apache

2 License (trenutno 0.9.1.1)
• Izvorna koda na codeplex.com
• Anders Hejlsberg
• Pascal compiler (DOS and CP/M)
• Borland: Turbo Pascal & Delphi
• Microsoft: C#

„No, you can write large programs in JavaScript.
You just can’t maintain them.“
Umažimo si roke!
• Igrišče (brez vseh namestitev)
• http://www.typescriptlang.org/Playground/
• Prenos in namestitev
• http://www.typescriptlang.org/#Download
• Visual Studio 2012/2013 RC
• node.js
• npm install –g typescript
• tsc helloworld.ts
• node helloword.js

• tsc hellomodule.ts --module "amd"

• lib.d.ts
Podatkovni tipi
• Osnovni
• Boolean
• Number
• String
• Any
• Null (nima vrednosti)
• Undefined (ni instanciran)
• Object
• Void

• HTMLElement …

Podatkovne tipe se preverja le med prevajanjem
Class
Interfaces
Moduli
• Zakaj?
• Strukturiranje
• „Global scope pollution“
• Poznamo
• Interne
• Imenski prostor (beri: namespace)
• Ne pozabi „//<reference path=‚nekaj.ts'/>“ ni dovolj

• Zunanje
• AMD
• requireJS (uporaba v spletnih brskalnikih)
• commonJS
• node.js (za strežniško stran in tudi za brskalnik)
Moduli - interni
Moduli - zunanji
Triki
• Kreiraj „references.ts“, v njem referenciraj vse ts skripte in

nato referenciraj le references.ts
• NuGet:
• Install-Package RequireJS
• Install-Package RequireJS.TypeScript.DefinitelyTyped

• Web Essentials 3.x brez podpore za TypeScript
• http://madskristensen.net/post/Web-Essentials-2013-Where-is-theTypeScript-support.aspx
• Izklopi nadležni „The file has been modified outside of the

source editor “
• Tools -> Options, Environment -> Documents
• „Detect when files changed outside the environment“
Time for Coffe?
TypeScript

CoffeScript

• Individual can chose
• Sugar is optional

• All team „must“ switch

• Syntax familiar to

Ruby, Phyton, Haskell
• Older, mature, very
popular

C#, Java

• Syntax familiar to
Type, Coffee or
vanilla?
VPRAŠANJA?
HVALA!
Še zadnji nasvet: pred resno uporabo preberi:
„TypeScript Language Specification.pdf“

http://peterpsi.blogspot.com
@papsl
I want more
• TypeScript Download (or install it via node npm)
• http://www.typescriptlang.org/#Download
• http://www.typescriptlang.org/tutorial/
• The repository for high quality TypeScript type definition

(node, jQuery, knockout,
• https://github.com/borisyankov/DefinitelyTyped

• Source Code
• http://typescript.codeplex.com/
• JavaScript Patterns
• WebEssentials 2012 (VS addin)
Resources
• http://channel9.msdn.com/posts/Anders-Hejlsberg•
•
•
•
•

Introducing-TypeScript (1.10.2012) :)
http://blogs.msdn.com/b/typescript/
http://www.typescriptlang.org/Tutorial/
https://github.com/DefinitelyTyped/typescript-directory *
http://en.wikipedia.org/wiki/TypeScript
http://en.wikipedia.org/wiki/Anders_Hejlsberg

• Nathan Smith, fotografija
• http://www.flickr.com/photos/nathansmith/4704268314/sizes/l/in/ph
otostream/
• Internet
Primeri uporabe
• JS game engine: http://typedarray.org/introducing-starling-

js/ Demo: http://gamua.com/area-51/
• TypeScript with JSDoc support (for Google Closure)
https://github.com/evanw/typescript-closure-compiler

Mais conteúdo relacionado

Mais procurados

Using Javascript in today's world
Using Javascript in today's worldUsing Javascript in today's world
Using Javascript in today's worldSudar Muthu
 
Why and How You Should Move from PHP to Node.js
Why and How You Should Move from PHP to Node.jsWhy and How You Should Move from PHP to Node.js
Why and How You Should Move from PHP to Node.jsBrainhub
 
Single Sign On in Ruby - Enterprise Ready!
Single Sign On in Ruby - Enterprise Ready!Single Sign On in Ruby - Enterprise Ready!
Single Sign On in Ruby - Enterprise Ready!Nikos Dimitrakopoulos
 
Getting Started with the TypeScript Language
Getting Started with the TypeScript LanguageGetting Started with the TypeScript Language
Getting Started with the TypeScript LanguageGil Fink
 
Power Leveling your TypeScript
Power Leveling your TypeScriptPower Leveling your TypeScript
Power Leveling your TypeScriptOffirmo
 
Going Offline with JS
Going Offline with JSGoing Offline with JS
Going Offline with JSbrendankowitz
 
How to Make Your Code OSGi Friendly Without Depending on OSGi - Neil Bartlett
How to Make Your Code OSGi Friendly Without Depending on OSGi - Neil BartlettHow to Make Your Code OSGi Friendly Without Depending on OSGi - Neil Bartlett
How to Make Your Code OSGi Friendly Without Depending on OSGi - Neil Bartlettmfrancis
 
[Js hcm] Java script- Testing the awesome
[Js hcm] Java script- Testing the awesome[Js hcm] Java script- Testing the awesome
[Js hcm] Java script- Testing the awesomeJavaScript Meetup HCMC
 
Next-generation JavaScript - OpenSlava 2014
Next-generation JavaScript - OpenSlava 2014Next-generation JavaScript - OpenSlava 2014
Next-generation JavaScript - OpenSlava 2014Oscar Renalias
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.jsVadym Lotar
 
Scripting with NodeJS
Scripting with NodeJSScripting with NodeJS
Scripting with NodeJSBen Pearson
 
Railsチュートリアルの歩き方 (第4版)
Railsチュートリアルの歩き方 (第4版)Railsチュートリアルの歩き方 (第4版)
Railsチュートリアルの歩き方 (第4版)Yohei Yasukawa
 
Node Community Chennai MeetUp1
Node Community Chennai MeetUp1Node Community Chennai MeetUp1
Node Community Chennai MeetUp1akendoffice
 

Mais procurados (20)

Using Javascript in today's world
Using Javascript in today's worldUsing Javascript in today's world
Using Javascript in today's world
 
Why and How You Should Move from PHP to Node.js
Why and How You Should Move from PHP to Node.jsWhy and How You Should Move from PHP to Node.js
Why and How You Should Move from PHP to Node.js
 
Rust 101 (2017 edition)
Rust 101 (2017 edition)Rust 101 (2017 edition)
Rust 101 (2017 edition)
 
Single Sign On in Ruby - Enterprise Ready!
Single Sign On in Ruby - Enterprise Ready!Single Sign On in Ruby - Enterprise Ready!
Single Sign On in Ruby - Enterprise Ready!
 
Distributing OSGi
Distributing OSGiDistributing OSGi
Distributing OSGi
 
Getting Started with the TypeScript Language
Getting Started with the TypeScript LanguageGetting Started with the TypeScript Language
Getting Started with the TypeScript Language
 
Monorepo at Pinterest
Monorepo at PinterestMonorepo at Pinterest
Monorepo at Pinterest
 
Power Leveling your TypeScript
Power Leveling your TypeScriptPower Leveling your TypeScript
Power Leveling your TypeScript
 
Going Offline with JS
Going Offline with JSGoing Offline with JS
Going Offline with JS
 
How to Make Your Code OSGi Friendly Without Depending on OSGi - Neil Bartlett
How to Make Your Code OSGi Friendly Without Depending on OSGi - Neil BartlettHow to Make Your Code OSGi Friendly Without Depending on OSGi - Neil Bartlett
How to Make Your Code OSGi Friendly Without Depending on OSGi - Neil Bartlett
 
TypeScript
TypeScriptTypeScript
TypeScript
 
[Js hcm] Java script- Testing the awesome
[Js hcm] Java script- Testing the awesome[Js hcm] Java script- Testing the awesome
[Js hcm] Java script- Testing the awesome
 
TypeScript 101
TypeScript 101TypeScript 101
TypeScript 101
 
Next-generation JavaScript - OpenSlava 2014
Next-generation JavaScript - OpenSlava 2014Next-generation JavaScript - OpenSlava 2014
Next-generation JavaScript - OpenSlava 2014
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Scripting with NodeJS
Scripting with NodeJSScripting with NodeJS
Scripting with NodeJS
 
NodeJS Presentation
NodeJS PresentationNodeJS Presentation
NodeJS Presentation
 
Railsチュートリアルの歩き方 (第4版)
Railsチュートリアルの歩き方 (第4版)Railsチュートリアルの歩き方 (第4版)
Railsチュートリアルの歩き方 (第4版)
 
Node Community Chennai MeetUp1
Node Community Chennai MeetUp1Node Community Chennai MeetUp1
Node Community Chennai MeetUp1
 
Mono Repo
Mono RepoMono Repo
Mono Repo
 

Destaque

Passaparaula fades i mags
Passaparaula fades i magsPassaparaula fades i mags
Passaparaula fades i magsSilviasfassis
 
Passaparaula fades i mags 2
Passaparaula fades i mags 2Passaparaula fades i mags 2
Passaparaula fades i mags 2Silviasfassis
 
Classroom rules
Classroom rulesClassroom rules
Classroom rulesLily Kotze
 
Mhs sustentar 2011 9 30
Mhs   sustentar 2011 9 30Mhs   sustentar 2011 9 30
Mhs sustentar 2011 9 30forumsustentar
 
Andries 1 life and living
Andries 1   life and livingAndries 1   life and living
Andries 1 life and livingLily Kotze
 
Slide_G&VR_KienHuongToan
Slide_G&VR_KienHuongToanSlide_G&VR_KienHuongToan
Slide_G&VR_KienHuongToandaotac911
 
Apresentação - Reunião de Comitê 2013/2
Apresentação - Reunião de Comitê 2013/2Apresentação - Reunião de Comitê 2013/2
Apresentação - Reunião de Comitê 2013/2forumsustentar
 
Earth and beyond
Earth and beyondEarth and beyond
Earth and beyondLily Kotze
 
Revision of Scientific Method
Revision of Scientific MethodRevision of Scientific Method
Revision of Scientific MethodLily Kotze
 
Particle model of matter a quick summary
Particle model of matter a quick summaryParticle model of matter a quick summary
Particle model of matter a quick summaryLily Kotze
 
Circulatory system
Circulatory systemCirculatory system
Circulatory systemLily Kotze
 

Destaque (17)

Passaparaula desert
Passaparaula desertPassaparaula desert
Passaparaula desert
 
5. stars
5. stars5. stars
5. stars
 
10 years
10 years10 years
10 years
 
Passaparaula fades i mags
Passaparaula fades i magsPassaparaula fades i mags
Passaparaula fades i mags
 
Passaparaula fades i mags 2
Passaparaula fades i mags 2Passaparaula fades i mags 2
Passaparaula fades i mags 2
 
Classroom rules
Classroom rulesClassroom rules
Classroom rules
 
Apresentaao eco-final
Apresentaao eco-finalApresentaao eco-final
Apresentaao eco-final
 
Mhs sustentar 2011 9 30
Mhs   sustentar 2011 9 30Mhs   sustentar 2011 9 30
Mhs sustentar 2011 9 30
 
Carlos eduardo
Carlos eduardoCarlos eduardo
Carlos eduardo
 
Andries 1 life and living
Andries 1   life and livingAndries 1   life and living
Andries 1 life and living
 
Slide_G&VR_KienHuongToan
Slide_G&VR_KienHuongToanSlide_G&VR_KienHuongToan
Slide_G&VR_KienHuongToan
 
Apresentação - Reunião de Comitê 2013/2
Apresentação - Reunião de Comitê 2013/2Apresentação - Reunião de Comitê 2013/2
Apresentação - Reunião de Comitê 2013/2
 
Dimensional analysis
Dimensional analysis Dimensional analysis
Dimensional analysis
 
Earth and beyond
Earth and beyondEarth and beyond
Earth and beyond
 
Revision of Scientific Method
Revision of Scientific MethodRevision of Scientific Method
Revision of Scientific Method
 
Particle model of matter a quick summary
Particle model of matter a quick summaryParticle model of matter a quick summary
Particle model of matter a quick summary
 
Circulatory system
Circulatory systemCirculatory system
Circulatory system
 

Semelhante a Posladkajmo si JavaScript z uporabo TypeScript a

DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
DownTheRabbitHole.js – How to Stay Sane in an Insane EcosystemDownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
DownTheRabbitHole.js – How to Stay Sane in an Insane EcosystemFITC
 
Expert JavaScript Programming
Expert JavaScript ProgrammingExpert JavaScript Programming
Expert JavaScript ProgrammingYoshiki Shibukawa
 
TypeScript . the JavaScript developer best friend!
TypeScript . the JavaScript developer best friend!TypeScript . the JavaScript developer best friend!
TypeScript . the JavaScript developer best friend!Alessandro Giorgetti
 
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
DownTheRabbitHole.js – How to Stay Sane in an Insane EcosystemDownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
DownTheRabbitHole.js – How to Stay Sane in an Insane EcosystemFITC
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.jsorkaplan
 
Introduction to node.js aka NodeJS
Introduction to node.js aka NodeJSIntroduction to node.js aka NodeJS
Introduction to node.js aka NodeJSJITENDRA KUMAR PATEL
 
Typescript Fundamentals
Typescript FundamentalsTypescript Fundamentals
Typescript FundamentalsSunny Sharma
 
Masterin Large Scale Java Script Applications
Masterin Large Scale Java Script ApplicationsMasterin Large Scale Java Script Applications
Masterin Large Scale Java Script ApplicationsFabian Jakobs
 
Using type script to build better apps
Using type script to build better appsUsing type script to build better apps
Using type script to build better appsColdFusionConference
 
Using type script to build better apps
Using type script to build better appsUsing type script to build better apps
Using type script to build better appsdevObjective
 
IoT mit Rust programmieren
IoT mit Rust programmierenIoT mit Rust programmieren
IoT mit Rust programmierenLars Gregori
 
Open Source Cyber Weaponry
Open Source Cyber WeaponryOpen Source Cyber Weaponry
Open Source Cyber WeaponryJoshua L. Davis
 
Getting Started with Java
Getting Started with JavaGetting Started with Java
Getting Started with JavaMichael Redlich
 
dotNet Miami - May 17th, 2012: Will Tartak: Designing for Mobile Development
dotNet Miami - May 17th, 2012: Will Tartak: Designing for Mobile DevelopmentdotNet Miami - May 17th, 2012: Will Tartak: Designing for Mobile Development
dotNet Miami - May 17th, 2012: Will Tartak: Designing for Mobile DevelopmentdotNet Miami
 
Kiss.ts - The Keep It Simple Software Stack for 2017++
Kiss.ts - The Keep It Simple Software Stack for 2017++Kiss.ts - The Keep It Simple Software Stack for 2017++
Kiss.ts - The Keep It Simple Software Stack for 2017++Ethan Ram
 
Typescript: JS code just got better!
Typescript: JS code just got better!Typescript: JS code just got better!
Typescript: JS code just got better!amit bezalel
 

Semelhante a Posladkajmo si JavaScript z uporabo TypeScript a (20)

DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
DownTheRabbitHole.js – How to Stay Sane in an Insane EcosystemDownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
 
Why ruby and rails
Why ruby and railsWhy ruby and rails
Why ruby and rails
 
Expert JavaScript Programming
Expert JavaScript ProgrammingExpert JavaScript Programming
Expert JavaScript Programming
 
TypeScript . the JavaScript developer best friend!
TypeScript . the JavaScript developer best friend!TypeScript . the JavaScript developer best friend!
TypeScript . the JavaScript developer best friend!
 
David buksbaum a-briefintroductiontocsharp
David buksbaum a-briefintroductiontocsharpDavid buksbaum a-briefintroductiontocsharp
David buksbaum a-briefintroductiontocsharp
 
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
DownTheRabbitHole.js – How to Stay Sane in an Insane EcosystemDownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 
Introduction to node.js aka NodeJS
Introduction to node.js aka NodeJSIntroduction to node.js aka NodeJS
Introduction to node.js aka NodeJS
 
Typescript Fundamentals
Typescript FundamentalsTypescript Fundamentals
Typescript Fundamentals
 
Masterin Large Scale Java Script Applications
Masterin Large Scale Java Script ApplicationsMasterin Large Scale Java Script Applications
Masterin Large Scale Java Script Applications
 
Using type script to build better apps
Using type script to build better appsUsing type script to build better apps
Using type script to build better apps
 
Using type script to build better apps
Using type script to build better appsUsing type script to build better apps
Using type script to build better apps
 
Be faster then rabbits
Be faster then rabbitsBe faster then rabbits
Be faster then rabbits
 
IoT mit Rust programmieren
IoT mit Rust programmierenIoT mit Rust programmieren
IoT mit Rust programmieren
 
Open Source Cyber Weaponry
Open Source Cyber WeaponryOpen Source Cyber Weaponry
Open Source Cyber Weaponry
 
Getting Started with Java
Getting Started with JavaGetting Started with Java
Getting Started with Java
 
dotNet Miami - May 17th, 2012: Will Tartak: Designing for Mobile Development
dotNet Miami - May 17th, 2012: Will Tartak: Designing for Mobile DevelopmentdotNet Miami - May 17th, 2012: Will Tartak: Designing for Mobile Development
dotNet Miami - May 17th, 2012: Will Tartak: Designing for Mobile Development
 
Kiss.ts - The Keep It Simple Software Stack for 2017++
Kiss.ts - The Keep It Simple Software Stack for 2017++Kiss.ts - The Keep It Simple Software Stack for 2017++
Kiss.ts - The Keep It Simple Software Stack for 2017++
 
Node and Azure
Node and AzureNode and Azure
Node and Azure
 
Typescript: JS code just got better!
Typescript: JS code just got better!Typescript: JS code just got better!
Typescript: JS code just got better!
 

Último

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 

Último (20)

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 

Posladkajmo si JavaScript z uporabo TypeScript a

  • 1. SLODUG - Slovenian Developers User Group Posladkajmo si JavaScript z uporabo TypeScript-a 1.10.2013, @papsl
  • 2. Peter? • • • • • • • • • Since 1986 IT SysAdmin (MCSE NT 4.0 :) C#, T-SQL Web and Mobile Security & WhiteHacks Computer history Agile practices Working at pixi* labs d.o.o. Moje Kartice project @papsl peterpsi.blogspot.com
  • 3. Svetla stran • „JavaScript is x86 of the web“ • Deluje na vseh platformah • Hiter začetek; Široka uporaba • dynamic, prototype; closure, curry, …
  • 4. Temna stran • Standardizacija • Kompleksna sintaksa, nejasna koda • JS postal programski jezik tudi za strežniški del (svetla stran) • Težavno strukturiranje, uporaba razredov, modulov • Pomanjkljivo znanje
  • 5. Umetna sladila • Prevajalniki • CoffeScript • Google Closure (JSDoc) • Orodja za preverjanje kvalitete • JSLint, JSHint, … • Drugo • Dart „Ultimately to replace JavaScript as the lingua franca of web development on the open web platform“
  • 6. Kaj pa TypeScript? • TypeScript se prevede v JavaScript • JavaScript je TypeScript (superset) • Pripravljen z mislijo na ECMAScript 6 • Deluje na vseh platformah, ki podpirajo JavaScript • Prinaša: • Optional static typing • Clean syntax • Class based Objet Oriented Programing, Interface, Modules… • Is just a syntactic sugar • Header (definition) files for existing JavaScript libs. • Great tools (VS+InteliSense)
  • 7. Kratka zgodovina • Razvija ga Microsoft • Izdan v December 2012 Apache 2 License (trenutno 0.9.1.1) • Izvorna koda na codeplex.com • Anders Hejlsberg • Pascal compiler (DOS and CP/M) • Borland: Turbo Pascal & Delphi • Microsoft: C# „No, you can write large programs in JavaScript. You just can’t maintain them.“
  • 8. Umažimo si roke! • Igrišče (brez vseh namestitev) • http://www.typescriptlang.org/Playground/ • Prenos in namestitev • http://www.typescriptlang.org/#Download • Visual Studio 2012/2013 RC • node.js • npm install –g typescript • tsc helloworld.ts • node helloword.js • tsc hellomodule.ts --module "amd" • lib.d.ts
  • 9. Podatkovni tipi • Osnovni • Boolean • Number • String • Any • Null (nima vrednosti) • Undefined (ni instanciran) • Object • Void • HTMLElement … Podatkovne tipe se preverja le med prevajanjem
  • 10. Class
  • 12. Moduli • Zakaj? • Strukturiranje • „Global scope pollution“ • Poznamo • Interne • Imenski prostor (beri: namespace) • Ne pozabi „//<reference path=‚nekaj.ts'/>“ ni dovolj • Zunanje • AMD • requireJS (uporaba v spletnih brskalnikih) • commonJS • node.js (za strežniško stran in tudi za brskalnik)
  • 15. Triki • Kreiraj „references.ts“, v njem referenciraj vse ts skripte in nato referenciraj le references.ts • NuGet: • Install-Package RequireJS • Install-Package RequireJS.TypeScript.DefinitelyTyped • Web Essentials 3.x brez podpore za TypeScript • http://madskristensen.net/post/Web-Essentials-2013-Where-is-theTypeScript-support.aspx • Izklopi nadležni „The file has been modified outside of the source editor “ • Tools -> Options, Environment -> Documents • „Detect when files changed outside the environment“
  • 16. Time for Coffe? TypeScript CoffeScript • Individual can chose • Sugar is optional • All team „must“ switch • Syntax familiar to Ruby, Phyton, Haskell • Older, mature, very popular C#, Java • Syntax familiar to
  • 19. VPRAŠANJA? HVALA! Še zadnji nasvet: pred resno uporabo preberi: „TypeScript Language Specification.pdf“ http://peterpsi.blogspot.com @papsl
  • 20. I want more • TypeScript Download (or install it via node npm) • http://www.typescriptlang.org/#Download • http://www.typescriptlang.org/tutorial/ • The repository for high quality TypeScript type definition (node, jQuery, knockout, • https://github.com/borisyankov/DefinitelyTyped • Source Code • http://typescript.codeplex.com/ • JavaScript Patterns • WebEssentials 2012 (VS addin)
  • 21. Resources • http://channel9.msdn.com/posts/Anders-Hejlsberg• • • • • Introducing-TypeScript (1.10.2012) :) http://blogs.msdn.com/b/typescript/ http://www.typescriptlang.org/Tutorial/ https://github.com/DefinitelyTyped/typescript-directory * http://en.wikipedia.org/wiki/TypeScript http://en.wikipedia.org/wiki/Anders_Hejlsberg • Nathan Smith, fotografija • http://www.flickr.com/photos/nathansmith/4704268314/sizes/l/in/ph otostream/ • Internet
  • 22. Primeri uporabe • JS game engine: http://typedarray.org/introducing-starling- js/ Demo: http://gamua.com/area-51/ • TypeScript with JSDoc support (for Google Closure) https://github.com/evanw/typescript-closure-compiler