Code Monkey home page Code Monkey logo

portfolio's Introduction

nextjs

This is a Next.js project bootstrapped with create-next-app.

Getting Started

First, run the development server:

npm run dev
# or
yarn dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying pages/index.js. The page auto-updates as you edit the file.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.

memo

styled-components vs emotion

  • styled-components と emotion で出来ることは大体同じ
  • パフォーマンスの観点では styled-components < emotion
  • SSR考慮の観点では styled-components < emotion
  • ドキュメント量の観点では styled-components > emotion
  • emotion は source map をサポートしている。styled-components は未だ(20-06-28) source map に未対応
  • emotion/core では jsx pragma コメントが必要。
  • css prop 記法ではなく styled component 記法であれば emotion/styled のみを使用すれば良い
  • emotion/styled では jsx pragma コメントは必要ない

reference:

emotion enable sourcemap

yarn add --dev babel-plugin-emotion
{
    "presets": ["next/babel"],
    "plugins": ["emotion"]
}

reference:

setup material-ui

reference:

type

next type check system

nextjs は ts-loader 等は使用されず、@babel/preset-typescript を使用して ts → js へトランスパイルしている。型チェックには fork-ts-checker-webpack-plugin が以前使用されていたが、build 速度の改善から現在は Typescript API を直接使用して型チェックが行われている。なお型チェックは build 時のみに行われる。

@babel/preset-typescript の挙動にはいくつか気をつけるべき点がある。 またこれは、transpileModule API(--isolatedModules も同様)を使用した際も同様である。

  • const enum は使用できない。
  • Re-exports では export される内容が型情報なのか実装なのか babel or transpileModule API は知る由もない為、その export される変数がトランスパイル後保持されてしまう。結果 re-export する変数が型情報だった場合に、export 元の型情報は削除されている為、参照エラーになる。
  • export 元の処理で実装に関わる処理が行われていても export した先で型情報だけが使用された場合に、export 元のファイルは型のみを扱うものとして認知され削除されてしまう。結果、export 元での実装に関わる処理も実行されない。

reference:

portfolio's People

Contributors

yuki153 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.