diff --git a/curriculum/challenges/english/25-front-end-development/lecture-introduction-to-javascript-libraries-and-frameworks/6734e3a9cc78faaf4248d335.md b/curriculum/challenges/english/25-front-end-development/lecture-introduction-to-javascript-libraries-and-frameworks/6734e3a9cc78faaf4248d335.md index 051b5c4ea87..18301b7300b 100644 --- a/curriculum/challenges/english/25-front-end-development/lecture-introduction-to-javascript-libraries-and-frameworks/6734e3a9cc78faaf4248d335.md +++ b/curriculum/challenges/english/25-front-end-development/lecture-introduction-to-javascript-libraries-and-frameworks/6734e3a9cc78faaf4248d335.md @@ -1,14 +1,44 @@ --- id: 6734e3a9cc78faaf4248d335 title: What Is the Role of JS Libraries and Frameworks, and Why Are They Used in the Industry? -challengeType: 11 -videoId: nVAaxZ34khk +challengeType: 19 +# videoId: nVAaxZ34khk dashedName: what-is-the-role-of-js-libraries-and-frameworks-and-why-are-they-used-in-the-industry --- # --description-- -Watch the video lecture and answer the questions below. +The video for this lecture isn't available yet, one will be available soon. Here is a transcript of the lecture for now: + +JavaScript libraries and frameworks provide pre-built code that streamlines the development process. While both libraries and frameworks serve to improve productivity and standardize coding practices, they differ in their approach and level of control they provide to developers. + +Libraries are generally more focused on providing solutions to specific tasks, such as manipulating the DOM, handling events, or managing AJAX requests. + +An example of a JavaScript library is jQuery. + +jQuery became very popular in the early 2010s and was widely used to simplify DOM manipulation, event handling, animations, effects, and more. This library also offered a rich ecosystem of plugins, which made it easy to build common web components like datepickers, sliders, and modal dialogs. + +Although jQuery is no longer as widely used as it once was, it significantly helped developers by making tasks that were complex in vanilla JavaScript much easier to implement. + +Frameworks, on the other hand, provide a more defined structure for building applications. They often come with a set of rules and conventions that developers need to follow. + +For example, Angular encourages a component-based architecture with a set of conventions and tools that provide a structured approach to organizing and building applications. Angular gives developers clear guidelines on how to structure components, manage state, handle routing, and interact with services, making it a more opinionated framework. + +Other examples of frameworks include Remix and NextJS. + +In contrast, React, a UI library, is more flexible and doesn't enforce any particular architectural pattern. React focuses primarily on the view layer and leaves a lot of the choices on application design up to the developers. + +Although libraries and frameworks are used across projects of all sizes, The choice between using them often depends on the project's requirements. Libraries offer flexibility for specific functionalities, while frameworks provide a structured approach towards complex applications. + +In the industry, libraries and frameworks are widely used for several reasons. They significantly speed up development by providing quick solutions for common problems. + +One common problem in JavaScript is working with dates and timezones. But there are libraries out there with built in solutions to help you with date manipulation, timezones, parsing and formatting of dates. + +A lot of popular libraries and frameworks are well-tested and maintained by large communities. This means they're often more practical than building the same thing from scratch. + +Libraries and frameworks follow best practices and patterns that have been proven effective in real life scenarios. This can lead to more robust and scalable applications. + +In conclusion, libraries and frameworks offer quick solutions to common problems, speed up development, and promote best practices. Understanding the differences between libraries and frameworks, and knowing when to use them is a valuable skill for any JavaScript developer. # --questions-- diff --git a/curriculum/challenges/english/25-front-end-development/lecture-introduction-to-javascript-libraries-and-frameworks/6734e867bbf41cc5b11648c4.md b/curriculum/challenges/english/25-front-end-development/lecture-introduction-to-javascript-libraries-and-frameworks/6734e867bbf41cc5b11648c4.md index f643612a402..a63d0235072 100644 --- a/curriculum/challenges/english/25-front-end-development/lecture-introduction-to-javascript-libraries-and-frameworks/6734e867bbf41cc5b11648c4.md +++ b/curriculum/challenges/english/25-front-end-development/lecture-introduction-to-javascript-libraries-and-frameworks/6734e867bbf41cc5b11648c4.md @@ -1,14 +1,32 @@ --- id: 6734e867bbf41cc5b11648c4 title: What Are Single Page Applications, and What Are Some Issues Surrounding Them? -challengeType: 11 -videoId: nVAaxZ34khk +challengeType: 19 +# videoId: nVAaxZ34khk dashedName: what-are-single-page-applications-and-what-are-some-issues-surrounding-them --- # --description-- -Watch the lecture video and answer the questions below. +The video for this lecture isn't available yet, one will be available soon. Here is a transcript of the lecture for now: + +Unlike traditional multi-page websites, single page applications (SPAs) load only one HTML page and dynamically update the content as the user interacts with the app, without reloading the entire page. This approach can lead to faster, more responsive applications, but it also comes a set of challenges and considerations. + +SPAs heavily use JavaScript to manage the application's state and render content. Instead of requesting new HTML pages from the server, SPAs use JavaScript to manipulate the DOM and fetch data asynchronously. This is often done using libraries and frameworks like React, Vue, or Angular, which provide great tools for building complex user interfaces. + +SPAs have some common issues. One significant issue is that screen readers may struggle with dynamically updated content. When content changes without a page reload/refresh, screen readers might not notify these changes, which makes our users unaware of updates on our web app. + +Another challenge with SPAs is with navigation and browser history. Users expect the back and forward buttons to work as they do on traditional websites. This might not work properly in SPAs because technically, the URL of the web app doesn’t change. Since, the URL of the web app doesn’t change, they can’t bookmark any specific page. Refreshing the page might reset the application to its initial state, rather than maintaining the current view. + +SPAs can pose challenges for SEO optimization. + +Search engines like Google can have difficulty indexing dynamically loaded content because they may not execute JavaScript properly or may miss content that isn’t included in the initial HTML page. This can lead to pages not being indexed correctly. + +However, modern search engines have improved their ability to crawl SPAs, and there are techniques such as server-side rendering (SSR), pre rendering, and the use of SEO-friendly URLs that can help mitigate these issues and improve SEO for SPAs. + +Performance is another consideration. SPAs load the entire application in one go, which means that if the loading time increases, users will be seeing a blank screen for a longer period of time. Now consider the scenario of users with slower internet speeds. Overall, the user experience will not be very pleasant. + +In conclusion, while Single Page Applications offer many benefits, they also present unique challenges. Developers need to be careful of accessibility, usability, SEO, and performance considerations when building SPAs. By addressing these issues, it's possible to create SPAs that are fast, responsive, and accessible to all users. # --questions-- diff --git a/curriculum/challenges/english/25-front-end-development/lecture-introduction-to-javascript-libraries-and-frameworks/6734e86f590727c5e7e9ec5e.md b/curriculum/challenges/english/25-front-end-development/lecture-introduction-to-javascript-libraries-and-frameworks/6734e86f590727c5e7e9ec5e.md index f6891a4e86f..9932409d91a 100644 --- a/curriculum/challenges/english/25-front-end-development/lecture-introduction-to-javascript-libraries-and-frameworks/6734e86f590727c5e7e9ec5e.md +++ b/curriculum/challenges/english/25-front-end-development/lecture-introduction-to-javascript-libraries-and-frameworks/6734e86f590727c5e7e9ec5e.md @@ -1,14 +1,30 @@ --- id: 6734e86f590727c5e7e9ec5e title: What Is React, and What Is It Commonly Used For? -challengeType: 11 -videoId: nVAaxZ34khk +challengeType: 19 +# videoId: nVAaxZ34khk dashedName: what-is-react-and-what-is-it-commonly-used-for --- # --description-- -Watch the lecture video and answer the questions below. +The video for this lecture isn't available yet, one will be available soon. Here is a transcript of the lecture for now: + +React is one of the most popular JavaScript libraries for building user interfaces and web applications. Originally developed and maintained by Facebook, React has gained huge popularity in web development due to its efficiency, flexibility, and features. + +A fundamental concept in React is the creation of reusable UI components. These components, such as buttons, cards, and avatar components, can be easily reused throughout your application. You can nest these components inside each other to build more complex, dynamic interfaces. + +One of the key advantages of React is that these custom components can update and render independently as data changes. + +Unlike traditional JavaScript, which requires direct manipulation of the DOM (Document Object Model), React uses a virtual DOM, which improves performance and efficiency. You’ll learn more about the virtual DOM and how it works in upcoming lecture videos. + +In addition to reusable components, React also provides a powerful way to manage the state of your application. State refers to the data that determines how a component renders and behaves. + +With React, you can easily track and update the state of components, ensuring that the UI reflects the most current data. You will learn more about working with state in future lecture videos. + +While there are many libraries within the JavaScript ecosystem, freeCodeCamp will mainly be focused on teaching React because of its wide spread use and demand in the industry. + +Over the next few lectures, we will dive deeper into building custom components, managing state, and more. # --questions-- diff --git a/curriculum/challenges/english/25-front-end-development/lecture-introduction-to-javascript-libraries-and-frameworks/6734e879c78ee6c61db25b90.md b/curriculum/challenges/english/25-front-end-development/lecture-introduction-to-javascript-libraries-and-frameworks/6734e879c78ee6c61db25b90.md index a62644b74d4..2542213ad64 100644 --- a/curriculum/challenges/english/25-front-end-development/lecture-introduction-to-javascript-libraries-and-frameworks/6734e879c78ee6c61db25b90.md +++ b/curriculum/challenges/english/25-front-end-development/lecture-introduction-to-javascript-libraries-and-frameworks/6734e879c78ee6c61db25b90.md @@ -1,14 +1,117 @@ --- id: 6734e879c78ee6c61db25b90 title: What Are Components in React, and How Do They Work? -challengeType: 11 -videoId: nVAaxZ34khk +challengeType: 19 +# videoId: nVAaxZ34khk dashedName: what-are-components-in-react-and-how-do-they-work --- # --description-- -Watch the lecture video and answer the questions below. +The video for this lecture isn't available yet, one will be available soon. Here is a transcript of the lecture for now: + +Components are the building blocks of React applications that allow developers to break down complex user interfaces into smaller, manageable pieces, making it easier to develop and maintain large-scale applications. + +The two types of components in React are functional and class based components. In modern React, developers will use functional components and all of the examples we look at today will be functional components. + +At a higher level, you can think of component like JavaScript functions that return elements describing the UI. + +This UI is described using JSX, a syntax extension for JavaScript that looks similar to HTML but allows you to write UI elements in a more declarative way. + +Let's look at an example of a React component: + +```js +function Greeting() { + const name = "John" + {/* The result will be Hello John*/} + return
Nice to meet you.
+} +``` + +We are trying to add another sentence of `"Nice to meet you"` but it is not rendering on the page correctly. + +There seems to be an error message instead. The error message says `"Adjacent JSX elements must be wrapped in an enclosing tag."` + +The reason why you are getting that error message is because multiple sibling elements need to be wrapped in a parent element. While you could wrap the h1 and p elements in a single div, there is another way to silence the error. + +React `Nice to meet you.
+Nice to meet you.
+ > + ); +} +``` + # --questions-- diff --git a/curriculum/challenges/english/25-front-end-development/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md b/curriculum/challenges/english/25-front-end-development/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md index 158d5b4c12c..1a8d82e1859 100644 --- a/curriculum/challenges/english/25-front-end-development/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md +++ b/curriculum/challenges/english/25-front-end-development/lecture-introduction-to-javascript-libraries-and-frameworks/6734e88cc46e6dc679420040.md @@ -1,14 +1,63 @@ --- id: 6734e88cc46e6dc679420040 title: What is Vite and How Can It Be Used to Setup a New React Project? -challengeType: 11 -videoId: nVAaxZ34khk +challengeType: 19 +# videoId: nVAaxZ34khk dashedName: what-is-vite-and-how-can-it-be-used-to-setup-a-new-react-project --- # --description-- -Watch the lecture video and answer the questions below. +The video for this lecture isn't available yet, one will be available soon. Here is a transcript of the lecture for now: + +Unlike working with smaller vanilla HTML, CSS, and JavaScript projects, starting a new React project includes a few more steps to ensure that everything runs correctly. Instead of trying to setup of all of the necessary configurations by yourself, there are tools that will do that for you. + +One of the most popular tools for setting up projects is Vite. Vite, which means "fast" in French, is a build tool that aims to provide a faster development experience for modern web projects. Vite can be used with React, as well as with other libraries and frameworks like Vue or Svelte. You can even use it with vanilla JavaScript projects. + +To create a new project with Vite, you will need to use the command line. If you are using Windows machine, then you can use the Command Prompt or Windows PowerShell. If you are using a Mac, then you can use the Terminal app. + +Once you have the command line open, you can use the following command: + +```bash +npm create vite@latest my-react-app -- --template react +``` + +This command creates a new React project named `my-react-app` using Vite's React template. + +You can then open up the new project and see the React boilerplate code that Vite has provided for you. + +The great thing about Vite is that it will only provide the files that are absolutely necessary to get started with your React project. + +To actually run the project as is, you will need to install the dependencies using the following commands in the command line: + +```bash + cd my-react-app + npm install +``` + +The `cd my-react-app` command ensures that you change to the correct directory where your project is located. + +The `npm install` command is used to install the dependencies needed to properly run your React project. Dependencies are libraries or packages that your React project requires in order to function correctly, such as React itself, ReactDOM, or other third-party packages that provide additional functionality. + +Running `npm install` will read the `package.json` file in your project directory and install all the dependencies listed there, allowing you to build and run your React app without missing any necessary components. + +The `package.json` file is a key configuration file in projects that contains metadata about your project, including its name, version, and dependencies. It also defines scripts, licensing information, and other settings that help manage the project and its dependencies. + +Once the dependencies are installed, you should notice a new folder in your project called `node_modules`. + +The `node_modules` folder is where all the packages and libraries required by your project are stored. This folder contains the actual code for the dependencies listed in your package.json file, including both your project's direct dependencies and any dependencies of those dependencies. + +To run your project, run the `npm run dev` command and open up a new browser tab at `http://localhost:5173/`. + +You should see the starter template that Vite has provided for you. + +If you need to stop the local server, press `CTRL + C` in the command line. + +To actually see the code for this starter template, you can go into your project inside the src folder and you should see the `App.jsx` file. + +From there you can start to modify the file, save your changes and see the new changes display in the browser. + +And with that, you're ready to begin building your React application! # --questions-- diff --git a/curriculum/challenges/english/25-front-end-development/lecture-introduction-to-javascript-libraries-and-frameworks/674ba6876f7ada867135bb95.md b/curriculum/challenges/english/25-front-end-development/lecture-introduction-to-javascript-libraries-and-frameworks/674ba6876f7ada867135bb95.md index fc6c67b656f..7a3f68afd1d 100644 --- a/curriculum/challenges/english/25-front-end-development/lecture-introduction-to-javascript-libraries-and-frameworks/674ba6876f7ada867135bb95.md +++ b/curriculum/challenges/english/25-front-end-development/lecture-introduction-to-javascript-libraries-and-frameworks/674ba6876f7ada867135bb95.md @@ -1,14 +1,106 @@ --- id: 674ba6876f7ada867135bb95 title: How Can You Import and Export Components in React? -challengeType: 11 -videoId: nVAaxZ34khk +challengeType: 19 +# videoId: nVAaxZ34khk dashedName: how-can-you-import-and-export-components-in-react --- # --description-- -Watch the lecture video and answer the questions below. +The video for this lecture isn't available yet, one will be available soon. Here is a transcript of the lecture for now: + +In this lecture, we will take a look at how to import and export components in React. + +In this example, we have a `Cat` component that belongs in a file called `Cat.jsx`. For the file extension, we are using the jsx file extension because this file is mainly working with JSX. + +```js +function Cat() { + return ( +
+
+
+ Age: {age}
+Country: {country}
+{message}
} +{user.email}
+