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

fix(nuxt): load spaLoadingTemplate if file exists #23048

Merged
merged 7 commits into from Sep 11, 2023

Conversation

davidglezz
Copy link
Contributor

@davidglezz davidglezz commented Sep 6, 2023

πŸ”— Linked issue

resolves #23047

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

The behavior is not the same as documented because was changed in #22798

This PR restores the loading of ~/app/spa-loading-template.html when spaLoadingTemplate is true

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@stackblitz
Copy link

stackblitz bot commented Sep 6, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Member

Whoops - thank you ❀️

Signed-off-by: davidglezz <davidg@empathy.co>
Signed-off-by: davidglezz <davidg@empathy.co>
Signed-off-by: davidglezz <davidg@empathy.co>
*
* Some good sources for spinners are [SpinKit](https://github.com/tobiasahlin/SpinKit) or [SVG Spinners](https://icones.js.org/collection/svg-spinners).
*
* @example ~/app/spa-loading-template.html
* ```html
* <!-- https://github.com/barelyhuman/snips/blob/dev/pages/css-loader.md -->
* <!-- https://gist.github.com/davidglezz/85a2e6185edbd0873a5a2bdb2ce1cd36 -->
Copy link
Member

@danielroe danielroe Sep 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep the original credit + loader:

Suggested change
* <!-- https://gist.github.com/davidglezz/85a2e6185edbd0873a5a2bdb2ce1cd36 -->
* <!-- https://github.com/barelyhuman/snips/blob/dev/pages/css-loader.md -->

@@ -415,3 +402,24 @@ export async function initNitro (nuxt: Nuxt & { _nitro?: Nitro }) {
function relativeWithDot (from: string, to: string) {
return relative(from, to).replace(/^([^.])/, './$1') || '.'
}

function spaLoadingTemplate (options: Nuxt['options']) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally minor point, but let's take nuxt as the argument, for consistency with other code.

@danielroe
Copy link
Member

danielroe commented Sep 11, 2023

Thank you for your great work on this PR ❀️

Pushed directly so we can include in today's patch release.

@danielroe danielroe changed the title fix: allow load spaLoadingTemplate from default location fix(nuxt): load spaLoadingTemplate from default location when set to true Sep 11, 2023
@danielroe danielroe changed the title fix(nuxt): load spaLoadingTemplate from default location when set to true fix(nuxt): load spaLoadingTemplate if file exists Sep 11, 2023
@danielroe danielroe merged commit 28af761 into nuxt:main Sep 11, 2023
26 checks passed
@github-actions github-actions bot mentioned this pull request Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix(nuxt): allow load default spa loading indicator
2 participants