Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v3] Blade component #62

Merged
merged 13 commits into from
Dec 1, 2020
Merged

[v3] Blade component #62

merged 13 commits into from
Dec 1, 2020

Conversation

Elhebert
Copy link
Owner

@Elhebert Elhebert commented Sep 10, 2020

I finally found some time to draft a PR for the blade component.

For more details check #57

It's a first draft, but here's what the API could look like. This would simplify the usage of the package.

<x:sri.script src="/public/js/app.js" />
<!-- <script src="{{ asset("/public/js/app.js") }}" integrity= "..." /> -->

<x:sri.script.mix src="/public/js/app.js />
<!-- <script src="{{ mix("/public/js/app.js") }}"  integrity= "..." /> -->

<x:sri.link href="/public/css/app.css" rel="stylesheet" />
<!-- <link href="{{ asset("/public/css/app.css") }} rel="stylesheet"  integrity= "..." /> -->

<x:sri.link.mix href="/public/css/app.css" rel="stylesheet" />
<!-- <link href="{{ mix("/public/css/app.css") }} rel="stylesheet"  integrity= "..." /> -->

@Elhebert Elhebert mentioned this pull request Sep 10, 2020
@Elhebert
Copy link
Owner Author

Just added basic tests and cleaned up after removing the blade directive.
I also updated the API a little bit and moved the mix part as an attribute to you have the same component for asset and mix which is less maintenance 🤔

<x:sri.script src="/public/js/app.js" />
<!-- <script src="{{ asset("/public/js/app.js") }}" integrity= "..." /> -->

<x:sri.script src="/public/js/app.js" mix />
<!-- <script src="{{ mix("/public/js/app.js") }}" integrity= "..." /> -->

<x:sri.link href="/public/css/app.css" rel="stylesheet" />
<!-- <link href="{{ asset("/public/css/app.css") }} rel="stylesheet"  integrity= "..." /> -->

<x:sri.link href="/public/css/app.css" rel="stylesheet" mix />
<!-- <link href="{{ mix("/public/css/app.css") }} rel="stylesheet"  integrity= "..." /> -->

@Elhebert
Copy link
Owner Author

I decided to drop Laravel 7 support. I had to many issues with the tests.

I also added a @once directive around the component to never re-render the component more than once.

@Elhebert Elhebert mentioned this pull request Dec 1, 2020
@Elhebert Elhebert marked this pull request as ready for review December 1, 2020 08:50
@Elhebert Elhebert merged commit 0b39107 into master Dec 1, 2020
@Elhebert Elhebert deleted the blade-component branch December 1, 2020 08:51
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.

2 participants