zoontek / react-native-bootsplash

๐Ÿš€ Show a splash screen during app startup. Hide it when you are ready.
MIT License
3.64k stars 253 forks source link

Unexpected XML comments removal and code prettification #631

Open demedos opened 6 hours ago

demedos commented 6 hours ago

Before submitting a new issue

Bug summary

Hi, first of all, thanks for all the hard work on this package! ๐Ÿ™Œ

I'm currently upgrading from version 4 to version 6 and noticed a few issues that might be worth addressing:

  1. XML Comments Removal:
    After the upgrade, I saw that comments in my XML files are being removed. This feels like a breaking change as it modifies the code beyond the expected scope of this package. It can potentially cause issues, especially for builds that rely on tools like Plop or custom scripts, which use comments as anchors to auto-generate content in specific parts of the code.

  2. Code Prettification:
    The code is being automatically prettified, which generates unnecessary and often unwanted diffs. This is a bit unexpected since the package should ideally only modify the parts of the code it needs to.

  3. Question about Assets:
    One thing I'm still trying to understand is, when generating for iOS and Android, whatโ€™s the reason for generating the assets/bootsplash files? Maybe Iโ€™m missing something obvious here! ๐Ÿ˜…

Thanks again for your time and help! Would love to get some clarity or improvements around this. ๐Ÿ˜Š

Library version

6.1.x

Environment info

System:
  OS: macOS 14.6.1
  CPU: (12) arm64 Apple M2 Pro
  Memory: 358.36 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.17.0
    path: /var/folders/03/y0ddfp013tng9zsw9_vbv15m0000gn/T/yarn--1727080227664-0.5818209195347468/node
  Yarn:
    version: 1.22.21
    path: /var/folders/03/y0ddfp013tng9zsw9_vbv15m0000gn/T/yarn--1727080227664-0.5818209195347468/yarn
  npm:
    version: 10.8.2
    path: ~/.nvm/versions/node/v20.17.0/bin/npm
  Watchman:
    version: 2024.08.19.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.14.3
    path: /Users/<username>/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.2
      - iOS 17.2
      - macOS 14.2
      - tvOS 17.2
      - watchOS 10.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2023.1 AI-231.9392.1.2311.11076708
  Xcode:
    version: 15.1/15C65
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.9
    path: /usr/bin/javac
  Ruby:
    version: 3.2.1
    path: /Users/<username>/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.9
    wanted: 0.73.9
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Steps to reproduce

Steps to reproduce:

  1. Before the upgrade (v4.5.2):

    • XML comments were retained in the files, preserving any annotations.
    • The package only modified the exact portions of the code it needed to, without affecting formatting.
    • No extra assets/bootsplash files were generated.
  2. After the upgrade (v6.1.x):

    • XML comments are now removed, which can break workflows relying on comments as anchors.
    • The code is being prettified automatically, causing unwanted diffs, in sections of code that werenโ€™t modified by the package.
    • Extra assets/bootsplash files are generated for both iOS and Android.

Reproducible sample code

react-native generate-bootsplash image.jpg
zoontek commented 6 hours ago

Because react-native-bootsplash now uses @expo/config-plugins instead of a custom RegExp based implementation.

The issue is in the expo package, you should open an issue on their repository instead.

For the 3., see https://github.com/zoontek/react-native-bootsplash/issues/629