Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Stimulus] Fasten lazy loading + add debug lazy:loading and lazy:loaded #2463

Merged
Kocal merged 1 commit into
symfony:2.xfrom
smnandre:stimulus/lazy-loader
Jan 16, 2025
Merged

[Stimulus] Fasten lazy loading + add debug lazy:loading and lazy:loaded #2463
Kocal merged 1 commit into
symfony:2.xfrom
smnandre:stimulus/lazy-loader

Conversation

@smnandre
Copy link
Copy Markdown
Member

Q A
Bug fix? no
New feature? yes
Issues Fix #...
License MIT

This PR..

  1. improves the controller lazy loading by tuning algorithm (early exit, remove await, ...)

  2. introduces two new debug events in the console to ease DX with lazy controllers

    • my-controller#lazy:loading when the lazy controller is detected in the DOM
    • my-controller#lazy:loaded after the file has been downloaded and imported

I would really like some feedback / tests IRL (especially with Webpack i'm not used to)

@carsonbot carsonbot added Feature New Feature Status: Needs Review Needs to be reviewed labels Dec 22, 2024
@smnandre smnandre requested review from Kocal and kbond December 22, 2024 02:40
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 22, 2024

📊 Packages dist files size difference

ℹ️ No difference in dist packagesFiles.

@Kocal
Copy link
Copy Markdown
Member

Kocal commented Dec 22, 2024

I would really like some feedback / tests IRL (especially with Webpack i'm not used to)

I will try to find some time to rebuild a Symfony + Encore app, but by reading your changes it looks fine to me (feel free to reping me if necessary)

@smnandre
Copy link
Copy Markdown
Member Author

@MatTheCat ? 👼

@Kocal
Copy link
Copy Markdown
Member

Kocal commented Dec 22, 2024

I'm testing

@Kocal
Copy link
Copy Markdown
Member

Kocal commented Dec 22, 2024

Well... I've just realized, but to use Stimulus in a Symfony App with Webpack Encore, we use the https://github.com/symfony/stimulus-bridge ... which is not in this repository (and so not modified by this PR) 😅

@carsonbot carsonbot added Status: Reviewed Has been reviewed by a maintainer and removed Status: Needs Review Needs to be reviewed labels Dec 22, 2024
@smnandre
Copy link
Copy Markdown
Member Author

Well.... let me tell you i have no intention of coding in the Bridge hahaha

(i'll have a look but the lazy loading is done differently if i remember correctly)

@MatTheCat
Copy link
Copy Markdown
Contributor

I’ve got nothing to test then? 🤔

@smnandre smnandre requested review from kbond and removed request for kbond January 16, 2025 00:17
@carsonbot carsonbot added Status: Needs Review Needs to be reviewed and removed Status: Reviewed Has been reviewed by a maintainer labels Jan 16, 2025
@Kocal Kocal force-pushed the stimulus/lazy-loader branch from 0e5abca to 3b8e1ce Compare January 16, 2025 21:55
@Kocal
Copy link
Copy Markdown
Member

Kocal commented Jan 16, 2025

Thanks Simon.

@Kocal Kocal merged commit f1b645e into symfony:2.x Jan 16, 2025
@Kocal Kocal deleted the stimulus/lazy-loader branch February 23, 2026 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants