Skip to content

feat: support Vite 6 and update deps#770

Merged
Akryum merged 27 commits intomainfrom
support-vite-6
Jan 8, 2025
Merged

feat: support Vite 6 and update deps#770
Akryum merged 27 commits intomainfrom
support-vite-6

Conversation

@hugoattal
Copy link
Collaborator

@hugoattal hugoattal commented Nov 26, 2024

Description

Fix #769

Additional context

  • Update all dependencies and fix new versions breaking changes
  • Remove Vue2 support (reached EOL a year ago)
  • I kept the (very) old versions of vitest and vite-node, because I could not make it work with the newer version...

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

@hugoattal hugoattal self-assigned this Nov 26, 2024
@bolt-new-by-stackblitz
Copy link

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

@codesandbox
Copy link

codesandbox bot commented Nov 26, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@netlify
Copy link

netlify bot commented Nov 26, 2024

Deploy Preview for histoire-examples-svelte3 failed.

Name Link
🔨 Latest commit 7f4a2ab
🔍 Latest deploy log https://app.netlify.com/sites/histoire-examples-svelte3/deploys/6766bbf998b57600082d31a9

@netlify
Copy link

netlify bot commented Nov 26, 2024

Deploy Preview for histoire-examples-vue3 failed.

Name Link
🔨 Latest commit 7f4a2ab
🔍 Latest deploy log https://app.netlify.com/sites/histoire-examples-vue3/deploys/6766bbf9a1617a0008ea950c

@netlify
Copy link

netlify bot commented Nov 26, 2024

Deploy Preview for histoire-site failed.

Name Link
🔨 Latest commit 7f4a2ab
🔍 Latest deploy log https://app.netlify.com/sites/histoire-site/deploys/6766bbf948515d00080be620

@netlify
Copy link

netlify bot commented Nov 26, 2024

Deploy Preview for histoire-controls failed.

Name Link
🔨 Latest commit 7f4a2ab
🔍 Latest deploy log https://app.netlify.com/sites/histoire-controls/deploys/6766bbf99a68dd0008ce2644

@hugoattal hugoattal changed the title Upgrade dependencies WIP Update to Vite 6 Nov 26, 2024
@hugoattal hugoattal changed the title WIP Update to Vite 6 [WIP] Update to Vite 6 Nov 26, 2024
@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 26, 2024

Open in Stackblitz

histoire

npm i https://pkg.pr.new/histoire-dev/histoire@770

@histoire/app

npm i https://pkg.pr.new/histoire-dev/histoire/@histoire/app@770

@histoire/plugin-nuxt

npm i https://pkg.pr.new/histoire-dev/histoire/@histoire/plugin-nuxt@770

@histoire/plugin-percy

npm i https://pkg.pr.new/histoire-dev/histoire/@histoire/plugin-percy@770

@histoire/controls

npm i https://pkg.pr.new/histoire-dev/histoire/@histoire/controls@770

@histoire/plugin-screenshot

npm i https://pkg.pr.new/histoire-dev/histoire/@histoire/plugin-screenshot@770

@histoire/plugin-svelte

npm i https://pkg.pr.new/histoire-dev/histoire/@histoire/plugin-svelte@770

@histoire/plugin-vue

npm i https://pkg.pr.new/histoire-dev/histoire/@histoire/plugin-vue@770

@histoire/shared

npm i https://pkg.pr.new/histoire-dev/histoire/@histoire/shared@770

@histoire/vendors

npm i https://pkg.pr.new/histoire-dev/histoire/@histoire/vendors@770

commit: 7f4a2ab

@hugoattal hugoattal changed the title [WIP] Update to Vite 6 feat: support Vite 6 Nov 27, 2024
@hugoattal hugoattal mentioned this pull request Dec 10, 2024
4 tasks
josecelano added a commit to torrust/torrust-website that referenced this pull request Dec 13, 2024
3f22176 remove story:build from workflows (Graeme Byrne)
76d7665 fix readingTime error (Graeme Byrne)
eb96c60 fix linting errors (Graeme Byrne)
7b33824 migrate to svelte 5 and update dependencies (Graeme Byrne)

