Giter Club home page Giter Club logo

airwire's People

Contributors

abrardev99 avatar lukinovec avatar shuvroroy avatar stancl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

airwire's Issues

Question - How to handle auth and policy related validations?

Hi there!

When I stumbled across Airwire, my developer-heart made a little jump of joy. This seems to be the library I've been thinking of so many times... Inertia.js seems to be too much, Livewire 'forces' me to use alpine (I know this aint completely true, but nevermind), but this library just does the wiring, and it lets me be in control of my js side and backend side. Awesome!

My current api-like controllers which can be seen as the soon-deprecated-pre-airwire-component-classes, always handle some business-like validation, and auth related validation. When something goes wrong on that endpoint, I return a 400 error or something, and that's it.

But.... How do we handle such cases in Airwire? To make things more specific:

  1. How do we handle Laravels policy validation in Airwire components?
  2. How do we handle authentication related validation in Airwire components?
  3. How do we handle custom business logic validation in Airwire components, and what should be returned when something goes wrong (the 400 status code)?

Thank you for reading and commenting :)

Bob

Port for PHP 7.4

I would like to work on porting it to php 7.4 . Is it possible to give a try or do airwire is constrained to php 8 ?

Build A Manifest File Instead Of Manual Component Registration

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:

  • Spatie's BladeX package (which serves as the foundation for Laravel's Blade Components)
  • Laravel's Blade Components
  • Livewire

There are three main approaches here:

1. Having the user define these mappings in a ServiceProvider

  • The approach Spatie Blade X and Airwire took
  • The easiest to implement, yet the most annoying for the user.

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

  • Laravel Blade Components basically took Spatie BladeX, but then added a naming convention on top
  • By prefixing an x- in front of the component name, and doing some Studly/Camel-case conversion, Laravel knows to check the /resources/views/components folder

3. Build A Manifest File Automatically

  • This is the approach Livewire takes, and the approach I stole for my package
  • The user doesn't have to define the components in a ServiceProvider
  • The package generates a manifest file that loads the component-to-tag mappings
  • Check out bootstrap/cache/livewire-components.php

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?

Demo

  • Vue demo
  • Alpine demo
  • Delete button
    • Report arg resolved from an id

Airwire with NextJS/React

Greetings,

I love the idea of this being a REST API Wrapper component based. Is It possible to use something like this with NextJS? Where the backend and the frontend might be in different servers?

Can you use Airwire with Svelte?

Hi,

I'm a big fan of Svelte, and Airwire looks interesting to me.

I'm not sure if I can use Airwire with Svelte, because Svelte outputs vanilla js.

Svelte is a radical new approach to building user interfaces. Whereas traditional frameworks like React and Vue do the bulk of their work in the browser, Svelte shifts that work into a compile step that happens when you build your app.

So, is it possible to combine those two?

Thanks! Jeroen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.