archtechx / airwire

A lightweight full-stack component layer that doesn't dictate your front-end framework
https://archte.ch/blog/introducing-airwire
MIT License
201 stars 9 forks source link

Build A Manifest File Instead Of Manual Component Registration #15

Open nickpoulos opened 3 years ago

nickpoulos commented 3 years ago

Really awesome project, can't wait to try this out in a more official capacity. Thank you for creating it.

But I did notice one thing that could be improved upon.

I mentioned in another comment I wrote a Laravel package for Svelte that has many similar problems to solve. My package compiles each Svelte component in your project into bite sized js file, and then loads that file automatically if you use the tag in blade.

So we need to map Blade HTML tags to these compiled JS files. You have to do the same for Blade tags and PHP files, as does Livewire.

I looked at several other projects as inspiration:

There are three main approaches here:

1. Having the user define these mappings in a ServiceProvider

2. Use a Naming Convention, Standard Locations, Etc.

3. Build A Manifest File Automatically

I would love to see Airwire use the manifest approach outlined above and remove that annoying middle step for the user.

Happy to help implement/submit a PR.

Have you considered this at all? See any downsides?