Skip to content
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

Change scheme for fetch #1307

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Change scheme for fetch #1307

wants to merge 4 commits into from

Conversation

Dedekind561
Copy link
Contributor

What does this change?

  • Shifts event related explanation from the asynchrony block in data flows/sprint 3 -> capturing events data flows/sprint 2. (creating room for extra stuff in data-flows/sprint-3). I also think it flows better across both prep sections now.
  • Adds explanation on serving files locally with local web server with http:// scheme

I think the explanation on using the http scheme makes most sense in data-flows/sprint-3 which is why I did a minor re-jig to make way for the explanation in data-flows/sprint-3

Common Content?

n/a

  • Block/s

Common Theme?

  • Yes

Issue number: #1107

Org Content?

Sprint

Checklist

Who needs to know about this?

Copy link

netlify bot commented Jan 14, 2025

Deploy Preview for cyf-sdc ready!

Name Link
🔨 Latest commit d15b137
🔍 Latest deploy log https://app.netlify.com/sites/cyf-sdc/deploys/67862be09f13090008d692b7
😎 Deploy Preview https://deploy-preview-1307--cyf-sdc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 14, 2025

Deploy Preview for cyf-curriculum canceled.

Name Link
🔨 Latest commit d15b137
🔍 Latest deploy log https://app.netlify.com/sites/cyf-curriculum/deploys/67862be06f7e080008e30f28

Copy link

netlify bot commented Jan 14, 2025

Deploy Preview for cyf-launch ready!

Name Link
🔨 Latest commit d15b137
🔍 Latest deploy log https://app.netlify.com/sites/cyf-launch/deploys/67862be05461600008927529
😎 Deploy Preview https://deploy-preview-1307--cyf-launch.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 14, 2025

Deploy Preview for cyf-programming ready!

Name Link
🔨 Latest commit d15b137
🔍 Latest deploy log https://app.netlify.com/sites/cyf-programming/deploys/67862be088ef1c00083a5175
😎 Deploy Preview https://deploy-preview-1307--cyf-programming.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 98 (🟢 up 13 from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 90 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 14, 2025

Deploy Preview for cyf-common ready!

Name Link
🔨 Latest commit d15b137
🔍 Latest deploy log https://app.netlify.com/sites/cyf-common/deploys/67862be0c839d700085cb523
😎 Deploy Preview https://deploy-preview-1307--cyf-common.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 14, 2025

Deploy Preview for cyf-tracks ready!

Name Link
🔨 Latest commit d15b137
🔍 Latest deploy log https://app.netlify.com/sites/cyf-tracks/deploys/67862be06ea3850008dfee54
😎 Deploy Preview https://deploy-preview-1307--cyf-tracks.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 14, 2025

Deploy Preview for cyf-piscine ready!

Name Link
🔨 Latest commit d15b137
🔍 Latest deploy log https://app.netlify.com/sites/cyf-piscine/deploys/67862be0a398b500092720fb
😎 Deploy Preview https://deploy-preview-1307--cyf-piscine.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 97 (🔴 down 2 from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 14, 2025

Deploy Preview for cyf-itd ready!

Name Link
🔨 Latest commit d15b137
🔍 Latest deploy log https://app.netlify.com/sites/cyf-itd/deploys/67862be04c9a640008c8d882
😎 Deploy Preview https://deploy-preview-1307--cyf-itd.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 98 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, a few suggestions :) Thanks!

Comment on lines +21 to +22
1. Add an input event listener to the search box
2. In the handler, get `value` of input element
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Add an input event listener to the search box
2. In the handler, get `value` of input element
1. Add an input event listener to the search box.
2. In the handler, get the `value` of input element.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block now feels a bit mis-named - it's really talking about synchronous execution by way of setting up the next block to talk about asynchronous execution? May be worth either renaming, or combining the blocks?

Also if we keep this as-is, I'd drop its time from 40 minutes down to 5-10 minutes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's bump this block's time to 20?


