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

chore/sw_cache #512

Merged
merged 13 commits into from
May 21, 2024
Merged

chore/sw_cache #512

merged 13 commits into from
May 21, 2024

Conversation

EduardZaydler
Copy link
Member

@EduardZaydler EduardZaydler commented May 6, 2024

precaching static files with workbox-webpack-plugin
the main reason was to get rid of chunk load error, which happend during release with active browser tab, at the same time overall loading time has decreased.
precache works on the background and updates on every service worker registration, so to get new version you just need to refresh the page.
added page reload notification when new version is available

@EduardZaydler
Copy link
Member Author

/build

@EduardZaydler
Copy link
Member Author

/build

@EduardZaydler
Copy link
Member Author

/build

@EduardZaydler
Copy link
Member Author

/build

@EduardZaydler EduardZaydler marked this pull request as ready for review May 7, 2024 08:00
@EduardZaydler EduardZaydler requested a review from a team as a code owner May 7, 2024 08:00
@EduardZaydler
Copy link
Member Author

/build

@EduardZaydler EduardZaydler marked this pull request as draft May 7, 2024 11:04
@EduardZaydler
Copy link
Member Author

/build

@EduardZaydler
Copy link
Member Author

/build

@EduardZaydler
Copy link
Member Author

/build

@EduardZaydler
Copy link
Member Author

/build

@EduardZaydler EduardZaydler marked this pull request as ready for review May 8, 2024 06:11
FonDumik
FonDumik previously approved these changes May 8, 2024
sol-un
sol-un previously approved these changes May 14, 2024
src/Components/Layout/Layout.tsx Outdated Show resolved Hide resolved
webpack.config.js Show resolved Hide resolved
src/serviceWorkerRegistration.ts Show resolved Hide resolved
@@ -3,11 +3,13 @@ import { PayloadAction, createSlice } from "@reduxjs/toolkit";
interface IUIState {
isLoading: boolean;
error: string;
serviceWorkerUpdated: boolean;
Copy link

@GreoGi GreoGi May 14, 2024

Choose a reason for hiding this comment

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

не очень улавливаю, зачем нам знать что сервис воркер обновился, и что вообще мы в это понятие вкладываем?
В мр'е не вижу чтобы где-то использовалось это поле в приложении

Copy link
Member Author

Choose a reason for hiding this comment

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

https://github.com/moira-alert/web2.0/pull/512/files#:~:text=const%20%7B%20serviceWorkerUpdated%20%7D%20%3D%20useAppSelector(UIState)%3B
используется для тоста с предложением обновиться

Copy link

@GreoGi GreoGi May 17, 2024

Choose a reason for hiding this comment

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

Ссылка не работает к сожалению, но я понял что не увидел это место.
Мне не нравится название serviceWorkerUpdated, вообще не отражает сценарий, что мы предлагаем пользователю обновить страницу

Copy link

Choose a reason for hiding this comment

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

Можно наверно переименовать во что-то по типу newFrontendVersionAvailable или needToUpdateFrontend

Copy link
Member Author

Choose a reason for hiding this comment

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

переименовал

@EduardZaydler EduardZaydler requested a review from GreoGi May 15, 2024 09:49
@EduardZaydler
Copy link
Member Author

/build

@EduardZaydler
Copy link
Member Author

/build

Copy link

github-actions bot commented May 20, 2024

Build and push Docker images with tag: 2024-05-21.0589cf0

@EduardZaydler EduardZaydler merged commit 0589cf0 into master May 21, 2024
4 checks passed
@EduardZaydler EduardZaydler deleted the chore/sw_cache branch May 21, 2024 14:46
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.

4 participants