Open bogas04 opened 7 years ago
webpackbin is highly unstable.
We could adapt tricycle for this sort of thing. Could be tied in with create-cycle-app perhaps https://github.com/cyclejs-community/create-cycle-app/issues/10
I agree. It would be nice. It's not my priority, but something someone can help contribute.
Can I propose something? What about point every project on examples/
to a Code Sandbox, embedding them on the docs/site? Sandbox would download dependencies and run the code on the browser, totally synced with the repo, with a project script to keep all examples linked seamlessly.
To achieve this, the only required change is to 1) rename each example main.js
to index.js
, following the convention expected by CS, or; 2) point the main
on each example package.json
.
If you are ok with that, I can make a PR :smiley:
@geovanisouza92 I'm not familiar with Code Sandbox, it looks good, I'm just worried about the limits of the free plan, and whether this startup will last long enough. I was also excited about putting each example in Dat, this way it's very easy to update them and view them in Beaker browser. To make it available also for users of the old web, we could use https://hashbase.io/ (it also has a pricing plan, but at least it's easy to self host if we decide so).
I can migrate them to CSB as an experiment.
Here are 2:
It's very basic and easy.
src/main.js
#main-container
-> #root
If you dig this, I can take out some time tomorrow and migrate all the remaining ones.
@staltz
CodeSandbox is still around and has made this even easier, at least for the example I tried: https://codesandbox.io/s/github/eostrom/cyclejs/tree/code-sandbox-demo/examples/advanced/animated-letters
This is all I did:
main
property to the example's package.json
, pointing to src/main.js
.animated-letters
subdirectory of my GitHub repo.CodeSandbox will also watch the GitHub repo and update itself automatically when it changes! This is great – if we just copy-pasted code to a sandbox, it would quickly fall out of date unless someone was dedicated to maintaining it.
Note that this sandbox is not "owned" by anyone, as far as I can tell. If you try to edit it, it will automatically create a private copy of the sandbox.
With all that in mind, if there's still interest in this, I propose the following:
main
properties to all the examples.Let me know if this seems like a good way to proceed.
A progress report on this (with links to the sandboxes):
advanced/routing-view
is functional but the CSS isn't applied
main
to src/main.js
, the sandbox generates its own HTML file that basically just embeds that JavaScript file, but for this example we want to use our own index.html
main
to index.html
, which works in this Vanilla sandbox, but it didn't work for meadvanced/isomorphic
I should set main
to server.js
but I get an error
basic/jsx-seconds-elapsed
raises a "ReferenceError: React is not defined"
basic/http-random-user
, intermediate/bmi-typescript
, intermediate/hello-lastname
, and intermediate/tsx-seconds-elapsed
all present a blank page with no explanation
intermediate/tsx-seconds-elapsed
raises a lot of TypeScript parsing errors on my computer, but the others work fineThe other 12 examples work!
I'll look further into these failures, but if anyone else wants to jump in, feel free to fork a copy of the example and tinker with it.
I feel that it'll be easier for users to understand, test and play with CycleJS if the examples are hosted somewhere. Something like how react-router 4 does. Currently only such thing is the example on homepage.
One great way to start doing this can be simply creating bins on webpackbin.com. All your examples use 2-3 files, and don't rely too much on build processes other than that of babel.