티스토리 뷰
frontend and javascript
why not javascript, why typescript
- javascript is old but more(발전 중인 javascript)
- typescript is SUPERSET of javascript
- javascript의 최전방
- typescript 타입에 의한 linting 지원
- 컴파일 타입 검사
- 타입 추론에 의한 정적 타입 검사
- type에 의한 code guard
- enterprise 개발
- but! not 'why not javascript', 'it's javascript!'
PAHSER arounding
- phaser official support typescript
- phaser typescript staterpack
- phaser typescript webpack collaboration
- 지속 가능한 빌드 감시
- 임시 배포
- 결과물 지속 반영
- 개발 웹서버 지원
- Chrome debugger
- from-lang to target-lang map file 지원
- typescript to javascript ecma5(ie 11이상)
- javascript ecma6 to javascript ecma3(ie 10이하)
- typescript to javascript ecma6(최신 브라우저들)
- 지원 기술 검색 Can I USE
- command-line friendly
- from-lang to target-lang map file 지원
Tips
javascript
- 매우 빠르게 변화 중임
- unlimited free
- CAN runtime member add
- CAN runtime change val type
- CAN closure
- all is function, not native type
- function is first class 'object' or 'function'
- so class is function
- so object is function
- but it is not free
- so use ecma6 and babel
- async/await
- size is performance
- script parsing time
- engine runtime
- super many modules
- be friend MDN
typescript
- good webstorm or intellij
- but use visual studio code
- use tslint
- use typescript@lastest
javascript and typescript code
- using recommand include type - babel
- ecma6 이후 표준으로 명기 되어 있고 앞으로 브라우저들이 지원할 예정
- babel transpiler 사용하면 현재도 사용가능
import $ from 'jquery';
import _ from 'lodash';
import * as momnet from 'monent';
- can use 'any type' but use 'define type'
function add(a, b);
function add(a: number, b: number); // use this
- map do not use '[]', use 'get'
let map = new Map<string, number>();
map.set('magic', 23445);
let badVal = map['magic']; // not runtime error, bun not work
let goodVal = map.get('magic'); // good 23445
- import와 export
// from X.ts
export class X { }
// target.ts
import { X } from 'X.ts';
// or
import * as Util from 'X.ts';
// from Y.ts
export default class Y { }
// target.ts
import Y from 'Y.ts';
node/npm
- node version select careful(work select LTS, hobbit select Lastest)
- otherwise use nvm(nvm-windows or nvm)
- version select - a.b.c
- use a.b
phaser
- Sound Load 문제 - ie11 문제
- 순차 로딩을 해야함 로딩이 완료 되고 다음 로딩을 해야함
game.load.audio('n', ['audio/a.mp3', 'audio/a.ogg']);
game.load.onLoadComplete.add(soundloadFunction, this); // 끝나고 다시 로딩 호출 - 코드상으로 재귀 스택오버플로우 주의
game.load.start();
etc
- use webpack!
- use CLI
- example
- 신중히 기술 스택을 정하세요.
- 계속 갱신하시고
- fe의 즐거움 호환성 'IE'
'프로그래밍 > Web Frontend' 카테고리의 다른 글
[Javascript] async/await 딜레이용 (0) | 2018.04.30 |
---|---|
TS/JS - Object.keys를 사용한 리펙토링 (0) | 2018.04.20 |
[Cocos Creator] Cursor 교체 방법 (0) | 2018.04.18 |
작성중-Phaser vs Cocos Creator (0) | 2018.04.18 |
WebGL 지원 조사 (0) | 2018.04.18 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- await
- 주식투자주식채권포트폴리오레이달리오사계절포트폴리오
- 환율스프레드거래#원달러
- javascript object finding
- setTimeout
- delaycall
- 국내상장미국지수ETF투자계획
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
글 보관함