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

sci boxes #91

Merged
merged 6 commits into from
May 26, 2020
Merged

sci boxes #91

merged 6 commits into from
May 26, 2020

Conversation

tomisme
Copy link
Contributor

@tomisme tomisme commented May 25, 2020

An experiment in connecting mini SCI environments

Let's say you could put executable code in Athens' blocks.

Some questions:

  • In what order do we evaluate our blocks?
  • How do we pass data in and out of our blocks?
  • How do we handle async code?

Attempted approach:

  • Blocks are passed the evaluated result of their parent (*1)

Some other approaches:

  • Blocks inherit the environment of their parent
  • Blocks mutate a global environment
  • Blocks are babashka pods?

Fun stuff to try:

  • Pass in the datascript connection
  • spit/slurp to IPFS etc.

@tomisme
Copy link
Contributor Author

tomisme commented May 25, 2020

image

@tomisme
Copy link
Contributor Author

tomisme commented May 25, 2020

Totally understand if folks aren't sold on devcards, or think experiments like this should be in a separate project / codebase 😄

Copy link
Contributor

@jeroenvandijk jeroenvandijk left a comment

Choose a reason for hiding this comment

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

Really cool @tomisme! Given your questions in the PR, would you like to merge or are you still working on this?

src/cljs/athens_devcards/db.cljs Outdated Show resolved Hide resolved
src/cljs/athens_devcards/sci_boxes.cljs Outdated Show resolved Hide resolved
(ns athens.devcards.sci-boxes
(:require
[cljsjs.react]
[cljsjs.react.dom]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure why these react imports are necessary but I get "React is not defined" when they're not there

@tomisme
Copy link
Contributor Author

tomisme commented May 26, 2020

Really cool @tomisme! Given your questions in the PR, would you like to merge or are you still working on this?

Happy to merge, I won't be able to do any more work on it for a little while. That way others can play around with it :)

Should I squash/rebase my commits first? Or can it be done automatically with github's PRs?

@tangjeff0
Copy link
Collaborator

tangjeff0 commented May 26, 2020

It can be done on GH @tomisme. Just share the final commit here and @jeroenvandijk or I will copy it in. :)

Or we can squash directly!

@tomisme
Copy link
Contributor Author

tomisme commented May 26, 2020

It can be done on GH @tomisme. Just share the final commit here and @jeroenvandijk or I will copy it in. :)

Or we can squash directly!

Excellent. Yeah I think that's the last of it, ready when you are :)

@tangjeff0
Copy link
Collaborator

I'll let @jeroenvandijk finish the PR because he reviewed already and he's been working with sci more closely. To respond to your comment @tomisme , though, the reason you need to require

[cljsjs.react]
[cljsjs.react.dom]

is because React needs to be shimmed when using shadow-cljs @tomisme. See bhauman/devcards#156

@jeroenvandijk jeroenvandijk self-requested a review May 26, 2020 15:53
Copy link
Contributor

@jeroenvandijk jeroenvandijk left a comment

Choose a reason for hiding this comment

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

Thanks @tomisme !

For others, how to get it running:

lein devcards
http://localhost:3001/cards.html

@jeroenvandijk jeroenvandijk merged commit d0d2ce5 into athensresearch:master May 26, 2020
@tangjeff0
Copy link
Collaborator

http://localhost:3001/cards.html doesn't work for me. I have to open the file from my filesystem, e.g. file:///athens/public/cards.html#!/athens.devcards.block

Nothing even runs on localhost:3001, my build runs on localhost:3000 still. Thoughts? @jeroenvandijk @tomisme

@tomisme
Copy link
Contributor Author

tomisme commented May 29, 2020

Anything at localhost:3000/cards.html?

@avichalp
Copy link

For me, It is available on localhost:3000.

@tangjeff0: You can also start a separate server using lein devcards then it will available on 3001 too.

@tangjeff0
Copy link
Collaborator

Works now @tomisme @avichalp ! Previously I was getting the default All Pages view before at localhost:3000/cards.html but good now!

@jelmerderonde jelmerderonde mentioned this pull request Jun 2, 2020
korlaism pushed a commit to korlaism/athens that referenced this pull request Jul 19, 2021
* Experiment with sci (athensresearch#67) and devcards (athensresearch#6)

* fix style

* move devcards ns
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.

4 participants