-
Notifications
You must be signed in to change notification settings - Fork 54
Create a new react app #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 19 commits
90fa549
984abd2
a531a0f
b3d1503
d8a8309
573da86
7e4ac52
48b5ea0
4438c53
1ce47dd
2577d15
5aa1a31
1e2eee0
abfd9c2
c8f6bd2
9c18500
ff3e846
612f619
b034903
12cde9a
e13935a
9278f6c
324cf1c
643733b
057d0b8
463ce0c
4a7df56
81e1b2e
994583b
abf2c97
1a625b7
d432954
927a44a
7ed776e
e7a2865
737d007
d615c5b
36a11e0
e827878
b43e2d7
fa43b93
e6dfa6b
fd7c876
7338ad5
deb3f22
0929d8b
dea253b
20e2783
9a98c21
a052287
f69ddf0
ebfb314
f0abb92
8f86292
f27e884
e9e155d
9f900b8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -1,94 +1,94 @@ | ||||||||||
--- | ||||||||||
id: create-a-new-react-app | ||||||||||
title: Create a New React App | ||||||||||
title: Stwórz nową aplikację w Reakcie | ||||||||||
permalink: docs/create-a-new-react-app.html | ||||||||||
redirect_from: | ||||||||||
- "docs/add-react-to-a-new-app.html" | ||||||||||
prev: add-react-to-a-website.html | ||||||||||
next: cdn-links.html | ||||||||||
--- | ||||||||||
|
||||||||||
Use an integrated toolchain for the best user and developer experience. | ||||||||||
Najwygodniej będzie ci się pracowało jeśli zastosujesz zintegrowany zestaw narzędzi (ang. toolchain). Użycie go pozwoli ci też zapewnić dobre doświadczenie użytkownikom twojej aplikacji. | ||||||||||
|
||||||||||
This page describes a few popular React toolchains which help with tasks like: | ||||||||||
Poniżej przedstawiamy kilka popularnych zestawów narzędziowych używanych w Reakcie. Pomagają one w zadaniach typu: | ||||||||||
|
||||||||||
* Scaling to many files and components. | ||||||||||
* Using third-party libraries from npm. | ||||||||||
* Detecting common mistakes early. | ||||||||||
* Live-editing CSS and JS in development. | ||||||||||
* Optimizing the output for production. | ||||||||||
* Zwiększanie skali projektu do wielu plików i komponentów. | ||||||||||
marcinostrouch marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
* Stosowanie dodatkowych bibliotek dostępnych w npm. | ||||||||||
* Wczesne wykrywanie często popełnianych błędów. | ||||||||||
* Ciągła, automatyczna edycja CSS i JS w trakcie tworzenia aplikacji. | ||||||||||
marcinostrouch marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
* Optymalizacja kodu przed oddaniem aplikacji do użytku. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wdrażać na czy wdrażać do? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doczytałem trochę i wychodzi na to, że masz rację z tym "do" :-) Na stronie IBM piszą o "wdrożeniu kodu w środowisku produkcyjnym" i o "przemieszczaniu do środowiska produkcyjnego". |
||||||||||
|
||||||||||
The toolchains recommended on this page **don't require configuration to get started**. | ||||||||||
Zestawy narzędziowe, które tutaj podajemy umożliwiają szybkie rozpoczęcie pracy and aplikacją i **nie wymagają żadnej wstępnej konfiguracji** | ||||||||||
marcinostrouch marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
|
||||||||||
## You Might Not Need a Toolchain {#you-might-not-need-a-toolchain} | ||||||||||
## Stosowanie zestawu narzędziowego nie jest konieczne {#you-might-not-need-a-toolchain} | ||||||||||
|
||||||||||
If you don't experience the problems described above or don't feel comfortable using JavaScript tools yet, consider [adding React as a plain `<script>` tag on an HTML page](/docs/add-react-to-a-website.html), optionally [with JSX](/docs/add-react-to-a-website.html#optional-try-react-with-jsx). | ||||||||||
Jeśli powyższe zadania nie przysparzają ci żadnych problemów lub jeśli nie wiesz jeszcze jak stosować narzędzia JavaScript, możesz [dodać React jako zwykły znacznik `<script>` do strony HTML](/docs/add-react-to-a-website.html), ewentualnie [z użyciem JSX](/docs/add-react-to-a-website.html#optional-try-react-with-jsx). | ||||||||||
marcinostrouch marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
|
||||||||||
This is also **the easiest way to integrate React into an existing website.** You can always add a larger toolchain if you find it helpful! | ||||||||||
Jest to **najprostszy sposób zintegrowania Reacta z istniejącą już stroną internetową**. Zestaw narzędziowy możesz zawsze dodać do swojej aplikacji jeśli zajdzie taka potrzeba. | ||||||||||
marcinostrouch marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
|
||||||||||
## Recommended Toolchains {#recommended-toolchains} | ||||||||||
## Zalecane zestawy narzędziowe {#recommended-toolchains} | ||||||||||
|
||||||||||
The React team primarily recommends these solutions: | ||||||||||
Zespół Reacta rekomenduje następujące rozwiązania: | ||||||||||
|
||||||||||
- Jeśli **uczysz się Reacta** lub jeśli **tworzysz nową aplikację [jednostronicową](/docs/glossary.html#single-page-application),** skorzystaj z [Create React App](#create-react-app). | ||||||||||
marcinostrouch marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
- Jeśli tworzysz **stronę internetową renderowaną na serwerze z użyciem Node.js,** spróbuj zastosować [Next.js](#nextjs). | ||||||||||
- Jeśli tworzysz **stronę statyczną, która ma głównie wyświetlać określone treści,** spróbuj zastosować [Gatsby](#gatsby). | ||||||||||
- Jeśli tworzysz **bibliotekę kompnentów** lub **integrujesz z istniejącą bazą kodu,** spróbuj zastosować [bardziej elastyczne zestwy narzędziowe](#more-flexible-toolchains). | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Zauważyłem, że najczęściej popełniasz literówki w słowie "komponent" :-) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Może:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, faktycznie. Napisanie do czytelnika, że "integruje się z czymś" pasuje jedynie do "integrowania się z grupą" lub (w filmach sci-fi) integruje się z jakimś większym systemem, matrixem :-) |
||||||||||
|
||||||||||
- If you're **learning React** or **creating a new [single-page](/docs/glossary.html#single-page-application) app,** use [Create React App](#create-react-app). | ||||||||||
- If you're building a **server-rendered website with Node.js,** try [Next.js](#nextjs). | ||||||||||
- If you're building a **static content-oriented website,** try [Gatsby](#gatsby). | ||||||||||
- If you're building a **component library** or **integrating with an existing codebase**, try [More Flexible Toolchains](#more-flexible-toolchains). | ||||||||||
|
||||||||||
### Create React App {#create-react-app} | ||||||||||
|
||||||||||
[Create React App](http://github.com/facebookincubator/create-react-app) is a comfortable environment for **learning React**, and is the best way to start building **a new [single-page](/docs/glossary.html#single-page-application) application** in React. | ||||||||||
[Create React App](http://github.com/facebookincubator/create-react-app) zapewnia bardzo dogodne środowisko pracy sprzyjające **nauce Reacta**. Jest to najlepszy sposób, aby zacząć tworzyć **nową [jednostronicową](/docs/glossary.html#single-page-application) aplikację** w Reakcie. | ||||||||||
marcinostrouch marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
|
||||||||||
It sets up your development environment so that you can use the latest JavaScript features, provides a nice developer experience, and optimizes your app for production. You’ll need to have Node >= 6 and npm >= 5.2 on your machine. To create a project, run: | ||||||||||
Środowisko pracy stworzone przez Create React App nie tylko umożliwi ci stosowanie najnowszych funkcjonalności JavaScript, lecz także zoptymalizuje twój kod przed oddaniem go do użytku i ogólnie znacznie usprawni twoją pracę. Aby móc skorzystać z tego rozwiązania na swoim komputerze, będziesz potrzebował Node >=6 oraz npm >=5.2. W celu stworzenia projektu zastosuj następujące komendy: | ||||||||||
marcinostrouch marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
|
||||||||||
```bash | ||||||||||
npx create-react-app my-app | ||||||||||
marcinostrouch marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
cd my-app | ||||||||||
marcinostrouch marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
npm start | ||||||||||
``` | ||||||||||
|
||||||||||
>Note | ||||||||||
> | ||||||||||
>`npx` on the first line is not a typo -- it's a [package runner tool that comes with npm 5.2+](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b). | ||||||||||
>Wskazówka | ||||||||||
> `npx` w pierwszej linijce powyżej to nie błąd w druku, to [narzędzie uruchamiające pakiety zawarte w npm 5.2+](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b). | ||||||||||
marcinostrouch marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
|
||||||||||
Create React App doesn't handle backend logic or databases; it just creates a frontend build pipeline, so you can use it with any backend you want. Under the hood, it uses [Babel](http://babeljs.io/) and [webpack](https://webpack.js.org/), but you don't need to know anything about them. | ||||||||||
Create React App nie obsługuje ani logiki backendu ani baz danych; tworzy jedynie front-endowy potok budowania (ang. *build pipeline*). Dzięki temu możesz go używać z dowolnie wybranym przez siebie backendem. Create React App zawiera [Babel](http://babeljs.io/) i [webpack](https://webpack.js.org/), ale nie musisz nic o nich wiedzieć, aby z powodzeniem używać tego zestawu narzędzi. | ||||||||||
marcinostrouch marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
|
||||||||||
When you're ready to deploy to production, running `npm run build` will create an optimized build of your app in the `build` folder. You can learn more about Create React App [from its README](https://github.com/facebookincubator/create-react-app#create-react-app-) and the [User Guide](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#table-of-contents). | ||||||||||
Kiedy uznasz, że twoja aplikacja jest gotowa do oddania do użytku, zastosuj komendę `npm run build`. Dzięki temu uzyskasz zoptymalizowaną wersję swojej aplikacji. Znajdziesz ją w folderze `build`. Więcej informacji na temat Create React App znajdziesz w [pliku README](https://github.com/facebookincubator/create-react-app#create-react-app-) oraz w tym [Przewodniku użytkownika](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#table-of-contents). | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. jw. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "do". |
||||||||||
|
||||||||||
### Next.js {#nextjs} | ||||||||||
|
||||||||||
[Next.js](https://nextjs.org/) is a popular and lightweight framework for **static and server‑rendered applications** built with React. It includes **styling and routing solutions** out of the box, and assumes that you're using [Node.js](https://nodejs.org/) as the server environment. | ||||||||||
[Next.js](https://nextjs.org/) jest popularnym, lekkim frameworkiem służącym do budowy aplikacji reactowych **statycznych oraz renderowanych po stronie serwera**. Zestaw ten zawiera **rozwiązania stylizujące i mechanizmy routingu**. Ponadto, Next.js domyślnie zakłada, że stosujesz [Node.js](https://nodejs.org/) jako środowisko serwera. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Z jakiegoś powodu liczba mnoga w "tworzeniu styli" nie gra mi. Może: Zestaw ten zawiera rozwiązania ułatwiające dodawanie stylu i mechanizmy routingu? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, tak też jest dobrze, a przy okazji unikamy tego "zgrzytu". |
||||||||||
|
||||||||||
Learn Next.js from [its official guide](https://nextjs.org/learn/). | ||||||||||
Zapoznaj się z zestawem narzędziowym Next.js poprzez [oficjalny przewodnik](https://nextjs.org/learn/). | ||||||||||
|
||||||||||
### Gatsby {#gatsby} | ||||||||||
|
||||||||||
[Gatsby](https://www.gatsbyjs.org/) is the best way to create **static websites** with React. It lets you use React components, but outputs pre-rendered HTML and CSS to guarantee the fastest load time. | ||||||||||
[Gatsby](https://www.gatsbyjs.org/) zapewnia najlepszy sposób tworzenia **stron statycznych** z Reactem. Ten zestaw narzędziowy umożliwia korzystanie z komponentów reactowych, ale w wyniku jego zastosowania otrzymujemy wstępne renderowanie HTML i CSS co zapewnia najszczybsze możliwe ładowanie strony. | ||||||||||
marcinostrouch marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
|
||||||||||
Learn Gatsby from [its official guide](https://www.gatsbyjs.org/docs/) and a [gallery of starter kits](https://www.gatsbyjs.org/docs/gatsby-starters/). | ||||||||||
Zapoznaj się z Gatsbym poprzez [oficjalny przewodnik](https://www.gatsbyjs.org/docs/) oraz [galerię zestawów startowych](https://www.gatsbyjs.org/docs/gatsby-starters/). | ||||||||||
|
||||||||||
### More Flexible Toolchains {#more-flexible-toolchains} | ||||||||||
### Bardziej elastyczne zestawy narzędziowe {#more-flexible-toolchains} | ||||||||||
|
||||||||||
The following toolchains offer more flexiblity and choice. We recommend them to more experienced users: | ||||||||||
Podane niżej zestawy narzędziowe są stosunkowo bardziej elastyczne i dają większą dowolność konfiguracji. Polecamy je bardziej doświadczonym użytkownikom. | ||||||||||
|
||||||||||
- **[Neutrino](https://neutrinojs.org/)** combines the power of [webpack](https://webpack.js.org/) with the simplicity of presets, and includes a preset for [React apps](https://neutrinojs.org/packages/react/) and [React components](https://neutrinojs.org/packages/react-components/). | ||||||||||
- **[Neutrino](https://neutrinojs.org/)** łączy w sobie siłę [webpacku](https://webpack.js.org/) z prostotą ustawień domyślnych. Zestaw ten zawiera ustawienia domyślne dla [aplikacji reactowych](https://neutrinojs.org/packages/react/) i [komponentów reactowych](https://neutrinojs.org/packages/react-components/). | ||||||||||
marcinostrouch marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
|
||||||||||
- **[nwb](https://github.com/insin/nwb)** is particularly great for [publishing React components for npm](https://github.com/insin/nwb/blob/master/docs/guides/ReactComponents.md#developing-react-components-and-libraries-with-nwb). It [can be used](https://github.com/insin/nwb/blob/master/docs/guides/ReactApps.md#developing-react-apps-with-nwb) for creating React apps, too. | ||||||||||
- **[nwb](https://github.com/insin/nwb)** jest zalecany szczególnie dla potrzeb [publikowania komponentów reactowych na npm](https://github.com/insin/nwb/blob/master/docs/guides/ReactComponents.md#developing-react-components-and-libraries-with-nwb). Może też [być stosowany](https://github.com/insin/nwb/blob/master/docs/guides/ReactApps.md#developing-react-apps-with-nwb) do tworzenia aplikacji w Reakcie. | ||||||||||
marcinostrouch marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
|
||||||||||
- **[Parcel](https://parceljs.org/)** is a fast, zero configuration web application bundler that [works with React](https://parceljs.org/recipes.html#react). | ||||||||||
- **[Parcel](https://parceljs.org/)** jest szybkim bundlerem aplikacji webowych, niewymagającym żadnego konfigurowania dla potrzeb [aplikacji reactowych](https://parceljs.org/recipes.html#react). | ||||||||||
marcinostrouch marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
|
||||||||||
- **[Razzle](https://github.com/jaredpalmer/razzle)** is a server-rendering framework that doesn't require any configuration, but offers more flexibility than Next.js. | ||||||||||
- **[Razzle](https://github.com/jaredpalmer/razzle)** jest frameworkiem umożliwiającym renderowanie po stronie serwera niewymagającym konfigurowania, ale dającym większy wybór niż Next.js. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
||||||||||
## Creating a Toolchain from Scratch {#creating-a-toolchain-from-scratch} | ||||||||||
## Tworzenie zestawu narzędziowego od podstaw {#creating-a-toolchain-from-scratch} | ||||||||||
|
||||||||||
A JavaScript build toolchain typically consists of: | ||||||||||
W skład zestaw narzędziowy w JavaScripcie wchodzą zazwyczaj następujące elementy: | ||||||||||
marcinostrouch marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
|
||||||||||
* A **package manager**, such as [Yarn](https://yarnpkg.com/) or [npm](https://www.npmjs.com/). It lets you take advantage of a vast ecosystem of third-party packages, and easily install or update them. | ||||||||||
* **Menadżer pakietów** np. [Yarn](https://yarnpkg.com/) lub [npm](https://www.npmjs.com/). Umożliwia on korzystanie z ogromnego ekosystemu dodatkowych pakietów. Pozwala łatwo je instalować i aktualizować. | ||||||||||
|
||||||||||
* A **bundler**, such as [webpack](https://webpack.js.org/) or [Parcel](https://parceljs.org/). It lets you write modular code and bundle it together into small packages to optimize load time. | ||||||||||
* **Bundler** np. [webpack](https://webpack.js.org/) lub [Parcel](https://parceljs.org/). Umożliwia on pisanie kodu modularnego i pakowania go w małe pakiety, aby zoptymalizować czas ładowania. | ||||||||||
|
||||||||||
* A **compiler** such as [Babel](http://babeljs.io/). It lets you write modern JavaScript code that still works in older browsers. | ||||||||||
* **Kompilator** np. [Babel](http://babeljs.io/). Pozwala on na stosowanie nowych wersji JavaScriptu przy zachowaniu kompatybilności ze starszymi przeglądarkami. | ||||||||||
|
||||||||||
If you prefer to set up your own JavaScript toolchain from scratch, [check out this guide](https://blog.usejournal.com/creating-a-react-app-from-scratch-f3c693b84658) that re-creates some of the Create React App functionality. | ||||||||||
Jeśli chcesz stworzyć swój własny zestaw narzędziowy od podstaw, zajrzyj do [tego przewodnika](https://blog.usejournal.com/creating-a-react-app-from-scratch-f3c693b84658). Dowiesz się z niego jak odtworzyć niektóre z funkcjonalności Create React App. | ||||||||||
marcinostrouch marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
|
||||||||||
Don't forget to ensure your custom toolchain [is correctly set up for production](/docs/optimizing-performance.html#use-the-production-build). | ||||||||||
Pamiętaj aby upewnić się, że twój własny zestaw narzędziowy [tworzy właściwą użytkową wersję aplikacji](/docs/optimizing-performance.html#use-the-production-build). | ||||||||||
marcinostrouch marked this conversation as resolved.
Show resolved
Hide resolved
|
Uh oh!
There was an error while loading. Please reload this page.