Commit graph

108 commits

Author SHA1 Message Date
Denis Donici
af0c4ccf82
Update installation instructions. Fix igniter installer (#210)
* format test config

* chore: changed name for store file

* updated vite in example project

* chore: fix manual install instructions

* chore: updated instructions and examples in readme

* chore: fix igniter installer

* chore: fix igniter installer tests. update guides
2026-04-10 00:49:29 +03:00
Denis Donici
49db23fd6f chore: added lodash as example dependency. fixed warnings. added svelte config 2026-03-19 12:43:32 -07:00
Denis Donici
6a53617b5e chore: mix format files 2026-03-19 12:43:32 -07:00
Denis Donici
c0c94fb9dc chore: adjust form json parser 2026-03-19 12:43:32 -07:00
Denis Donici
251b51b5eb update installer and documentation 2026-03-19 12:43:32 -07:00
Denis Donici
35e8870b05 chore: use phoenix_vite for live svelte 2026-03-19 12:43:32 -07:00
Denis Donici
80e3277a95 chore: improved docs. removed live json 2026-03-19 12:43:32 -07:00
Denis Donici
9c9c46e333 chore: add more igniter installer tests 2026-03-19 12:43:32 -07:00
Denis Donici
3c9c382c1e chore: improve igniter installer 2026-03-19 12:43:32 -07:00
Denis Donici
e57471bef8 chore: added igniter installer 2026-03-19 12:43:32 -07:00
Denis Donici
1a06275aa0 chore: prepare vite integration 2026-03-19 12:43:32 -07:00
Denis Donici
079ed517b7 chore: added ssr telemetry 2026-03-19 12:43:32 -07:00
Denis Donici
2a9c197c53 chore: added vite hmr 2026-03-19 12:43:32 -07:00
Denis Donici
4996a03a90 chore: added basic vite support 2026-03-19 12:43:32 -07:00
Denis Donici
84952ffa31 chore: add live form support via ecto changesets 2026-03-19 12:43:32 -07:00
Denis Donici
31d70eb934 chore: added support for streams 2026-03-19 12:43:32 -07:00
Denis Donici
5bd85b106a chore: added json patch for props diff 2026-03-19 12:43:32 -07:00
Denis Donici
9262a425be chore: added props diff 2026-03-19 12:43:32 -07:00
Denis Donici
2de7f6d733 chore: added svelte encoder 2026-03-19 12:43:32 -07:00
Denis Donici
5d526021dc chore: use typescript for LiveSvelte 2026-03-19 12:43:32 -07:00
Denis Donici
bfdae993c2
feat/add comprehensive e2e testing (#207)
* add an exmaple with a static svelte component in a live view parent with list

* adjusted the styling of example

* chore: added more e2e tests

* chore: preserve client state

* chore: added tests for simple counter

* chore: added live lights e2e tests

* chore: added sigil e2e tests

* chore: added plus/minus tests

* chore: added live plus/minus tests

* chore: added hybrid plus/minus tests

* chore: added static color demo tests

* fix: handle correctly v sigil props

* chore: added tests to log list example

* chore: added tests to breaking news example

* chore: added chat tests

* chore: added tests for live json

* chore: added tests for simple slots

* chore: added tests for dynamic slots. added missing test ids

* chore: add tests to client loading

* chore: addes tests to otp ecto example

* chore: prepare for 0.17.4 release
2026-02-18 21:30:17 +02:00
Denis Donici
553ea1e466
Upgrade example project. fix remounting Svelte component (#206)
* remove old link in example page. add real time for ecto example

* upgraded tailwind 4 and latest phoenix for example

* fixed svelte component remounting on server events

* generate auto ids for duplicate components

* handle static svelte components in live view parent properly

* prepare release 0.17.3 release

* adjust the live_svelte version in mix.exs
2026-02-08 13:47:39 +02:00
John Barker
2f5ecbc077
Fixes issue with slot warnings and use of slots when using LiveSvelte use macro (#196)
* Fixes issue with slot warnings and use of slots when using LiveSvelte. Components use macro
2026-02-02 23:19:33 +02:00
Denis Donici
6829effefd
Added better navigation between examples projects (#202)
* Added better navigation between examples projects. 
* Fix json date formatter
2026-02-01 00:14:15 +02:00
Denis Donici
1f9ebc49d2
Use OTP json encoder by default. Add support for custom json library. (#199)
* add support for custom json library besides jason

* use native erlang json encoder

* fixed json parsing.  added more json tests

* Prepare for 0.17.0 release
2026-01-22 11:51:00 +02:00
Wout De Puysseleir
649a99ab20 Edit warning message ssr + loading
Co-authored-by: Dave Lucia <dave@tvlabs.ai>
2025-04-18 09:58:38 -07:00
Wout De Puysseleir
640dd6eaea Add warning if ssr and loading slot is being used together 2025-04-18 09:58:38 -07:00
Dave Lucia
a3615e4971 feat: <:loading /> slot for server-rendered markup
Adds a new slot called `<:loading />` that allows a user to server
render markup to display while waiting for the Svelte component to mount
on the client.

This is useful if you want to display default markup to prevent the page
from jumping once the client mounts, or to indicate to the user that
something is loading.

- [ ] Integrate with front-end and ensure it is removed after loading
- and through updates
- [ ] Consider raising if you have `ssr: true`
- [ ] Update documentation
- [ ] Add tests

Closes #166
2025-04-18 09:58:38 -07:00
Dave Lucia
1daeb15377 fix: clarify socket documentation 2025-04-18 09:14:08 -07:00
Dave Lucia
2af76315bc fix: use Phoenix for formatting attr and other macros 2025-04-18 09:07:02 -07:00
Dave Lucia
99a36b5567 fix: broken docs header
Moved the readme docs into the `LiveSvelte` page, cleaned it up a little bit. Upgraded `ex_doc`

More work to be done but this looks much nicer.
2025-04-18 08:56:25 -07:00
Wout De Puysseleir
39af7d9ba1 Add named slots example 2025-02-05 13:01:10 -08:00
Wout De Puysseleir
0d754ff169 Svelte 5 support
- LiveJson stopped working
- Experimental slots stopped working
2025-02-05 13:01:10 -08:00
Wout De Puysseleir
97ed1361b7
Don't pin esbuild to 0.16.17 in setup script 2024-11-19 09:15:06 -08:00
Wout De Puysseleir
0376277d36
Add option to disable ssr globally in config 2024-09-25 11:23:48 -07:00
Dave Lucia
00f0ae4727 Fix type issue with exception
```elixir
Compiling 11 files (.ex)
    warning: unknown key .message in expression:

        err.message

    where "err" was given the type:

        # type: %{..., __exception__: true, __struct__: atom()}
        # from: lib/mix/tasks/configure_phoenix.ex:21
        rescue err ->

    hint: when you rescue without specifying exception names, the variable is assigned a type of a struct but all of its fields are unknown. If you are trying to access an exception's :message key, either specify the exception names or use `Exception.message/1`.

    typing violation found at:
    │
 21 │       err -> log_error(err.message)
    │                            ~~~~~~~
    │
    └─ lib/mix/tasks/configure_phoenix.ex:21:28: Mix.Tasks.LiveSvelte.ConfigurePhoenix.run/1
```
2024-09-19 09:59:46 -07:00
Anthony Accomazzo
a7bc1af475 Raise when Jason.encode/1 fails on props
When passing in props that fails to Jason.encode, raise. (Prior behavior was to fail silently.)
2024-04-12 12:30:35 -05:00
Wout De Puysseleir
7f5433b897
Run formatter 2024-01-17 12:22:12 -08:00
drKreso
e51cc188bb properly encode server components 2024-01-11 13:14:06 -08:00
Tony Dang
f76ace0654 refactor task run code 2023-11-26 14:31:56 -08:00
Tony Dang
5e1b3fa33b run setup tasks synchronously 2023-11-26 14:31:56 -08:00
Tony Dang
c099c227cf explicitly set npm install folder 2023-11-24 11:02:07 -08:00
Douglas Vought
1119f41cb2 Generalize SSR.NotConfigured exception 2023-09-25 14:48:11 -07:00
Douglas Vought
df7b4b8935 Make necessary changes in example project and mix task 2023-09-25 14:48:11 -07:00
Douglas Vought
226d6e69da Implement SSR behaviour
To facilitate the creation of alternative SSR behaviours, the
the implementation-specific code is relocated into its own module.
This is backwards compatible, but will emit a deprecation warning.
There are also some basic tests to verify that we default to NodeJS for
backwards compatibility.
2023-09-25 14:48:11 -07:00
Dmitrii Maganov
6cb9ce7c77 Add socket prop to skip ssr for live mounts and navigation 2023-08-19 18:20:38 -07:00
Wout De Puysseleir
b4a908b0ba
Use assigns. instead of Map.get 2023-08-15 17:22:34 -07:00
Dmitrii Maganov
9074a93043
Replace render/exportSvelteComponents with getRender 2023-08-08 12:18:02 -07:00
Wout De Puysseleir
2ebc4c5d74
Add gitignore generator for live_svelte.setup 2023-08-08 10:22:43 -07:00
Dmitrii Maganov
26cdfb462f
Move ssr build from priv/static/assets into priv/svelte 2023-08-08 10:20:20 -07:00