Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# react.dev
# mk.react.dev

This repo contains the source code and documentation powering [react.dev](https://react.dev/).
This repo contains the source code and documentation powering [mk.react.dev](https://mk.react.dev/).

## Getting started

Expand All @@ -10,11 +10,11 @@ This repo contains the source code and documentation powering [react.dev](https:
1. Node: any version starting with v16.8.0 or greater
1. Yarn: See [Yarn website for installation instructions](https://yarnpkg.com/lang/en/docs/install/)
1. A fork of the repo (for any contributions)
1. A clone of the [react.dev repo](https://github.com/reactjs/react.dev) on your local machine
1. A clone of the [mk.react.dev repo](https://github.com/reactjs/mk.react.dev) on your local machine

### Installation

1. `cd react.dev` to go into the project root
1. `cd mk.react.dev` to go into the project root
3. `yarn` to install the website's npm dependencies

### Running locally
Expand All @@ -26,11 +26,11 @@ This repo contains the source code and documentation powering [react.dev](https:

### Guidelines

The documentation is divided into several sections with a different tone and purpose. If you plan to write more than a few sentences, you might find it helpful to get familiar with the [contributing guidelines](https://github.com/reactjs/react.dev/blob/main/CONTRIBUTING.md#guidelines-for-text) for the appropriate sections.
The documentation is divided into several sections with a different tone and purpose. If you plan to write more than a few sentences, you might find it helpful to get familiar with the [contributing guidelines](https://github.com/reactjs/mk.react.dev/blob/main/CONTRIBUTING.md#guidelines-for-text) for the appropriate sections.

### Create a branch

1. `git checkout main` from any folder in your local `react.dev` repository
1. `git checkout main` from any folder in your local `mk.react.dev` repository
1. `git pull origin main` to ensure you have the latest main code
1. `git checkout -b the-name-of-my-branch` (replacing `the-name-of-my-branch` with a suitable name) to create a branch

Expand All @@ -51,13 +51,13 @@ The documentation is divided into several sections with a different tone and pur

1. `git add -A && git commit -m "My message"` (replacing `My message` with a commit message, such as `Fix header logo on Android`) to stage and commit your changes
1. `git push my-fork-name the-name-of-my-branch`
1. Go to the [react.dev repo](https://github.com/reactjs/react.dev) and you should see recently pushed branches.
1. Go to the [mk.react.dev repo](https://github.com/reactjs/mk.react.dev) and you should see recently pushed branches.
1. Follow GitHub's instructions.
1. If possible, include screenshots of visual changes. A preview build is triggered after your changes are pushed to GitHub.

## Translation

If you are interested in translating `react.dev`, please see the current translation efforts [here](https://github.com/reactjs/react.dev/issues/4135).
If you are interested in translating `mk.react.dev`, please see the current translation efforts [here](https://github.com/reactjs/mk.react.dev/issues/4135).

## License
Content submitted to [react.dev](https://react.dev/) is CC-BY-4.0 licensed, as found in the [LICENSE-DOCS.md](https://github.com/reactjs/react.dev/blob/main/LICENSE-DOCS.md) file.
Content submitted to [mk.react.dev](https://mk.react.dev/) is CC-BY-4.0 licensed, as found in the [LICENSE-DOCS.md](https://github.com/reactjs/mk.react.dev/blob/main/LICENSE-DOCS.md) file.
23 changes: 5 additions & 18 deletions eslint-local-rules/__tests__/lint-markdown-code-blocks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@ const path = require('path');
const {ESLint} = require('eslint');
const plugin = require('..');

const FIXTURES_DIR = path.join(
__dirname,
'fixtures',
'src',
'content'
);
const FIXTURES_DIR = path.join(__dirname, 'fixtures', 'src', 'content');
const PARSER_PATH = path.join(__dirname, '..', 'parser.js');

function createESLint({fix = false} = {}) {
Expand Down Expand Up @@ -53,11 +48,7 @@ async function lintFixture(name, {fix = false} = {}) {

async function run() {
const basicResult = await lintFixture('basic-error.md');
assert.strictEqual(
basicResult.messages.length,
1,
'expected one diagnostic'
);
assert.strictEqual(basicResult.messages.length, 1, 'expected one diagnostic');
assert(
basicResult.messages[0].message.includes('Calling setState during render'),
'expected message to mention setState during render'
Expand Down Expand Up @@ -91,9 +82,7 @@ async function run() {
fix: true,
});
assert(
duplicateFixed.output.includes(
"{expectedErrors: {'react-compiler': [4]}}"
),
duplicateFixed.output.includes("{expectedErrors: {'react-compiler': [4]}}"),
'expected duplicates to be rewritten to a single canonical block'
);
assert(
Expand All @@ -118,14 +107,12 @@ async function run() {
fix: true,
});
assert(
malformedFixed.output.includes(
"{expectedErrors: {'react-compiler': [4]}}"
),
malformedFixed.output.includes("{expectedErrors: {'react-compiler': [4]}}"),
'expected malformed metadata to be replaced with canonical form'
);
}

run().catch(error => {
run().catch((error) => {
console.error(error);
process.exitCode = 1;
});
12 changes: 9 additions & 3 deletions eslint-local-rules/rules/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,19 @@ function parseExpectedErrorsEntries(rawEntries) {

if (parsed && typeof parsed === 'object') {
for (const [key, value] of Object.entries(parsed)) {
entries[key] = normalizeEntryValues(Array.isArray(value) ? value.flat() : value);
entries[key] = normalizeEntryValues(
Array.isArray(value) ? value.flat() : value
);
}
}

return entries;
}

function parseExpectedErrorsToken(tokenText) {
const match = tokenText.match(/^\{\s*expectedErrors\s*:\s*(\{[\s\S]*\})\s*\}$/);
const match = tokenText.match(
/^\{\s*expectedErrors\s*:\s*(\{[\s\S]*\})\s*\}$/
);
if (!match) {
return null;
}
Expand Down Expand Up @@ -203,7 +207,9 @@ function cloneMetadata(metadata) {
}

function findExpectedErrorsToken(metadata) {
return metadata.tokens.find((token) => token.type === 'expectedErrors') || null;
return (
metadata.tokens.find((token) => token.type === 'expectedErrors') || null
);
}

function getCompilerExpectedLines(metadata) {
Expand Down
14 changes: 8 additions & 6 deletions eslint-local-rules/rules/react-compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,19 @@ function runReactCompiler(code, filename) {
continue;
}

const loc = typeof detail.primaryLocation === 'function'
? detail.primaryLocation()
: null;
const loc =
typeof detail.primaryLocation === 'function'
? detail.primaryLocation()
: null;

if (loc == null || typeof loc === 'symbol') {
continue;
}

const message = typeof detail.printErrorMessage === 'function'
? detail.printErrorMessage(result.sourceCode, {eslint: true})
: detail.description || 'Unknown React Compiler error';
const message =
typeof detail.printErrorMessage === 'function'
? detail.printErrorMessage(result.sourceCode, {eslint: true})
: detail.description || 'Unknown React Compiler error';

diagnostics.push({detail, loc, message});
}
Expand Down
30 changes: 15 additions & 15 deletions src/components/Layout/HomeContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,48 +143,48 @@ export function HomeContent() {
React
</h1>
<p className="text-4xl font-display max-w-lg md:max-w-full py-1 text-center text-secondary dark:text-primary-dark leading-snug self-center">
The library for web and native user interfaces
Библиотеката за веб и домашни кориснички интерфејси
</p>
<div className="mt-5 self-center flex gap-2 w-full sm:w-auto flex-col sm:flex-row">
<ButtonLink
href={'/learn'}
type="primary"
size="lg"
className="w-full sm:w-auto justify-center"
label="Learn React">
Learn React
label="Научете React">
Научете React
</ButtonLink>
<ButtonLink
href={'/reference/react'}
type="secondary"
size="lg"
className="w-full sm:w-auto justify-center"
label="API Reference">
API Reference
label="API Референца">
API Референца
</ButtonLink>
</div>
</div>

<Section background="left-card">
<Center>
<Header>Create user interfaces from components</Header>
<Header>Креирајте кориснички интерфејси од компоненти</Header>
<Para>
React lets you build user interfaces out of individual pieces
called components. Create your own React components like{' '}
<Code>Thumbnail</Code>, <Code>LikeButton</Code>, and{' '}
<Code>Video</Code>. Then combine them into entire screens, pages,
and apps.
React ви овозможува да изградите кориснички интерфејси од
поединечни делови наречени компоненти. Создадете свои компоненти
React како <Code>Thumbnail</Code>, <Code>LikeButton</Code> и{' '}
<Code>Video</Code>. Потоа комбинирајте ги во цели екрани,
страници, и апликации.
</Para>
</Center>
<FullBleed>
<Example1 />
</FullBleed>
<Center>
<Para>
Whether you work on your own or with thousands of other
developers, using React feels the same. It is designed to let you
seamlessly combine components written by independent people,
teams, and organizations.
Без разлика дали работите сами или со илјадници други
програмерите, користењето на React се чувствува исто. Дизајниран е
за да ви дозволи беспрекорно комбинирање на компоненти напишани од
независни луѓе, тимови и организации.
</Para>
</Center>
</Section>
Expand Down
2 changes: 1 addition & 1 deletion src/components/MDX/MDXComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ function YouWillLearn({
children: any;
isChapter?: boolean;
}) {
let title = isChapter ? 'In this chapter' : 'You will learn';
let title = isChapter ? 'Во ова поглавје' : 'Вие ќе научите';
return <SimpleCallout title={title}>{children}</SimpleCallout>;
}

Expand Down
Loading
Loading