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

Add support for PWA #1005

Merged
merged 10 commits into from
May 12, 2023
Merged

Conversation

SleeplessOne1917
Copy link
Member

This was originally meant to address #996, however I decided to set up the service worker so that it would work as a PWA properly on multiple platforms.

# Cache deps
COPY package.json yarn.lock ./
RUN yarn install --ignore-scripts --prefer-offline --pure-lockfile
Copy link
Member Author

Choose a reason for hiding this comment

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

This and the environment variables are required to make the image processing library work. See lovell/sharp#3663.

Copy link
Member Author

Choose a reason for hiding this comment

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

I was getting constants meant for the client on the server. Changing them to functions fixed it.

@@ -1,49 +0,0 @@
{
Copy link
Member

Choose a reason for hiding this comment

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

Yaay thanks, I hated this thing.

"icons"
);

export async function generateManifestBase64(site: Site) {
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 probably re-organize some of this into separate files... not necessary for this PR tho.

src/shared/env.ts Outdated Show resolved Hide resolved
display: "standalone",
id: "/",
background_color: "#222222",
theme_color: "#222222",
Copy link
Member Author

Choose a reason for hiding this comment

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

I wonder if theme_color and background_color should be configurable by instance admins?

Copy link
Member

Choose a reason for hiding this comment

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

mmm.... lets not do it until someone asks for it lol. Plus I think that would require a local site setting in the database, or some image processing... pry overkill.

@dessalines dessalines merged commit b19b51c into LemmyNet:main May 12, 2023
@SleeplessOne1917 SleeplessOne1917 deleted the custom-manifest branch May 14, 2023 03:03
makotech222 added a commit to hexbear-collective/lemmy-ui that referenced this pull request May 22, 2023
makotech222 added a commit to hexbear-collective/lemmy-ui that referenced this pull request May 22, 2023
makotech222 added a commit to hexbear-collective/lemmy-ui that referenced this pull request May 22, 2023
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.

2 participants