-
Notifications
You must be signed in to change notification settings - Fork 7
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
Re: https://plainvanillaweb.com/blog/articles/2024-09-28-unreasonable-effectiveness-of-vanilla-js/ #7
Comments
Thank you for sending this to me. I will take a look at it.
I have learned so much about vanilla web development since starting the
website, just by talking to people about it and having them send me things.
I hope to keep learning and share what I learn on the site and blog.
I'm glad you enjoy reading the blog, and thanks for letting me know.
Regards
Joeri
…On Fri, Oct 11, 2024 at 10:01 AM Jon Nyman ***@***.***> wrote:
Regarding the above post you might like my implementation of something
similar that has quite a bit of interactivity but is implemented quite
simply. Also, some of your "nice to haves" are implemented in it.
All the code is in this page for my vanilla implementation (besides the
index.html and css of course):
https://github.com/jon49/timer/blob/cca1b8fee0ba4cd2ca7105b36bcf80ec14b22e8d/src/app-vanilla.ts
So, it has a nice templating system (createTemplate) and reference
gathering system (createTemplate). The reference gathering system is based
off of Stage0 but done in a much more naive way which uses a significant
less code - if you need higher performance than use something like Stage0.
I also handle the events cleanly with data-action attributes and the
handleEvent function.
Also, using classe and the handleEvent method makes it so when I create
event listeners I don't need to clean those event listeners up since when
the object (custom element) is destroyed the events are automatically
garbage collected. (Thanks to the guy over at https://gomakethings.com/
that blogged about all these things).
I tried to keep everything bare metal as possible while still being
elegant and easy to use. I like this implementation because I have complete
control of updates to the DOM and no weird quirks that frameworks have.
I hope this might give you some inspiration and an opportunity to see all
the different ways to develop with vanilla JS. I really enjoy reading your
blog/website!
Let me know if you have any questions or feedback on my implementation.
—
Reply to this email directly, view it on GitHub
<#7>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAUP6G4U6FVIQH2J3GWKKM3Z26AVTAVCNFSM6AAAAABPYMDQDWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGU4DANZSGU4TEOA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Great website! Sending this function your way: https://github.com/terkelg/facon/ Basically it's a tagged template literal that creates a The I guess if you wanted to make this even faster (at the cost of complexity), cache the bit after the |
That's a neat way of making templating easier. By the way, you might be interested in the proposal for built-in data-aware templating that's currently being passed around. It's based on the templating as can be found in lit or fast: Something like this is going to inevitably end up in the browser, although there are many questions still to be answered on how it should work. I'll be closing this issue now but don't hesitate to open a new one if you have more feedback. |
Regarding the above post you might like my implementation of something similar that has quite a bit of interactivity but is implemented quite simply. Also, some of your "nice to haves" are implemented in it.
All the code is in this page for my vanilla implementation (besides the index.html and css of course):
https://github.com/jon49/timer/blob/cca1b8fee0ba4cd2ca7105b36bcf80ec14b22e8d/src/app-vanilla.ts
So, it has a nice templating system (createTemplate) and reference gathering system (getXElements). The reference gathering system is based off of Stage0 but done in a much more naive way which uses significantly less code - if you need higher performance than use something like Stage0.
I also handle the events cleanly with data-action attributes and the handleEvent function.
Also, using objects and the handleEvent method makes it so when I create event listeners I don't need to clean those event listeners up since when the object (custom element) is destroyed the events are automatically garbage collected. (Thanks to the guy over at https://gomakethings.com/ that blogged about all these things).
I tried to keep everything bare metal as possible while still being elegant and easy to use. I like this implementation because I have complete control of updates to the DOM and no weird quirks that frameworks have.
I hope this might give you some inspiration and an opportunity to see all the different ways to develop with vanilla JS. I really enjoy reading your blog/website!
Let me know if you have any questions or feedback on my implementation.
The text was updated successfully, but these errors were encountered: