symfony / stimulus-bridge

Stimulus integration bridge for Symfony projects
https://symfony.com/ux
75 stars 15 forks source link

Fixing sourceMap bug and adding "lazy" & "export" loader options #35

Closed weaverryan closed 3 years ago

weaverryan commented 3 years ago

Fixes #33 (except for lazy controllers... that would be more complex).

Hi!

This PR contains 2 parts:

1) The sourcemap problem described in #33 is fixed. Thanks to @Kocal for that - he had all the right details... they just needed to be in a slightly different place. We don't need this sourcemap trick in the actual loader.js because that is loading a controllers.json file - were not trying to map eventual errors to that file.

2) This adds the ability to add a ?lazy=true when using the lazy-controller-loader, allowing you to make 3rd party controllers lazy (though the syntax isn't super attractive). See the updated README.

I also tested this on a real project.

Cheers!

tgalopin commented 3 years ago

Thanks @weaverryan.