TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Vanilla JavaScript Code Organization Projects Recommendation?

3 点作者 calebjosue超过 1 年前
Hello!<p>In 2011 I&#x27;ve used to write JavaScript on a single file. Then I stopped using JavaScript (I happen to like it). but my career has been mostly with Java.<p>Fast Forward 2023. Do you fellows have some projects that are good examples of how code is organized for JavaScript applications (Client Side) without using any Framework? I am aware of the new additions JavaScript has added in the last years, my question is more related to good examples of Software Engineering using Vanilla JavaScript.<p>Thanks!

3 条评论

GianFabien超过 1 年前
I suggest you familiarize yourself with ES5&#x2F;6 changes. For me classes and modules makes JS more like class-based language. During development on local cluster I prefer to have one file&#x2F;module per class. For me the biggest gotcha has been the increased use of promises, async&#x2F;await in the numerous Web APIs.
meiraleal超过 1 年前
Tiddlywiki is one HTML file and a great project <a href="https:&#x2F;&#x2F;tiddlywiki.com&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;tiddlywiki.com&#x2F;</a>
wryoak超过 1 年前
I don’t recall the project’s name anymore but they organized it in some way I don’t recall either, often a single function per file, and then compiled all the JS files with a bash script by just appending. I thought it was neat — has its obvious weaknesses but it had the strength that the organization scheme could be changed anytime without having to update import paths or anything, quick compilation and not too hard to eventually (I assume) migrate to ES modules.