Skip to content

Commit f74a681

Browse files
committed
Updates to JavaScript notes and NodeJS notes and added to babel notes
1 parent 402df93 commit f74a681

10 files changed

+296
-82
lines changed

GitHub/configuring-github.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,18 @@
22

33
This is not a note about configuring Git. This is for configuring GitHub in a project.
44

5-
Create a folder/directory in your project called `.github`
5+
To do this, Create a folder/directory in your project called `.github`. This will house GitHub special files.
66

77
## GitHub Actions
88

9+
Inside the `.github` folder create a folder called actions
10+
11+
GitHub actions are primarily written in YAML and have the file extension .yml or .yaml
12+
913
## GitHub Workflows
14+
15+
Inside the .github folder/directory create a folder called `workflows`.
16+
17+
GitHub workflows are also primarily written in YAML and have the file extension .yml or .yaml, the same as an action would be.
18+
19+
Also in this folder you
Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,41 @@
1-
# Webpack and Babel
1+
# Webpack and Babel.js
22

3-
Using
3+
There are a few things that you should know about
44

5-
## Babel
5+
## Babel.js
66

7-
## Webpack
7+
What is Babel?
8+
9+
Babel, also known as Babel.js, is a free and open-source JavaScript transcompiler that is primarily used to convert ECMAScript 2015+ code into a backward-compatible version of JavaScript that can be run by current and older browsers or environments
10+
11+
It allows developers to take advantage of the newest features of the language and to use new JavaScript language features by converting their source code into versions of JavaScript that a web browser can process
12+
13+
Babel can also be used to compile TypeScript into JavaScript, but in this case you really should just write TypeScript.
14+
15+
The toolchain can transform syntax, polyfill features missing in the target environment, perform source code transformations, and more
16+
17+
Babel has support for the latest version of JavaScript through syntax transformers, allowing developers to use new syntax without waiting for browser support
18+
19+
It is widely used in the industry and has a large community of contributors and sponsors
20+
21+
The Babel toolchain includes various tools such as @babel/cli, @babel/core, and @babel/preset-env, which make it easy to use Babel for transforming and polyfilling JavaScript code
22+
23+
Babel is particularly useful for ensuring that modern JavaScript code can run on older browsers and environments, making it an essential tool for web developers who need to support a wide range of platforms
24+
25+
## Webpack
26+
27+
Webpack is a highly extensible and configurable static module bundler for JavaScript applications. It goes through your application from a root entry point, builds a dependency graph, and produces optimized bundles of the combined modules.
28+
29+
Webpack's configuration file is a JavaScript file that exports a webpack configuration, which is then processed by webpack based on its defined properties
30+
31+
It is used to bundle JavaScript files for usage in a browser and can also transform, bundle, or package any resource or asset
32+
33+
Some of its use cases include separate builds per page, creating a components library as a container, and dynamic dependency graphs in a multi-page application
34+
35+
Webpack configuration files are written in JavaScript and can be split into smaller files for loaders, plugins, and other options
36+
37+
The configuration file is a JavaScript object that configures one of Webpack's options
38+
39+
It is commonly defined in a top-level webpack.config.js file, but it can also be passed as a parameter to Webpack's Node.js API
40+
41+
If you need to create a configuration for production in a separate file, you can do so by specifying the config file to use

Node_JavaScript_Programming/javascript-programming.md

Lines changed: 177 additions & 65 deletions
Large diffs are not rendered by default.

Node_JavaScript_Programming/make-a-package-json-file.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,17 @@ The "version" field in the package.json file must be in the form x.x.x and follo
9595
## Package Versioning
9696

9797
In "dependencies" and "devDependencies" the version numbers should be listed in SemVer.
98+
99+
The difference between using ^ and ~ in package versions is that ^ allows non-breaking updates, while ~ allows only for patch updates
100+
101+
It's typically listed in the various dependencies sections of as `"package": "~0.0.0"`.
102+
103+
## Dependencies
104+
105+
In a package.json file, the:
106+
107+
"dependencies": field is used to list the packages that are required for the application to run, while the devDependencies field is used to list the packages that are only required during development.
108+
109+
"peerDependencies" field is used to specify the packages that the current package relies on in order to work
110+
111+
"optionalDependencies" field is used to specify the packages that are not necessary for the application to run, but can be used to provide extra functionality.

Node_JavaScript_Programming/nodejs-development.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Node.js is a JavaScript runtime environment that allows the execution of JavaScr
66

77
Node.js and JavaScript are related but serve different purposes. JavaScript is a scripting language
88
used for writing scripts on websites and is mostly used on the client-side. On the other hand,
9+
910
Node.js is a JavaScript runtime environment that allows JavaScript code to run outside the browser,
1011
primarily on the server-side. Here are the key differences between Node.js and JavaScript:
1112

@@ -36,6 +37,16 @@ Packages and libraries are usually published to NPM, Yarn or PNPM.
3637

3738
While there are some great tutorials, it can still be a bit confusing. Many of these were published a number of years ago.
3839

