๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

Next.js

[๋‚ด๋ณด๋‚ด๋ฒˆ] Next.js docs - Supported Browsers and Features

๋‚ด๋ณด๋‚ด๋ฒˆ(๋‚ด๊ฐ€ ๋ณด๋ ค๊ณ  ๋‚ด๊ฐ€ ๋ฒˆ์—ญํ•œ...) Next.js docs

2021๋…„ 4์›” 4์ผ ๊ธฐ์ค€ Next.js ๊ณต์‹ ๋ฌธ์„œ๋ฅผ ๋ฒˆ์—ญํ–ˆ๋‹ค.

โ€ป ์˜์–ด ์ „๊ณต์ž๋„ ํ•ด์™ธ ์œ ํ•™ํŒŒ๋„ ์•„๋‹ˆ๊ธฐ์— ๋ฒˆ์—ญ์—๋Š” ์˜์—ญ, ์˜ค์—ญ, ๊ตฌ๊ธ€ ๋ฒˆ์—ญ์ด ๋ฌด์ˆ˜ํžˆ ๋งŽ์„ ์ˆ˜ ์žˆ์œผ๋ฉฐ, ํ˜ผ์ž ๊ณต์‹๋ฌธ์„œ๋ฅผ ์ฐธ์กฐํ•ด๊ฐ€๋ฉฐ ๋ฒˆ์—ญํ•˜๋‹ค ๋ณด๋‹ˆ ์˜คํƒ€๋„ ๋งŽ์„ ์ˆ˜ ์žˆ๋‹ค. ์ •ํ™•ํ•œ ๋‚ด์šฉ์€ ๊ณต์‹๋ฌธ์„œ๋ฅผ ์ง์ ‘ ์‚ดํŽด๋ณด๊ฑฐ๋‚˜ ๋‹ค๋ฅธ ์ •๋ณด๋“ค์„ ๋” ์ฐพ์•„๋ณด๋Š” ๊ฒƒ์„ ์ถ”์ฒœํ•œ๋‹ค.

(ํ•˜์ง€๋งŒ ๋Œ“๊ธ€ ํ”ผ๋“œ๋ฐฑ๋„ ํ™˜์˜ํ•ฉ๋‹ˆ๋‹ค๐Ÿ˜ƒ )

Next.js ๊ณต์‹๋ฌธ์„œ ํ™•์ธํ•˜๊ธฐ>>

 

Basic Features: Supported Browsers and Features | Next.js

Browser support and which JavaScript features are supported by Next.js.

nextjs.org


Next.js supports IE11 and all modern browsers (Edge, Firefox, Chrome, Safari, Opera, et al) with no required configuration.
Next.js๋Š” ์ธํ„ฐ๋„ท ์ต์Šคํ”Œ๋กœ๋Ÿฌ 11๊ณผ ๋ชจ๋“  ๋ชจ๋˜ ๋ธŒ๋ผ์šฐ์ €๋“ค(์—ฃ์ง€, ํŒŒ์ด์–ดํญ์Šค, ํฌ๋กฌ, ์‚ฌํŒŒ๋ฆฌ ๋“ฑ)์„ ์ถ”๊ฐ€ ์„ค์ • ์—†์ด ์ง€์›ํ•œ๋‹ค. 

Polyfills

We transparently inject polyfills required for IE11 compatibility. In addition, we also inject widely used polyfills, including:
IE11 ํ˜ธํ™˜์„ฑ์„ ์œ„ํ•œ ํด๋ฆฌํ•„์„ transparently ์ถ”๊ฐ€ํ•œ๋‹ค. ๊ทธ์— ๋”ํ•ด ์•„๋ž˜์˜ ํ•ญ๋ชฉ๋“ค์„ ํฌํ•จํ•˜๋Š” ๋„๋ฆฌ ์‚ฌ์šฉ๋˜๋Š” ํด๋ฆฌํ•„ ์—ญ์‹œ ์ถ”๊ฐ€ํ•œ๋‹ค. 

  • fetch() — Replacing: whatwg-fetch and unfetch.
    ๋Œ€์ฒด: whatwg-fetch์™€ unfetch
  • URL — Replacing: the url package (Node.js API).
    ๋Œ€์ฒด: url ํŒจํ‚ค์ง€(Node.js API)
  • Object.assign() — Replacing: object-assign, object.assign, and core-js/object/assign.
    ๋Œ€์ฒด: object-assign, object.assign, core-js/object/assign

