Fork me on GitHub
#hyperfiddle
<
2024-01-11
>
wei02:01:54

is there an example for the hyperfiddle.electric-ring-adapter that just landed?

1
joshcho05:01:09

i keep getting this error, on ic for electric-starter-app but on master for not

Exception in thread "main" clojure.lang.ArityException: Wrong number of args (1) passed to: app.electric-server-java8-jetty9/start-server!
	at clojure.lang.AFn.throwArity(AFn.java:429)
	at clojure.lang.AFn.invoke(AFn.java:32)
	at prod$_main.invokeStatic(prod.clj:13)
	at prod$_main.doInvoke(prod.clj:10)
	at clojure.lang.RestFn.invoke(RestFn.java:400)
	at clojure.lang.AFn.applyToHelper(AFn.java:152)
	at clojure.lang.RestFn.applyTo(RestFn.java:135)
	at prod.main(Unknown Source)

1
wei05:01:52

they added another arg to that function so check that you're calling it with two args, entrypoint and config

joshcho06:01:24

what's entrypoint?

joshcho06:01:08

trying to update to latest electric-starter-app

Geoffrey Gaillard10:01:30

Also see the https://clojurians.slack.com/archives/C7Q9GSHFV/p1704967833668529 for simpler entrypoints and simpler ring integration.

❤️ 1
Panel06:01:47

Can I embed an electric app inside a react / cljs spa ?

xificurC10:01:58

yes, you can mount electric on any dom node

Geoffrey Gaillard10:01:33

New Electric mvn release {:mvn/version "v2-alpha-540-ga4699532"}. This is a breaking release. • Simpler websocket integration – https://github.com/hyperfiddle/electric/blob/master/CHANGELOG.md#v2-alpha-540-ga4699532--2024-jan-10 ◦ Leverages Ring 1.11+ websocket support for simpler ring integration. ◦ Examples for https://github.com/hyperfiddle/electric-fiddle/blob/cf6134adb6aa0a4ae2f678961e54036f867cd4d4/src/electric_fiddle/server_jetty.clj#L15-L33 and https://github.com/hyperfiddle/electric-fiddle/blob/cf6134adb6aa0a4ae2f678961e54036f867cd4d4/src/electric_fiddle/server_httpkit.clj#L14-L39 • Incremental Compilation is included too – https://github.com/hyperfiddle/electric/blob/master/CHANGELOG.md#v2-alpha-536-g0c582f78--2024-jan-10 ◦ TL;DR: Electric used to compile the whole program at once, resulting in long recompilation times in dev mode. Your hot code reload should now be snappy again.

🔥 15
🎉 2
👍 1
Geoffrey Gaillard10:01:54

@U6D1FU8F2 This will answer your question from the above thread. Electric-starter-app is now deprecated in favor of https://github.com/hyperfiddle/electric-fiddle/

❤️ 1
Geoffrey Gaillard10:01:03

@U0GE6JTKK this is the ring release you’ve been waiting for

🙏 1
henrik10:01:25

@U2DART3HA I don’t think the initial IC release was announced in #C06MAR553, so maybe it’s a good opportunity for some promotion of the great work you do?

Geoffrey Gaillard11:01:36

Thank you simple_smile But let's wait for feedback a bit, and plan broader announcements as a team first ;)

joshcho11:01:19

thanks @U2DART3HA! what is the difference?

Geoffrey Gaillard12:01:43

The difference between electric-starter-app and electric-fiddle?

Vincent18:01:36

I will drop this into my deps.edn later on and let you know if I encounter any issues

denik18:01:51

new httpkit adapter works for me!

👍 1
joshcho00:01:29

@U2DART3HA yes! trying to determine if to migrate

Geoffrey Gaillard09:01:30

Electric Fiddle is the new, easier way to get started with Electric Clojure. We won’t update electric-starter-app anymore. It is worth migrating if • you plan to integrate updates from the our upstream repo • your project has not diverged that much from the starter app Migrating should not take long: • move your source code to src-fiddles/your-project • copy the structure from src-fiddles/hello-fiddle ◦ especially fiddles.cljc • add your extra deps under an alias in deps.edn • move your resources in resources • try to run in dev mode (see readme) • try to run in prod mode (see readme)

Geoffrey Gaillard07:01:40

Thank you for your feedback. User code go to src-fiddle, src contains electric-fiddle's source code.

👍 1
joshcho13:01:39

that feels not ergonomic imho. users will want to use src directory

joshcho13:01:21

for every other project i jump into src, but if it's different for electric fiddle it'll be highly confusing

Geoffrey Gaillard15:01:06

We acted on your feedback. src is now the default place to put user code into. Thank you 👍

🥳 1
🙌 2
grounded_sage09:01:11

I noticed a switch also to using npm install over yarn tbh I haven't really had much of a strong preference and started using yarn because thats what everyone else was doing. Is there a reason for the switch?

grounded_sage09:01:45

Also is the submodule folder / vendoring now not relevant and you are using deps to manage dependencies?

Geoffrey Gaillard10:01:06

The only reason we used yarn over npm install was because it’s faster. There was confusion over what yarn means, but there was no confusion over what npm install means. You can use either. Up to you. > is the submodule folder / vendoring now not relevant and you are using deps to manage dependencies? yes

❤️ 2