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

Make Acorn work with Mix's manifest #13

Merged
merged 5 commits into from
May 14, 2019
Merged

Make Acorn work with Mix's manifest #13

merged 5 commits into from
May 14, 2019

Conversation

Log1x
Copy link
Sponsor Member

@Log1x Log1x commented May 9, 2019

This adds support for Mix's manifest which requires the path to be prepended with /.

When fetching the local path, I made use of Str::before() to strip ?id=X thus making it functional with Mix's built in .version() as well as plugins such as laravel-mix-versionhash which handle hashing via the filename instead of a query string.

@Log1x
Copy link
Sponsor Member Author

Log1x commented May 11, 2019

Hm. This ends up being problematic as the slash is stripped in scenarios where the asset you're targeting isn't inside of the Manifest..

To be honest, I'm not entirely sure how you want to handle this in the long-run @QWp6t – I know the todo's mention you reworking the Manifest/Asset classes a bit.

Otherwise, when returning the URI I'd need to check for a slash otherwise adding one so non-versioned assets would still ultimately return the proper URL.

kellymears and others added 3 commits May 12, 2019 19:27
Adds registration to Acorn application; calls from bootstrap.

With this change configurable service providers are successfully registered and booted based on the `providers` inventory in `config/app.php`.

closes #14
Fix failing tests
Add test for manifest path and URI with query string
Change main.js/css to app.js/css in tests
Add missing trailing space to ! in conditionals (PSR-1)
@Log1x
Copy link
Sponsor Member Author

Log1x commented May 14, 2019

Alright.

  • Fixed missing prepended slash for URI on files that do not exist in the manifest
  • Fixed failing tests
  • Added tests for manifest path and URI with query string
  • Changed main.js/css to app.js/css in tests to reflect Sage 10
  • Added missing trailing space to ! in a couple conditionals that were missing it

Can't say I'm 100% happy with the Asset class, but it's more or less about as clean as I can see it getting at the moment while keeping the ability to support filename revving as well as query strings.

Still cleaner than Laravel's official mix() function imo.

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.

None yet

3 participants