If any of your dependencies includes these polyfills, they’ll be eliminated automatically from the production build to avoid duplication.
์ง์ ‘ ์ถ”๊ฐ€ํ•œ ์ข…์†์„ฑ ์ค‘์— ์ด ํด๋ฆฌํ•„์„ ํฌํ•จํ•˜๊ณ  ์žˆ๋‹ค๋ฉด, ๊ทธ ์ข…์†์„ฑ๋“ค์€ ์ค‘๋ณต์„ ํ”ผํ•˜๊ธฐ ์œ„ํ•ด์„œ ์šด์˜ ๋นŒ๋“œ ํ™˜๊ฒฝ์—์„œ ์ž๋™์œผ๋กœ ์ œ๊ฑฐ๋  ๊ฒƒ์ด๋‹ค.

In addition, to reduce bundle size, Next.js will only load these polyfills for browsers that require them. The majority of the web traffic globally will not download these polyfills.
๊ทธ๋ฆฌ๊ณ  ๋ฒˆ๋“ค ํฌ๊ธฐ๋ฅผ ์ค„์ด๊ธฐ ์œ„ํ•ด์„œ, Next.js๋Š” ํด๋ฆฌํ•„์ด ํ•„์š”ํ•œ ๋ธŒ๋ผ์šฐ์ €์—๋งŒ ๋กœ๋“œํ•  ๊ฒƒ์ด๋‹ค. ์ „๋ฐ˜์ ์œผ๋กœ ๋Œ€๋ถ€๋ถ„์˜ ์›น ํŠธ๋ž˜ํ”ฝ์€ ์ด๋Ÿฌํ•œ ํด๋ฆฌํ•„๋“ค์„ ๋‹ค์šด๋กœ๋“œํ•˜์ง€ ์•Š๋Š”๋‹ค. 

Server-Side Polyfills

In addition to fetch() on the client side, Next.js polyfills fetch() in the Node.js environment. You can use fetch() on your server code (such as getStaticProps) without using polyfills such as isomorphic-unfetch or node-fetch.
ํด๋ผ์ด์–ธํŠธ ์ธก์—์„œ์˜ fetch() ์™ธ์—๋„, Next.js๋Š” Node.js ํ™˜๊ฒฝ์—์„œ fetch()๋ฅผ ํด๋ฆฌํ•„ํ•œ๋‹ค. isomorphic-unfetch๋‚˜ node-fetch์™€ ๊ฐ™์€ ํด๋ฆฌํ•„์„ ์‚ฌ์šฉํ•˜์ง€ ์•Š๊ณ ๋„ ์„œ๋ฒ„ ์ฝ”๋“œ(getStaticProps์™€ ๊ฐ™์€)์—์„œ fetch()๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. 

Custom Polyfills

If your own code or any external npm dependencies require features not supported by your target browsers, you need to add polyfills yourself.
์ž์ฒด ์ฝ”๋“œ๋‚˜ ๋‹ค๋ฅธ ์™ธ๋ถ€ npm ์ข…์†์„ฑ์—์„œ ๋Œ€์ƒ ๋ธŒ๋ผ์šฐ์ €์—์„œ ์ง€์›ํ•˜์ง€ ์•Š๋Š” ๊ธฐ๋Šฅ์„ ํ•„์š”๋กœ ํ•œ๋‹ค๋ฉด, ์Šค์Šค๋กœ ํด๋ฆฌํ•„์„ ์ถ”๊ฐ€ํ•  ํ•„์š”๊ฐ€ ์žˆ๋‹ค. 

In this case, you should add a top-level import for the specific polyfill you need in your Custom <App> or the individual component.
์ด ๊ฒฝ์šฐ ์ปค์Šคํ…€ <App> ๋˜๋Š” ๊ฐœ๋ณ„ ์ปดํฌ๋„ŒํŠธ์—์„œ ํ•„์š”ํ•œ ํŠน์ • ํด๋ฆฌํ•„์„ ์œ„ํ•ด ์ตœ์ƒ์œ„ ๊ฐ€์ ธ์˜ค๊ธฐ๋กœ ์ถ”๊ฐ€ํ•ด์•ผํ•œ๋‹ค.

JavaScript Language Features

Next.js allows you to use the latest JavaScript features out of the box. In addition to ES6 features, Next.js also supports:
Next.js๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ์ตœ์‹  JavaScript ๊ธฐ๋Šฅ์„ ์ฆ‰์‹œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. ES6 ๊ธฐ๋Šฅ๋“ค ์™ธ์—๋„, Next.js๋Š” ์•„๋ž˜์˜ ๊ธฐ๋Šฅ๋“ค๋„ ์ง€์›ํ•œ๋‹ค:

TypeScript Features

Next.js has built-in TypeScript support. Learn more here.
Next.js๋Š” ๊ธฐ๋ณธ์ ์œผ๋กœ TypeScript๋ฅผ ์ง€์›ํ•œ๋‹ค. 

Customizing Babel Config (Advanced)

You can customize babel configuration. Learn more here.
babel ๊ตฌ์„ฑ์„ ์‚ฌ์šฉ์ž๊ฐ€ ๊ตฌ์„ฑํ•  ์ˆ˜ ์žˆ๋‹ค.