You are viewing archived messages.
Go here to search the history.

Mariano Guerra 2020-08-10 12:21:59

Short demo combining 3 new features: column summaries, area map and color in range function to create a map of Portugal where each district has a color based on its population related to the min/max population of all districts (data from wikipedia source)

https://www.youtube.com/watch?v=k42iyUFMteE

nicolas decoster 2020-08-10 12:32:39

Looks great! I really like how you define stuff in context (like min and max) and actually use it somewhere else by drag'n drop in places that look like "text" programming.

And I also like how everything is explorable and interactive.

Chris Maughan 2020-08-11 06:53:28

Nice demo; I've done something similar in Jupyter notebooks; great to see it done visually.

Cameron King 2020-08-11 15:29:56

The open application: making websites user-editable with no special effort. This is a feasibility prototype built for Svelte. The core of it is quite simple. At build time, it transforms component definitions to fetch their dependent components from a dependency store rather than importing them from the filesystem. Component source files are emitted as part of the build, and the Svelte compiler is added to the page. Now you can pull up the source of any component, make changes, and rebuild it from within the browser.

This week, I'm working on building experimental development tooling from within this architecture, so hopefully I'll be able to share more interesting functionality by the weekend.

https://youtu.be/P-ZHjVa2OYk

Cameron King 2020-08-11 15:41:06

Source code for the plugins is here:

https://github.com/cameronrking/rollup-plugin-svelte-component-ioc transforms the source, converting imports to dependency store injections

https://github.com/cameronrking/rollup-plugin-layout-intercept replaces the application root with a toggleable Golden Layout container (not a huge fan, but it was the easiest to prototype with)

https://github.com/cameronrking/rollup-plugin-ioc-editing-tools is where I'm developing the application tooling

nicolas decoster 2020-08-11 16:48:46

Looks great too!

More than a year ago, I have try something like that, but with Vue.js and using the hot reload stuff but to compile in the browser the modifications. I haven't work again on this, but I thought to reuse it somehow. And even wonder if Svelte would also be a good fit for this kind of scenario. You have just answered that! 😄

I don't really know Svelte (never code) but I really like the concept, and I have to try it. Even if for now I guess I will stick to Vue.js for most of my work.

Anyway, keep going, I am very impatient to see the next iteration!

Cameron King 2020-08-11 17:34:02

My first experiments (about 18 months ago) were done with Vue and webpack hot reloading, but before long I ran into weird app blink issues. I'd make a change to one file, and an unexpectedly large portion of the screen would refresh, throwing out state that shouldn't have been thrown out. Plus, hot-reloading relies on architecture outside the browser. This prototype pushes the build and update cycle into the browser as plain JS, so it can be deployed as a static site.

nicolas decoster 2020-08-12 06:42:48

Well, I mean, I used the hot reload feature only in the browser. I.e. the client side part of it. When user makes a modification in an editor hosted in the browser, it fires recompilation/rerender if the Vue template is modified without touching the data, and reload the full component if data is modified. Here is my very light proof of concept: https://stackblitz.com/edit/vue-hot-reload-test-2

Cameron King 2020-08-12 13:01:46

Oh wow! I never found that package. I might need to dig into the internals. My Svelte implementation is naive and throws out the whole component every time. Although, I was refactoring the Svelte browser devtools into components that run inside the browser yesterday and discovered that there's a low-level API with $capture_state() and $inject_state() methods, which if they do what they say on the box, should solve the problem neatly.

Cameron King 2020-08-11 15:36:13

In terms of experimental development tooling, I put out a VSCode extension a little while ago that focuses on mapping conceptual interactions with Vuejs + TailwindCSS into a few semantic keystrokes through AST manipulation. I don't have a video, but the README has a few GIFs showing it in action. The CSS interaction cycle seems to me to be somewhat novel, though underdeveloped.

https://github.com/cameronrking/olympus

nicolas decoster 2020-08-11 16:16:42

I have just tried it, and I like it! I like the "vim" like way of executing the command: Alt-o to launch the extension, then 'a' to add, then 'p' for props, then the prop name, and voilà you have un new prop at the right place even if you are far away this place. Combined with the autodiscovery, I find that all this gives a good developer experience.

nicolas decoster 2020-08-11 16:22:24

For the Tailwind part, I find that there is no real plus compared to the existing Tailwind CSS that can already help you finding the right class name with auto complete. I guess for this it is a matter of preference as the experience is slightly different:

  • well chosen char sequences for you with autodiscovery
  • start typing, auto-completion is showing, select with up/down for Tailwing extension.
nicolas decoster 2020-08-11 16:28:16

I know you won't maintain this extension, but I wanted to let you know that it seems that the extension works well only for 4 spaces tab stops. I use 2 spaces tab stops and after an insertion (say a new props) it uses 4 spaces for the insert and in some other places.

nicolas decoster 2020-08-11 16:31:06

