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

feat: update documentation #1040

Merged
merged 2 commits into from
Oct 20, 2023
Merged

feat: update documentation #1040

merged 2 commits into from
Oct 20, 2023

Conversation

sdo-1A
Copy link
Contributor

@sdo-1A sdo-1A commented Oct 18, 2023

No description provided.

README.md Outdated

- `crossorigin` Flag that sets crossorigin attribute on links. If true it will be set for all prefetched resources.
1. By running the install command above, the following lines should have been added to the application's `angular.json`:
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. By running the install command above, the following lines should have been added to the application's `angular.json`:
1. By running the `ng add` command above, the following lines should have been added to the application's `angular.json`:

Copy link
Member

Choose a reason for hiding this comment

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

is there a link from the main readme to this doc?


After adding a service worker to your project, as specified in the [prerequisites](README.md#prerequisites), the modifications include
the creation of a service worker configuration file called `ngsw-config.json`, which specifies the caching behaviors.
Then the build process creates the manifest file `ngsw.json` using information from `ngsw-configuration.json`.
Copy link
Member

Choose a reason for hiding this comment

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

ngsw-configuration.json -> ngsw-config.json

we should mention that ngsw.json is in the dist folder

README.md Outdated Show resolved Hide resolved
@sdo-1A sdo-1A force-pushed the feat/update-doc branch 2 times, most recently from e708a94 to cb0eaed Compare October 19, 2023 11:57
fpaul-1A
fpaul-1A previously approved these changes Oct 19, 2023
vscaiceanu-1a
vscaiceanu-1a previously approved these changes Oct 19, 2023
README.md Outdated
## Builder options
- `targetBuild` **Mandatory** The target build where prefetch should be applied. Used for identifying the `outputPath` of the build.

- `resourceTypes` An object describing the resource types that should be prefetched.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any constraints related to the key of said object? For instance would "img": ["png"] still be valid?
Does it follow a schema?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

README.md Outdated
@@ -19,46 +19,78 @@ In some cases, it is possible to prefetch the static resources of an application
The prefetch builder generates a `ngxPrefetch.js` file that should be included in the HTML page of the entry point. When run, it dynamically [creates `<link>` tags](https://developer.mozilla.org/en-US/docs/Web/HTTP/Link_prefetching_FAQ) for each static resource (such as JS and CSS files) so that the browser can prefetch them during idle times. This will improve the Page Load Time of the application when it is actually loaded.

Choose a reason for hiding this comment

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

We could give a bit more explanation here: "This will improve the Page Load Time of the application when it is actually loaded" => This will improve the Page Load Time of the application when the application it accessed for the first time. Then the browser caching will take over, until a new version of the application is deployed or the browser application cache is cleared.

- `{DYNAMIC_CONTENT_PATH}`: the path where the dynamic resources are hosted (`"mydynamiccontentpath"` for example)
- `{DYNAMIC_CONTENT_FILES}`: the path of the dynamic content files relative to the dynamic content path (expects a format like the following example: `["relativePath/myfile1", "relativePath/myfile2"]`)

### HTLM header
Copy link
Member

Choose a reason for hiding this comment

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

LINK elements in header

README.md Outdated
@@ -89,6 +89,8 @@ Please refer to the details on how the ngx-prefetch works [here](docs/HOW_IT_WOR
If this is not the case, you can configure the full path of the resources that will be prefetched (ex: https://my-web-app.com/path/to/my-app/).
It is also possible to set this value at runtime. Instead of setting it in the Builder's options, you can search for `{STATICS_FULL_PATH}` and replace it on the server side in order to inject a path.

- `localizationPattern` Pattern for the relative path of the localization file. By default, the pattern corresponds to the JSON file in a folder called localizations: `"/localizations/${language}.json"`.
Copy link
Member

Choose a reason for hiding this comment

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

we should mention that if path contains the ${language} part, it will be replaced on the server side.

@sdo-1A sdo-1A merged commit e5eda83 into master Oct 20, 2023
1 check passed
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.

5 participants