Comments (9)
Hi @rygo6,
first of all thank you for the compliments and for your interest in this project! I really appreciate it! 😄
Regarding asm-dom, I'm thinking to implement something like snabbdom's thunks and other simple features like that. I'd like to maintain it simple and performant.
Where do you see asm-dom going? Are you hopeful for comprehensive C++ web tooling? Is such a thing plausible or ideal? What missing components do you think are necessary?
asm-dom is a minimal virtual dom that can be easily used to build a framework, just like snabbdom. It would be interesting to develop something similar to react, class components with lifecycle and so on. Here is a simple example of that.
I think that we can use it to build something bigger but I'd like to leave this package simple and reusable without transforming it into a framework. I don't want to force people to use a big framework if they don't want, we can just fork or import it as a dependency.
We certainly need other helper packages that call JS when needed to hide to the user complex mechanisms like routing etc. I think that we can develop modular code in this way and then aggregate them to build a framework.
A lot of work needs to be done but I'm really hopeful.
What do you think about it? Do you think that this is the right way to do that?
from asm-dom.
@mbasso, I like this project too! Very upset this isn't in GitHub trending :(
About "complex mechanisms". You can just create a lot of plugins for asm-dom and we will be able to use them like usual c++ libraries.
Some example names
asm-dom-plugin-component
asm-dom-plugin-state
And so on.
And we will be able to use it like this:
#include <asm-dom-plugin-state>
from asm-dom.
Sorry for not responding to this for so long. Went on a bit of detour in my personal life and projects. But started looking at this again.
I agree with the approach of keeping this repo as simple as possible. How do you think we would deal with pulling together all the different modular pieces of a large project? Could we rely on NPM for modular pieces? Can you distribute C++ through NPM?
I read through some more of your cpp code, and also some of snabdom. I realize I am actually kind of naive on all the thinking behind the design of a virtual dom. I was curious, did you by chance base this implementation off of a description of virtual dom in a book, or article, somewhere which I could also read to get a better understanding of the thinking behind it?
from asm-dom.
asm-dom is a minimal virtual dom that can be easily used to build a framework, just like snabbdom. It would be interesting to develop something similar to react, class components with lifecycle and so on. Here is a simple example of that.
Do you think most of the foundation is available such that a framework (like React) could be written in C++? Or is there more JavaScript integration that's needed?
from asm-dom.
Sorry for not responding to this for so long. Went on a bit of detour in my personal life and projects. But started looking at this again.
Don't worry 😄 We all have our personal life
I agree with the approach of keeping this repo as simple as possible. How do you think we would deal with pulling together all the different modular pieces of a large project? Could we rely on NPM for modular pieces? Can you distribute C++ through NPM?
At the moment asm-dom needs both C++ and JS imports to work properly... I'm planning to remove the last ones in order to improve the public API and have only C++ files. However, at the moment I'm not able to identify the right package manager, indeed, I'm not sure about the decision to use NPM...
Have you some suggestions to distribute modules in a convenient way?
I read through some more of your cpp code, and also some of snabdom. I realize I am actually kind of naive on all the thinking behind the design of a virtual dom. I was curious, did you by chance base this implementation off of a description of virtual dom in a book, or article, somewhere which I could also read to get a better understanding of the thinking behind it?
I based the implementation of asm-dom on snabbdom simply reading thorugh the source code... I've also read the implementation of preact, which is a really performant virtual dom with the same APIs of React, and inferno that is also interesting too. preact uses a DOM recycler and inferno uses bitwise operations to speed up the critical path, as asm-dom does.
I've read also some articles and watched some videos, for example:
- https://medium.com/@asolove/preact-internals-1-the-easy-parts-3a081fa36205
- https://medium.com/@asolove/preact-internals-2-the-component-model-36a05e32957b
- https://medium.com/@asolove/preact-internals-3-some-fiddly-little-bits-f353b1ad7abc
- https://youtu.be/LY6y3HbDVmg
Do you think most of the foundation is available such that a framework (like React) could be written in C++? Or is there more JavaScript integration that's needed?
I'm not an expert of the internals of React but I know that the core module and the one to interact with the DOM are well separated. The second is just a renderer of the first one that I think it could be easily written in C++. We should try to confirm it but I suppose it's possible.
from asm-dom.
In terms of managing modules, I personally never saw what was so terrible with git modules. The only big issue I see is that it doesn't automatically clone all dependencies for a module. But honestly thats one of the things I kind of hate about npm, you add a module to draw a bar graph, then it adds 50 more modules to node_modules. Maybe manually having to git submodule add each depdency would make people conciencious of what their dependencies are.
But maybe it could warrant an expansion to git? Perhaps 'Git Dependencies". A repo would have have an extra .gitdepedencies file that would list all the dependencies for the repo. Once it clones a repo from .gitdependencies, it would check for .gitdependencies in that repo and do the same. But it would clone all repos in .gitdependencies under a single folder in the root, in a single "dependencies" directory that would be akin to node_modules.
from asm-dom.
On the subject of my last post. have you guys seen this?
https://nxxm.github.io/
Looks to be the exactly perfectly alternative to npm that would work well for something like this.
from asm-dom.
Some more reading, this seems more popular:
https://conan.io
Im thinking I am going to try to get this set up with Conan.
from asm-dom.
Some more reading, this seems more popular:
https://conan.io
Im thinking I am going to try to get this set up with Conan.
Cool, sounds good.
Keep me updated if you experiment something with it 😄
We can publish it on both npm
and conan
for now. In a project with a lot of js interaction npm
is certainly needed, the same conan
but for C++...
At the moment I'm modifying a little bit the internals of asm-dom (and a few public api, but something really small) in order to continue with the multithreading smoothly... I'll open a "Work in progress" PR one of these days.
from asm-dom.
Related Issues (20)
- Support for web components HOT 6
- Benchmark comparison to major SPA (react, vue, etc.) libraries? HOT 2
- Is this still an active project? HOT 2
- Could there be a browser that supports cpx? Or is this entirely out of scope?
- WebGL, WebGPU etc. for rich graphics?
- What are the preferred ways to add interactivity to SPAs with asm-dom?
- Why doesn't WASM make this project obsolete?
- Any input, if I'd wish to see an usability comparison of asm-dom to existing JS frameworks?
- Featuring asm-dom in Docusaurus HOT 1
- Question: Using CLion, Compiling to Native HOT 3
- git submodule init fails. HOT 1
- Regression: children aren't displayed when appended manually to a parent with no child. HOT 3
- Compilation fails because of undefined behaviour catched by `-Wunsequenced` HOT 7
- HTML parser from cobalt
- Shared logic for desktop/mobile and web browser
- VNode reuse HOT 24
- SVG Support is broken HOT 1
- Inline Example in README.md is missing a closing parenthesis. HOT 2
- Support SSR(Server Side Rendering)? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asm-dom.