Closed Barba828 closed 1 year ago
I'll check what's needed here...
yeah this would be an amazing addition to have, most likely just as another preset or something i would assume
@tripflex @Barba828 I'm working on this, I'll try to send a draft PR tmr, but I'll need your help, rn I have not any iOS/macOS device to test the splash screens
@Barba828 released v0.0.5 version, can you test it in your project?
EDIT: I'm updating the pwa docs to include this new feat.
@Barba828 I'll need to review a few things in sharp usage about density
in the options (at least we've an initial version)
@Barba828 can you check this https://deploy-preview-74--vite-pwa-org.netlify.app/assets-generator/cli.html#ios-ipad-splash-screens ? the PR can be found here https://github.com/vite-pwa/docs/pull/74
EDIT: open the PR preview in private browsing, the sw/pwa will be removed once window closed
I've upgraded to version 0.0.5, but I'm not generating a slash screen after changing the pwa-assets.config.ts
!
@Barba828 it is about you dont' include the entry or about the CLI not generating the splash screens
@userquin It looks as if there is a problem with the Object here, here the preset I got from config doesn't have appleSplashScreens
(It seems like appleSplashScreens is required to be in the preset object, but they are sibling JS objects)
@Barba828 ok, checking what's happening...
@Barba828 is your repo here https://github.com/Barba828/buitar/blob/main/packages/buitar/pwa-assets.config.ts ?
Yes,And I've upgraded to version 0.0.5 locally
@Barba828 can you provide the configuration for the splash screens? Or just push the changes to the repo in another branch/PR.
I'm using the default configuration from docs. And I am able to generate images by getting the appleSplashScreens directly from config
const {
appleSplashScreens: useAppleSplashScreens
} = config;
Forked your repro adding apple splash screens entry once updated the dev dependency:
@Barba828 have you run pnpm install
from root once dev dependency updated?
EDIT: you cannot access from the config since it isn't just a plain object, can be a string (preset name) or the loaded configuration.
@userquin thx, I was able to generate all the resources. And I've found what's wrong with me.
export default defineConfig({
preset: minimalPreset, // I need to configure it in this object
images: ['public/icons/logo.png'],
// Configuring it here will not generate resources
appleSplashScreens: createAppleSplashScreens({
padding: 0,
}),
})
Anyway, I need to review why not generating all the png files, maybe memory problems, rn only generating 15 (we've 39 devices/sizes)
I guess it is about devices entries using same sizes.
Confirmed, check for example these devices (there are more duplicates):
'iPad Pro 11"': { width: 1668, height: 2388, scaleFactor: 2 },
and 'iPad Pro 10.5"': { width: 1668, height: 2388, scaleFactor: 2 },
'iPad Pro 9.7"': { width: 1536, height: 2048, scaleFactor: 2 },
, 'iPad mini 7.9"': { width: 1536, height: 2048, scaleFactor: 2 },
, 'iPad Air 9.7"': { width: 1536, height: 2048, scaleFactor: 2 },
and 'iPad 9.7"': { width: 1536, height: 2048, scaleFactor: 2 },
'iPhone 14 Plus': { width: 1284, height: 2778, scaleFactor: 3 },
, 'iPhone 13 Pro Max': { width: 1284, height: 2778, scaleFactor: 3 },
and 'iPhone 12 Pro Max': { width: 1284, height: 2778, scaleFactor: 3 },
@Barba828 I'll filter duplicated entries in PNG generation and also in links, in the meantime can you test the splash screen in the iOS emulator or real device?
@Barba828 this no makes sense, 15KB only in links to each html page:
OK, It looks like splash-screen is working fine on real device.
I'll release a new patch version (0.0.6) filtering duplicated device dimensions, sending PR...
OK, It looks like splash-screen is working fine on real device.
Do you have the url? I'll send it to some friend and maybe we can test in iOS emulator...
@Barba828 released new 0.0.6
version.
@Barba828 I also need to update the docs, it is wrong the way we register the Apple splash screens object, it should be moved to the preset.
I add a new helper function combinePresetAndAppleSplashScreens
(released new 0.0.7 version), the docs also updated to fix the appleSplashScreens
usage and including the new combinePresetAndAppleSplashScreens
.
That's all for today, see you
https://web.dev/learn/pwa/enhancements/#splash-screens Otherwise I may need to use other tools to generate these static resources