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

Front-End Developer Going Beyond by Oka Uliandana

Front-End Developer Going Beyond by Oka Uliandana

Berkarir sebagai Front-End Developer? wah kamu berada di presentasi yang tepat. Dalam presentasi ini mas oka berbagi pengalaman nya mengenai karir front-end hingga code basic yang biasa digunakan seorang FE pada umumnya.

Presentasi ini digunakan ketika acara Webinar SurabayaDev with CODEX powered by Telkom Indonesia pada : 23 Juli 2020

Terima kasih Mas Oka.

with Love
SurabayaDev

Surabaya Developer

July 23, 2020

Transcript

39 slides
  1. 2015 2016 2018 2020 Graduate Bhinneka Telkom Who is Presenting

    - Web developer - Backend developer - Frontend developer - Frontend developer Oka Uliandana Work experience
  2. What’s on the slides? ✨ Front End Developers What is?

    How to be? ✨ Going Beyond • Best practices • Better codes • Optimization (Reduce up to 81% app size*)
  3. What is Front End developer World Wide Web Javascript Browser

    war PHP & jQuery Single Page Applications Now
  4. true/false function isNegative(number) { return number < 0 ? true

    : false; } function isNegative(number) { return number < 0; } ✨✨
  5. Implicit return const a = data.map(i => { return {

    name: i.nama, description: i. deskripsi, }; }); ✨✨ const a = data.map(i => ({ name: i.nama, description: i. deskripsi, }));
  6. Short-circuit evaluation if (data) { console.log(data); } else { console.log(‘No

    data’); } ✨✨ console.log(data || ‘No data’); return data && <Table data={data} />;
  7. Self-Invoking Functions <div> {isLoading ? <Loading /> : (!data ?

    <NoData /> : <Content />) } </div> ✨✨ <div> {(() => { if (isLoading) return <Loading />; if (!data) return <NoData />; return <Content /> })()} </div> (() => {...})()
  8. Return early function BillingCard({ data }) { ... return data

    ? ( <div>...</div> ) : null; } ✨✨ function BillingCard({ data }) { if (!data) return null; ... return ( <div>...</div> ); }
  9. Dangling comma const a = [1, 2, 3]; const b

    = { x: 1, y: 1, }; , , const b = { x: 1, y: 1 }; const b = { x: 1, y: 1, z: 1 };
  10. object[property] let color = ‘grey’; if (status === ‘success’) {

    color = ‘green’; } else if (status === ‘failed’) { color = ‘red’; } return <BillingCard color={color} />; ✨✨ const c = { success: ‘green’, failed: ‘red’, }; const color = c[status] || ‘grey’; return <BillingCard color={color} />;
  11. Max lines: 300 ✅ Focused ✅ Less complex ✅ Easier

    to maintain ❌ Collaboration conflict
  12. flex & grid <div> <h2>Unlimited…</h2> <p>Get unlimited…</p> <img /> <button>Browse

    package</button> </div> FLEX GRID <div> <h2>Unlimited…</h2> <p>Get unlimited…</p> <img /> <button>Browse package</button> </div> <div> <div> <h2>Unlimited…</h2> <p>Get unlimited…</p> <img /> </div> <button>Browse package</button> </div> <div> <div> <div> <h2>Unlimited…</h2> <p>Get unlimited…</p> </div> <img /> </div> <button>Browse package</button> </div>
  13. <div class=”header”> <div class=”nav”> <a class=”link home”>Home</a> <a class=”link”>About Us</a>

    </div> <img class=”logo” /> </div> Selectors ✨✨ <div class=”header”> <div> <a>Home</a> <a>About Us</a> </div> <img /> </div> .header > div .header > div > a .header > div > a:first-child .header > img
  14. Semantics <div class=”header”> <div> <a>Home</a> <a>About Us</a> </div> <img />

    </div> ✨✨ <header> <nav> <a>Home</a> <a>About Us</a> </nav> <img /> </header>
  15. Variables (Custom Properties) div { --spacing: 32px; } :root {

    --error-red: #ee3124; } Declare p { color: var(--error-red); margin: var(--spacing) 0; } Use
  16. rem :root { font-size: 16px; } p { font-size: 1rem;

    /* 16px */ margin: 1.5rem; /* 24px */ } :root { font-size: 20px; } p { font-size: 1rem; /* 20px */ margin: 1.5rem; /* 30px */ }
  17. Modular CSS import styles from ’./styles.css’; function BillingCard({ data })

    { return ( <div className={styles.card}> ... </div>; } Code <div class=”_3A8xZR8Xskjatt_YiPGArz”> ... </div> Result <div class=”BillingCard__card”> ... </div> css-loader

More Decks by Surabaya Developer

Other Decks in Technology