Skip to content

⚡ Optimize scrollama imports and remove synchronous require#109

Draft
bovas85 wants to merge 1 commit intomasterfrom
perf-optimize-scrollama-imports-13008397598500477285-11140344346415582701
Draft

⚡ Optimize scrollama imports and remove synchronous require#109
bovas85 wants to merge 1 commit intomasterfrom
perf-optimize-scrollama-imports-13008397598500477285-11140344346415582701

Conversation

@bovas85
Copy link
Copy Markdown
Owner

@bovas85 bovas85 commented Mar 30, 2026

💡 What:

Removed a synchronous require('scrollama') from a computed property in pages/private/index.vue and replaced it with a top-level import. Additionally, cleaned up multiple redundant scrollama imports across the main page components (pages/index.vue, pages/_work/index.vue, pages/marketing/index.vue, and pages/private/index.vue).

🎯 Why:

  1. Performance: Synchronous require inside a computed property is inefficient as it can be called multiple times and bypasses some bundler optimizations.
  2. Correctness: The redundant imports were causing ESLint "Identifier has already been declared" errors and failing the production build.
  3. Consistency: Standardizes how scrollama is imported and used across the project.

📊 Measured Improvement:

  • Build Success: The project now builds successfully (yarn build), whereas it previously failed due to syntax errors.
  • Linting: Passed yarn lint after fixing the redeclaration errors.
  • Efficiency: Reduced redundant module lookups by consolidating imports at the top level. Although the direct CPU/Memory impact of a single require is small, cleaning up the cluttered imports and removing the reactive dependency on a required module improves code quality and bundler efficiency.

PR created automatically by Jules for task 11140344346415582701 started by @bovas85

- Replace synchronous `require('scrollama')` in computed property with top-level ES import in `pages/private/index.vue`.
- Remove redundant duplicate `scrollama` imports in `pages/index.vue`, `pages/_work/index.vue`, `pages/marketing/index.vue`, and `pages/private/index.vue`.
- Fix build and lint errors caused by identifier redeclaration.
- Guard browser-specific `scrollama` usage with `process.client` / `process.browser` as per Nuxt best practices.

Co-authored-by: bovas85 <16958684+bovas85@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 30, 2026

Deploy Preview for nunziellasalluce ready!

Name Link
🔨 Latest commit 51888ca
🔍 Latest deploy log https://app.netlify.com/projects/nunziellasalluce/deploys/69ca9f1ffd83f40008ac78ca
😎 Deploy Preview https://deploy-preview-109--nunziellasalluce.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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