And a remark, this extension is very useful to add data, computed, watchers, etc. with the traditional way of coding this in Vue. But with the new Vue Composition API, maybe it will be more complicated for this extension to add/modify stuff (which can be anywhere in the setup function as JavaScript code) ?

Cameron King 2020-08-11 17:17:54
  • Yes, that vim-like feel is what I was going for.
  • I agree, I think the discovery portion of the CSS isn't much of a change. What really stands out to me, though, is the elimination of the reload and the family navigation mechanic. What I was striving for as I built it was being able to press a single key to iterate through my options without any feedback delay and without having to manually copy changes from the browser back to the source. The shortcut mechanism was intended more for experienced developers who know what they want and want to reduce the number of keystrokes required to say it.
  • Yes, the 4-space formatting is intentional. Since it's a prototype, I hard-coded my formatting preferences rather than making them modifiable. But in my defense, it wouldn't be an issue if the AST were a first-class member of the development process. Ideally, I should be able to hand the AST directly to an independent formatter. As it stands, it was easier to rely on the existing integration of formatters/linters into the workflow than to try to integrate those tools directly into the extension or expose the recast printing options. The HTML printer also does some weird stuff with multiple attributes if you haven't noticed that yet.
  • The composition API would make life more interesting, but it's intended for more challenging use cases. I haven't had to design anything quite that complicated, so I have no mental models for the process. I wouldn't know what tooling to build, but I suspect it would be closer to a projectional editor than this "smart snippets" thing.
Nuno Leiria 2020-08-13 09:11:50

Hi @Cameron King, this looks great! Are you able to go a bit deeper into the technical details of how you achieve liveness? I'm familiar with ASTs but not with Vue or Tailwind, if that helps.

Cameron King 2020-08-13 12:42:54

Sure! I'm not sure what you mean by "liveness", but if you're referring to the CSS feedback cycle, the details aren't particular to the technologies.

  • To skip waiting for the project to rebuild, the extension opens a WebSocket connection between the editor and the browser. To start the connection, the user has to drop a snippet into their main.js they get through the extension command alt+o ss.
  • Through that connection, the extension sends edit-class events, which target an element with a specific data-olympus attribute and add/remove the given classes on it.
  • The data-olympus attribute is added to the source code of a given component via an extension command (alt+o ai)
  • In the editor, rather than editing class lists directly, the user goes through an input that's summoned by an extension command (alt+o et). Every time the user adds/removes a class, the extension patches the classes on the corresponding AST node and reprints the source, and sends an event through the WebSocket with the appropriate payload.

It could be more elegant and efficient. Editing through the AST isn't necessary, but it was quicker development-wise to work with objects and call .toString() than to work with locations in the underlying string representation. I'm also not a fan of the data-olympus attribute, but it was the quickest way to map identity between AST nodes and live DOM nodes. Neither do I love that the user has to drop a snippet into their source code, but it didn't feel worth publishing an NPM package to hide the snippet. Ideally, the snippet would be part of the build system and included/excluded based on the environment.

Nuno Leiria 2020-08-13 17:39:43

Got it, that's perfect, thank you. Yes, by liveness I meant as in live coding or on-the-fly programming.

🕰️ 2020-08-04 12:48:33

...

Cameron Yick 2020-08-12 06:35:31

not sure if intentional but I get an auth error with the OP YouTube link - was the video taken down?

Garth Goldwater 2020-08-12 14:41:41

@hamish todd any idea about ^

hamish todd 2020-08-12 14:59:01

Apologies folks, fixed now

hamish todd 2020-08-12 23:22:09

@Cameron Yick @Orion Reed

Stefan Lesser 2020-08-14 17:42:16

@hamish todd Just watched your video and just wanted to say: this is great, thanks for putting a presentation like this together! I had come across the SIGGRAPH 2019 video (linked above) earlier and saw that this is fundamental. Looking forward to hearing more about your work.

hamish todd 2020-08-14 18:08:14

Thank you very much for saying! I hope that what I produce with this line of thinking doesn't disappoint 😅

Ivan Reese 2020-08-15 04:44:13

Ivan Reese has renamed the channel from "feedback" to "share-your-work"

Ivan Reese 2020-08-15 06:23:13

Welcome to #share-your-work!

This is the channel for discussion about all our own FoC projects. If you want feedback, collaborators, high-fives, or just a place to drop your latest output, this is the place.

This channel is especially sensitive to tone, so please keep things positive and constructive. Critique is great, criticism is not.

  • If your work is more about programming as practiced today than programming of a hypothetical much better future, please share it in #present-company. This is a fuzzy boundary that we'll more clearly establish over the coming months, so if in doubt, by all means post here.
  • Blog posts about your own FoC work are welcome here. If you'd just like to direct people to your blog post about the FoC more generally, not about your specific FoC project work, that probably belongs in #linking-together.