Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR changes the filename of Ziggy's main 'entrypoint' from
route.js
toindex.js
.This has one major benefit, which is that it makes exporting more things easier—particularly from the NPM package. For example, after this PR we could add and export a React Hook and using it would be as simple as
import route, { useRoute } from 'ziggy-js'
.Two additional upsides to this change are that the complete import filepath gets shorter for anyone using it, since
import route from './vendor/tightenco/ziggy/dist'
now works, and it's clearer where Ziggy's exports are and might make a tad more sense to newcomers since there's now anindex.js
file, which is pretty standard for Javascript.The diff looks gnarly but the Javascript source didn't actually change at all, it just moved around.
Unrelated:
_query
key I added was being mangled in the built assets.var
withconst
andlet
.