Pull request description:

  * Migrate from Svelte 4 to Svelte 5 as mentioned in this [issue](#106).
  * Update dependencies in `package.json` such as Vite which were preventing the successful migration to Svelte 5.
  * Upgrade ESLint to v9 as v8 has recently reached end of life and is no longer maintained, as mentioned [here](https://eslint.org/docs/latest/use/migrate-to-9.0.0).
  * Upgrade Sass as current syntax is deprecated as mentioned [here](https://sass-lang.com/documentation/breaking-changes/legacy-js-api/)
  * Remove `/contributors` route as it is redundant since we now display GitHub contributors on home page and on Community page. Existing individual contributor pages have been retained and are accessible by clicking on the author's name in the blog post.
  * Remove Histoire as it doesn't support Vite at the minute. There is currently a [PR](histoire-dev/histoire#770) open to fix this, so Histoire can be added back later if needed.
  * When navigating to a new page, the site wouldn't scroll up to the top as would be expected. As found [here](sveltejs/kit#8723), this seems to be a Svelte issue. Solve this by adding the below code to the script block of routes/+layout.svelte and bind to page content:

  ```
  import { onNavigate } from '$app/navigation';
  let contentDiv: HTMLElement | null = null;

  onNavigate((navigation) => {
      return new Promise((resolve) => {
  const transition = document.startViewTransition(async () => {
  if (contentDiv) {
  // Fix scroll
  contentDiv.scrollTop = 0;
  }
  resolve();
  await navigation.complete;
  });
      });
  });

  ...

  <div id="app-container">
      <Header />
      <div bind:this={contentDiv} class="content">
  {@render children?.()}
  <Footer />
      </div>
  </div>
  ```

ACKs for top commit:
  josecelano:
    ACK 3f22176

Tree-SHA512: 09e1042539a441e581eb8cfd759454ac675971acfbf2a0c3fa9eb74693270add836ac2e4864077e09cf29d4cb3be4d232c0dab607685e3f813e2548504ba9cef
@hugoattal
Copy link
Collaborator Author

hugoattal commented Dec 21, 2024

Everything's working for Vue 🥳 !

I'm trying to fix the bugs for Svelte and Nuxt before releasing this.

It might be best to update Svelte and Nuxt to their latest versions, but I've got next to no knowledge of these frameworks. I guess it should happen in another PR.

@Akryum
Copy link
Member

Akryum commented Jan 1, 2025

Yeah it's already pretty big, let's do that in separate PRs

@Akryum Akryum marked this pull request as ready for review January 1, 2025 13:30
@hugoattal
Copy link
Collaborator Author

@Akryum I admit, I'm a bit stuck with the Svelte/Nuxt fix, and I'm not sure I'll have a lot of time in the upcoming days... Feel free to do anything you want on the PR!

Btw, I think this should be a new major version of Histoire considering all the changes.
(And maybe delay the support of Svelte/Nuxt to another PR?)


About Svelte 5

On a side note, I also tried to make it work with the next version of Svelte without success yet. The compiled component included some "internal" imports, which resulted in this error when trying to launch the svelte example:

Imports of `svelte/internal/*` are forbidden. It contains private runtime code which is subject to change without notice. If you're importing from `svelte/internal/*` to work around a limitation of Svelte, please open an issue at https://github.com/sveltejs/svelte and explain your use case
https://svelte.dev/e/import_svelte_internal_forbidden

Not quite sure how to fix this...

@Akryum Akryum changed the title feat: support Vite 6 feat: support Vite 6 and update deps Jan 8, 2025
@Akryum Akryum merged commit 40c16f2 into main Jan 8, 2025
@Akryum Akryum deleted the support-vite-6 branch January 8, 2025 12:15
@voxpelli
Copy link

Maybe do a prerelease of the next major while Svelte/Nuxt support is being worked on? That way the Vue + Vite 6 can be tried out and verified by the community in the meanwhile :)

@hugoattal
Copy link
Collaborator Author

@Akryum Wdyt? Could you publish an alpha version? Like v0.18.0-alpha.1 or v1.0.0-alpha.1?

@Akryum
Copy link
Member

Akryum commented Jan 10, 2025

Yes it's gonna be a big release so prerelases make sense

@Akryum
Copy link
Member

Akryum commented Jan 10, 2025

BTW, you don't have to wait for the release to try it out as Histoire has automatic releases.

hexorx pushed a commit to hexorx/histoire that referenced this pull request Jun 26, 2025
* Upgrade dependencies

* Use ESM vite

* fix chokidar glob

* Use micromatch instead of minimatch

* Remove optimizeDeps on vite server

* Fix markdown watcher

* Update artifact version

* Fix import

* Make plugins mjs

* Migrate from vite-node to vite runtime

* Revert "Migrate from vite-node to vite runtime"

This reverts commit 4e19240.

* Try to trigger some tests

* fix minimatch import

* Lint everything

* Update file path handling

* Revert vite-node version

* revert vitest version

* fix cypress lint error

* Fix lint

* hopefully last lint fix...

* please be the last lint fix

* sigh...

* Revert some version to make svelte compile

* Fix nuxt build

* Replace flexsearch with fuse

* Fix typescript erro

* Fix lint
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.

Update to Vite 6

3 participants