josdejong / svelte-jsoneditor

A web-based tool to view, edit, format, repair, query, transform, and validate JSON
https://jsoneditoronline.org
Other
892 stars 108 forks source link

Svelte 5 support #452

Open chillenious opened 3 months ago

chillenious commented 3 months ago

I'm working on a project that uses svelte-jsoneditor. All is well when using the 4.x version of Svelte, but I tried using Svelte 5 today and there seems to be a problem with the svelte preprocessor:

✘ [ERROR] node_modules/svelte-jsoneditor/components/modals/TransformWizard.svelte:94:2 <tr> is invalid inside <table> [plugin vite-plugin-svelte:optimize-svelte]

    node_modules/svelte-jsoneditor/components/modals/TransformWizard.svelte:94:0:
      94 │
         ╵ ^

  The plugin "vite-plugin-svelte:optimize-svelte" was triggered by this import

    node_modules/svelte-jsoneditor/components/modals/TransformModal.svelte:21:28:
      21 │ import TransformWizard from './TransformWizard.svelte';
         ╵                             ~~~~~~~~~~~~~~~~~~~~~~~~~~

I'm not sure why the problem which seems to be triggered by the pre-processor only shows up with 5.

I created a simple project that shows the issue here: https://github.com/chillenious/svelte-jsoneditor-issue. Note that simply by changing the svelte to a 4.x dependency, the project will work again.

josdejong commented 3 months ago

The editor isn't yet ready for Svelte 5.

I did a short test recently trying to upgrade to Svelte 5. That gives some styling issues, the modals do not work (with a clear error), and a list of compiler warnings. It doesn't look that complicated to fix, but it will take time and requires extensive testing. Also, some of the dependencies, like svelte-awesome, is not yet supporting Svelte 5.

On a side note: Svelte 5 is not yet production ready, so it is good to prepare for it but we still need some patience :)

josdejong commented 1 month ago

See #476

There are quite some issues that need to get resolved. Any help would be welcome.