Skip to content

New modules docs #2946

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

Merged
merged 18 commits into from
Oct 18, 2023
Merged

New modules docs #2946

merged 18 commits into from
Oct 18, 2023

Conversation

andrewbranch
Copy link
Member

@github-actions
Copy link
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-glacier-09aa73710-2946.centralus.azurestaticapps.net

@github-actions

This comment was marked as resolved.

@github-actions
Copy link
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-glacier-09aa73710-2946.centralus.azurestaticapps.net

@github-actions
Copy link
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-glacier-09aa73710-2946.centralus.azurestaticapps.net

@github-actions
Copy link
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-glacier-09aa73710-2946.centralus.azurestaticapps.net

Copy link
Contributor

@orta orta left a comment

Choose a reason for hiding this comment

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

This PR deletes a bunch of markdown files which will break URLs people have been using, you could consider adding them back and adding the deprecated YML tag and there's a tag you can use to forward someone to the replacement also. It should handle the HTML tags to tell search engines to lower the rank on those pages too

Only looked at the theory page, but got 1-2 comments


This approach had some downsides, especially as web pages grew larger and more complex. In particular, all scripts loaded onto the same page share the same scope—appropriately called the “global scope”—meaning the scripts had to be very careful not to overwrite each others’ variables and functions.

Any system that solves this problem by giving files their own scope while still providing a way to make bits of code available to other files can be called a “module system.” (It may sound obvious to say that each file in a module system is called a “module,” but the term is often used to contrast with _script_ files, which run outside a module system, in a global scope.)
Copy link
Contributor

Choose a reason for hiding this comment

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

The opening line for this paragraph feels a little unwieldy (lots of abstract terms) when you try say it out loud could try starting with the term and then building backwards?

Suggested change
Any system that solves this problem by giving files their own scope while still providing a way to make bits of code available to other files can be called a “module system.” (It may sound obvious to say that each file in a module system is called a “module,” but the term is often used to contrast with _script_ files, which run outside a module system, in a global scope.)
We call a system which tries to break up that single global scope a “module system“, these are usually build around providing a per-file scope which allows for ways to pass bits of code between each other. (It may sound obvious to say that each file in a module system is called a “module,” but the term is often used to contrast with _script_ files, which run outside a module system, in a global scope.)

```
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '.../node_modules/dependency/utils' imported from .../node_modules/dependency/index.js
Did you mean to import ./utils.js?
```
Copy link
Contributor

Choose a reason for hiding this comment

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

You have the ability to inline custom errors if you want

@andrewbranch
Copy link
Member Author

This PR deletes a bunch of markdown files which will break URLs people have been using, you could consider adding them back and adding the deprecated YML tag and there's a tag you can use to forward someone to the replacement also

I added redirects for the deleted pages in setupRedirects.

@github-actions
Copy link
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-glacier-09aa73710-2946.centralus.azurestaticapps.net

@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2023

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-glacier-09aa73710-2946.centralus.azurestaticapps.net

@github-actions
Copy link
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-glacier-09aa73710-2946.centralus.azurestaticapps.net

@github-actions
Copy link
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-glacier-09aa73710-2946.centralus.azurestaticapps.net

@github-actions
Copy link
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-glacier-09aa73710-2946.centralus.azurestaticapps.net

@github-actions
Copy link
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-glacier-09aa73710-2946.centralus.azurestaticapps.net

@github-actions
Copy link
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-glacier-09aa73710-2946.centralus.azurestaticapps.net

@github-actions
Copy link
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-glacier-09aa73710-2946.centralus.azurestaticapps.net

@github-actions
Copy link
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-glacier-09aa73710-2946.centralus.azurestaticapps.net

@github-actions
Copy link
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-glacier-09aa73710-2946.centralus.azurestaticapps.net

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

Successfully merging this pull request may close these issues.

Module documentation tracking issue
2 participants