Skip to content

Fix vite 8 building a broken frontend#4242

Merged
ildyria merged 3 commits intomasterfrom
fix-v8
Mar 29, 2026
Merged

Fix vite 8 building a broken frontend#4242
ildyria merged 3 commits intomasterfrom
fix-v8

Conversation

@ildyria
Copy link
Copy Markdown
Member

@ildyria ildyria commented Mar 29, 2026

Summary by CodeRabbit

Release Notes

  • Refactor

    • Reimplemented photo clustering layer functionality to improve application performance and maintainability of photo display features.
  • Style

    • Enhanced visual styling of photo markers on maps, including improved borders, shadows, and marker appearance.
  • Chores

    • Removed external photo library dependency, reducing overall package size and simplifying project dependencies.

@ildyria ildyria requested a review from a team as a code owner March 29, 2026 14:16
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 29, 2026

📝 Walkthrough

Walkthrough

The pull request removes the @lychee-org/leaflet.photo npm dependency and replaces its functionality with a custom implementation. A new PhotosLayer and Cluster class are introduced in a composable, integrated into the gallery map component, and build tooling is updated to support Leaflet globals and adjust code-splitting strategy.

Changes

Cohort / File(s) Summary
Dependency Removal
package.json, resources/sass/app.css
Removed @lychee-org/leaflet.photo from runtime dependencies and eliminated its global CSS import.
Custom Photo Layer Implementation
resources/js/composables/photo.ts
Added new PhotosLayer class extending L.FeatureGroup for rendering photo thumbnails as markers, and Cluster class extending L.MarkerClusterGroup with custom clustering behavior. Exported factory functions photosLayerFunc and clusterFunc.
Integration Updates
resources/js/services/sidebar-map.ts, resources/js/views/gallery-panels/Map.vue
Removed external library imports and switched photo cluster creation to use the new clusterFunc implementation. Added component-scoped CSS for photo marker styling.
Build Configuration
vite.config.ts
Introduced leafletGlobalPlugin to inject Leaflet imports at build time for specified packages, and refactored rollup chunking to use code-splitting configuration for PrimeVue modules.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 A custom nest we've woven bright,
No more external deps in sight!
Our photo clusters hop with glee,
Built from scratch, as they should be! 🌿✨

🚥 Pre-merge checks | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
vite.config.ts (1)

125-133: Remove commented-out dead code.

The commented-out manualChunks block should be removed rather than left in the codebase. If you need to restore chunking behavior, the fix above provides a working implementation.

resources/js/composables/photo.ts (1)

1-1: Consider scoping the eslint-disable more narrowly.

A blanket @typescript-eslint/no-explicit-any disable for the entire file is broad. Consider using inline // eslint-disable-next-line comments only where necessary, or defining proper types/interfaces for the photo and options parameters to improve maintainability.

resources/js/views/gallery-panels/Map.vue (1)

131-132: The @ts-expect-error comment may no longer be needed.

Since clusterFunc() is now a typed function from your own codebase (rather than an untyped L.photo.cluster()), this suppression comment might be removable. Verify if TypeScript still complains after removing it.

♻️ Proposed fix
-	// `@ts-expect-error` Leaflet.Photo is not typed
 	photoLayer.value = clusterFunc().on("click", function (e: MapClickEvent) {

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4fa49a20-1268-4375-9d6f-07414cd8984f

📥 Commits

Reviewing files that changed from the base of the PR and between 3ca189f and d2bf5e4.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (6)
  • package.json
  • resources/js/composables/photo.ts
  • resources/js/services/sidebar-map.ts
  • resources/js/views/gallery-panels/Map.vue
  • resources/sass/app.css
  • vite.config.ts
💤 Files with no reviewable changes (3)
  • resources/js/services/sidebar-map.ts
  • package.json
  • resources/sass/app.css

Comment thread resources/js/composables/photo.ts
@ildyria ildyria merged commit cd06696 into master Mar 29, 2026
45 checks passed
@ildyria ildyria deleted the fix-v8 branch March 29, 2026 15:31
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.

1 participant