40+
Node.js is not a framework, but a JavaScript runtime environment. It is a platform that executes code and communicates with an operating system.
41+
42+
While Node.js can be used on its own, many developers use it with dedicated frameworks such as Express, Meteor, and Sails to speed up development and provide a set of reusable tools. These frameworks offer different types of support, such as MVC, full-stack MVC, and REST API frameworks1
43+
44+
Therefore, Node.js can be used independently, but developers often use it with frameworks to enhance productivity and efficiency.
45+
46+
Node.js can be used without a specific framework. Some examples of Node.js applications that do not use a stack or framework include custom server-side code for handling HTTP requests, real-time chat applications, and command-line toolsThe benefits of using Node.js without a stack or framework include the flexibility to create custom solutions tailored to specific requirements, a deeper understanding of the underlying technology, and the ability to avoid the overhead of a framework, which can be beneficial for certain types of applications
47+
48+
When using Node.js without a stack or framework, developers may face challenges such as the need to handle low-level details, increased development time for common operations, and the absence of built-in features provided by frameworks, which can lead to the need for custom implementation of such features
49+
3950
## Obtaining Node.js
4051

4152
Node.js can be downloaded from <https://nodejs.org>. It's a fairly big ecosystem used by Web Developers. Especially in a `full-stack` development environment.
@@ -194,4 +205,18 @@ The localhost ports typically used with Node.js are commonly in the range of 300
194205

195206
## Node.js environement and environement variables
196207

197-
Using the Node.js environment especially within a web application or framework typcially requires installing the npm package `dotenv` so that you can use a `.env` or `variable.env` file to pass certain things along like ports
208+
Using the Node.js environment especially within a web application or framework typcially requires installing the npm package `dotenv` so that you can use a `.env` or `variable.env` file to pass certain things along like ports
209+
210+
## Installing Node.js packages
211+
212+
First of all, you should go the included read make-a-package-json.md file, although you can create a `package.json` file generated automatically by running `npm init` or `npm init -y` and answer the questions it gives you. But unless you know what to answer the questions here with, it might be in your best interest to create your own `package.json` file.
213+
214+
Once you decide which package(s) you will be installing. Install the required package(s) with whatever your package manager you are using. This will automatically create a `node_modules` folder or directory in your project. NPM will use `npm install packagename`, replacing packagename with whatever package you are installing. Yarn will use
215+
216+
Ideally, this `node_modules` should not be commited to version control, git, etc. and should this should be added to the `.gitignore` file because it will include the path to the modules you used on your computer in the contents of this folder/directory. However, There's no harm in committing this to version control like git. I would suggest that from here, you do your own research on this. My thoughts on this is that everyone who will use `yarn install` or `npm install` the requirements from the package.json file of your library, package or web application should ideally have their own unique version of the `node_modules` folder with the paths to the installation(s) of these packages on their own system.
217+
218+
## Handy, useful stuff in Node.js
219+
220+
If you use the `npm outdated` command done in bash/shell/command/terminal will list the outdated packages that are listed in your package.json file in a table.
221+
222+
To update packages you can use the `npm update` command.

PHP/php-development.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Developing with PHP
2+
3+
PHP gets lots of hate. It's old, been around a while. It's gotten way better over the years than it was initially, especially post PHP 5.
4+
5+
I don't know a great deal about PHP development nor have I used a lot of PHP in my projects.
6+

WebDevelopment/css.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,23 +96,19 @@ There are various types of selectors in CSS that are used to target HTML element
9696

9797
A CSS type selector, also known as a tag name selector or element selector, matches elements by their node name, selecting all elements of the given type within a document. It is used to style HTML elements based on their tag names. For example, to select all <p> elements and center-align them, you can use the following CSS rule:
9898

99-
```css
100-
p {
101-
text-align: center;
102-
}
103-
```
99+
p {
100+
text-align: center;
101+
}
104102

105103
Type selectors are not case-sensitive, and they can be combined with other selectors to target specific elements. They are one of the simplest and most frequently used selectors in CSS
106104

107105
- Class selectors: Select elements based on their class attribute (e.g., .example for elements with class "example").
108106

109107
For instance, A CSS class selector is used to select HTML elements with a specific class attribute. It is denoted by a period (.) followed by the class name. To use it, you can define a class in your CSS file and then apply that class to HTML elements in your document. For example, to create a class called "highlight" and apply it to certain elements, you can use the following CSS rule:
110108

111-
```css
112-
.highlight {
113-
background-color: yellow;
114-
}
115-
```
109+
.highlight {
110+
background-color: yellow;
111+
}
116112

117113
And in your HTML document:
118114

WebDevelopment/html.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,15 @@
11
# Learning HTML
22

3+
Learning HTML is pretty easy. While there are many web app frameworks that will handle this, traditional web development can be still done effectively by creating `.html` files, along with a few other types of files to include in your project.
4+
5+
Modern web development is typically done by creating a web app by using a framework.
6+
7+
We are going to discuss learning HTML in a top down fashion.
8+
9+
The modern HTML specification is HTML5, thus we are going to use this standard.
10+
11+
These are some of the things I have learned doing web development and creating .html files for apps and sites.
12+
13+
Hopefully this will help you with some baseline knowledge, that may at least help you debug some issues.
14+
15+
First of all, we will need to

about-serviceworkers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Service workers are a powerful tool for enhancing web applications, but they req
2020

2121
Service workers in web development have several use cases, contribute to improved website performance, and come with common challenges. Here's a summary based on the provided search results:
2222

23-
## Use Cases for Service Workers:
23+
## Use Cases for Service Workers
2424

2525
Offline-First Experience: Service workers enable the creation of an offline-first experience in web apps, improving overall user experience by caching resources required for the app to function, such as HTML pages, stylesheets, JavaScript, and images
2626

osdev-stuff.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# x86 32 bit Operating System Development
2+
3+
Here are my notes about x86 32 bit OS development
4+

0 commit comments

Comments
 (0)