Live data from Hacker News

Mini projects built with VanillaJS. No frameworks or libraries

github.com

101–110 of 171 posts

Re: Mini projects built with VanillaJS. No frameworks or libraries

#101
post #6

I love these type of showcases. It‘s been a wonderful time when simply upload files via SFTP and had a running application. No need of webpack bundles, vendor libraries to achieve a simple functionality that could be solved in a few lines of code ... I really do hope this kind of developer attitude (writing pure VanillaJS) is coming back.

Until we rediscover that manually keeping the DOM up-to-date is tedious and error prone for almost any project and switch to a good middle ground such as Preact or React without a build step

It’s not that tedious. Learning to do it properly takes less effort than learning a major framework. You would actually have to do it and learn it for this to make any sense though.

Re: Mini projects built with VanillaJS. No frameworks or libraries

#102

I'm so glad to see this and projects like this getting attention. I'm responsible for several tools at my current job using nothing but straight JS, including a couple which have had a significant (positive) impact on the special projects team here. I love JS. I love it's ubiquity (F12 in any browser and you've got a REPL). I love the freedom I have when I write in it to do whatever the fuck I want and shoot myself i…

I am using simple JS function that builds a DOM fragment in a safe way as a template engine replacement: https://github.com/stefanhaustein/notemplate/blob/master/src...

Allowed me to implement TodoMVC in less than 150 LOC. Usage examples start here: https://github.com/stefanhaustein/notemplate/blob/2ee22e392d...

Re: Mini projects built with VanillaJS. No frameworks or libraries

#103

I'm so glad to see this and projects like this getting attention. I'm responsible for several tools at my current job using nothing but straight JS, including a couple which have had a significant (positive) impact on the special projects team here. I love JS. I love it's ubiquity (F12 in any browser and you've got a REPL). I love the freedom I have when I write in it to do whatever the fuck I want and shoot myself i…

I've been doing something very similar for templating static HTML sites amongst other things - you can interpret any string as a JS template string:

    function jstsEngine(string = '', environment = {}) {
      return new Function(
        ...Object.keys(environment),
        'output={}',
        'return [`' + string + '`, output]'
      )(...Object.values(environment))
    }
Link with examples: https://github.com/tomhodgins/jsts-engine

Re: Mini projects built with VanillaJS. No frameworks or libraries

#104
post #80
post #70

Earlier quoted context omitted.

Can you estimate how much time you put into the assignment? Did you get paid?

Probably a bit more than 12h, and I have to give it to the company, the project was compensated. This was the only time I've experienced that.

I have had this issue as well with take home projects. Most companies are looking for someone who will follow KISS, so demonstrating ability to do complex things like your render queue is not at all appreciated. They want to see that you can match a spec and write well-factored code.

Adding complexity for performance will be a pure negative unless you can factor that out so the next person can use it on their component.

I would read this code and think I was dealing with a very talented programmer that needs seasoning. Such a programmer can be very dangerous to the wrong company, as the seasoning will have to be added on the company’s dime.

Re: Mini projects built with VanillaJS. No frameworks or libraries

#106
A few years ago my work environment became so complex that I felt like I was spending more time trying to code, than actually coding. So I started that thing where on Sunday mornings, I would give myself a couple hours, in bed, to code something simple in vanilla js.

It was super fun, and here's the result: http://jypepin.com/lolz

A few of those were harder than others and forced me to re-learn some basic maths. I really recommend doing such a thing sometimes!

Re: Mini projects built with VanillaJS. No frameworks or libraries

#107
post #87
post #34

Here's one I did as an assignment for a job interview: https://github.com/ivancuric/hn-scroll You can see it in action here: https://hn-scroll.netlify.com/ The task was to build an offline capable site which displayed the latest Hacker News posts, and loaded more lazily when scrolling. I had to use the official HN API, and I couldn't have any middleware or caching. Everything had to be done client-side. The app ended…

That's nice. I myself did try out one too, as a hobby project to serve as an alternative frontend for a local gym https://varjosport.net/ There's a small flicker as the app generates the HTML which still annoys me but I couldn't bother to write a Lambda to server-side render the HTML every time the data is refreshed. One thing I noticed though was that creating HTML fragments is a major pain in the ass, which I see y…

With styles in components, can you support skinnable components? If so, do you have to accept parameters in the component and modify the component every time you want to change some style to make it fit with your page look and feel?

Re: Mini projects built with VanillaJS. No frameworks or libraries

#108
post #37

Earlier quoted context omitted.

Don’t worry. People with a lot of front-end experience, in this case me, also condemn the current tools.

Can I ask what sort of front-end frameworks/tools you use that you also condemn?

Most of them are merely abstraction layers for capabilities the browsers already provide. Rarely do they offer anything more. The big selling point is that they help organize the logic in a declarative way or automate a bunch of tiresome tasks that wouldn’t be there in the first place had you not used a mountain of tooling.

There are only 2 APIs in the browser: DOM and the web APIs. As far as writing cohesive logic that does wonderful things that’s on you. Most JS developers would rather it not be on them and instead adopt an Invented Here Syndrome mentality. The fear of writing any original code is very real.

https://en.m.wikipedia.org/wiki/Invented_here

Re: Mini projects built with VanillaJS. No frameworks or libraries

#109
post #25
post #24

Lately I've really enjoyed writing small apps in vanilla TypeScript. Since the TS compiler generates JavaScript that works in modern browsers and those also support the module syntax natively, you can get away without using NPM and a bundler like Webpack at all. Of course this starts to fall down when you get over a certain size but it works well and is quick to get going with for simple things like this lunch menu I…

Too bad we can’t have php style autoloading in JS. Actually what I really want is to lazy-load modules on demand! So if something is concatenated into a giant file then I don’t need to load modules anymore. Like maybe this: function load(module) { if (load.loaded[module]) return; import(module) .then(() => load.loaded[module] = true); }

You can create a function to dinamycally add script tags to load other pieces of code, but you would end up implementing a whole module system.
Post reply on HN