### Web Server Access: The HTTP Protocol

The second approach involves using a local development server. You can create one using tools like [Python's built-in server](https://realpython.com/python-http-server/) or [Node.js's http-server](https://www.npmjs.com/package/http-server). These tools create a web server on your computer that serves your files using the HTTP protocol. Your browser will then access the files through a URL like:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The second approach involves using a local development server. You can create one using tools like [Python's built-in server](https://realpython.com/python-http-server/) or [Node.js's http-server](https://www.npmjs.com/package/http-server). These tools create a web server on your computer that serves your files using the HTTP protocol. Your browser will then access the files through a URL like:
Another approach involves using a local development server. You can create one using tools like [Python's built-in server](https://realpython.com/python-http-server/) or [Node.js's http-server](https://www.npmjs.com/package/http-server). These tools create a web server on your computer that serves your files using the HTTP protocol. Your browser will then access the files through a URL like:


### Web Server Access: The HTTP Protocol

The second approach involves using a local development server. You can create one using tools like [Python's built-in server](https://realpython.com/python-http-server/) or [Node.js's http-server](https://www.npmjs.com/package/http-server). These tools create a web server on your computer that serves your files using the HTTP protocol. Your browser will then access the files through a URL like:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The second approach involves using a local development server. You can create one using tools like [Python's built-in server](https://realpython.com/python-http-server/) or [Node.js's http-server](https://www.npmjs.com/package/http-server). These tools create a web server on your computer that serves your files using the HTTP protocol. Your browser will then access the files through a URL like:
The second approach involves using a local development server. You can create one using tools like [Python's built-in server](https://realpython.com/python-http-server/) or [npm's http-server](https://www.npmjs.com/package/http-server). These tools create a web server on your computer that serves your files using the HTTP protocol. Your browser will then access the files through a URL like:

1. 🗓️ we know that sending requests over a network takes time
1. 🧵 we know that we should not stop our program to wait for data
1. 🪃 we know that we can use callbacks to manage events
The `http://` prefix shows that you're accessing the file through a proper web server, even though that server is running on your own computer.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `http://` prefix shows that you're accessing the file through a proper web server, even though that server is running on your own computer.
The `http://` prefix shows that you're accessing the file through a proper web server, even though that server is running on your own computer.
You need to be using `http://` (or `https://`) _not_ `file://` in order to use `fetch`.


searchBox.addEventListener("input", handleSearchInput);
When we call `addEventListener`, it doesn't immediately execute the `handleInput` function. Instead, it sets up a listener that will run this function later. Event listeners are actually part of the Event API provided by web browsers - they aren't part of the core JavaScript language! When you create an event listener, you're essentially making a request to a Web API to handle this functionality for you. In this pattern, the callback function (`handleInput`) only executes when a user types. We're using functions as containers for code that needs to execute at a later time, specifically in response to user interactions. This approach lets us tell the browser exactly what actions to take once a particular event occurs.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

essentially? functionality? Can you do a Hemingway pass? 🙏


**👉🏽 [Visualise the Event Loop](http://latentflip.com/loupe/?code=JC5vbignYnV0dG9uJywgJ2NsaWNrJywgZnVuY3Rpb24gb25DbGljaygpIHsKICAgIGNvbnNvbGUubG9nKCdZb3UgY2xpY2tlZCB0aGUgYnV0dG9uIScpOyAgICAKfSk7Cgpjb25zb2xlLmxvZygiSGkhIik7Cgpjb25zb2xlLmxvZygiV2VsY29tZSB0byB0aGUgZXZlbnQgbG9vcCIpOw%3D%3D!!!PGJ1dHRvbj5DbGljayBtZSE8L2J1dHRvbj4%3D)**

### 🧠 Recap our concept map
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've removed the map - can I have it back? Not everyone thinks in the same way. We can have multiple ways of modelling ideas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

3 participants