Skip to content

Commit 88a5146

Browse files
committed
📝 copy updates
1 parent c8ef806 commit 88a5146

File tree

3 files changed

+83
-38
lines changed

3 files changed

+83
-38
lines changed

Diff for: i18n/en-US/articles/what-is-nullstack.md

+78-33
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,115 @@
11
---
2-
title: What is Nullstack?
2+
title: Frequently Asked Questions
33
description: Nullstack is an isomorphic JavaScript framework that allows developers to build Full Stack applications while staying focused on the product features, and solving the user problems, rather than spending a significant amount of their time worrying about layers of abstraction and choosing which tools make them look fancy
44
---
55

6-
Nullstack is a full stack web framework that allows features to be created in a single component, we call it "feature-driven" components. Nullstack's main feature is having functions that run in the server and client within the same file, it uses a compilation step to create multiple bundles.
7-
Besides that, the framework comes with tons of small conveniences out of the box, but the cool thing is that all of them are usable in the exact same way, they are passed as arguments to every function of your components, and you don't have to learn a bunch of new concepts to be productive. As a rule of thumb, all you need to know ahead of time is that every static async function will run in the server, and every function receives an object with the framework context merged with the application context and the component context.
6+
## What is Nullstack?
7+
Nullstack is a full stack web framework that allows features to be created in a single component, We call it "feature-driven" components. Nullstack's main feature is having functions that run in the server and client within the same file, it uses a compilation step to create multiple bundles.
88

9-
# What is feature-driven?
9+
Besides that, the framework comes with many small conveniences out of the box, but the cool thing is that all of them are usable in the exact same way, they are passed as arguments to every function of your components, and you don't have to learn a bunch of new concepts to be productive. As a rule of thumb, all you need to know ahead of time is that every static async function will run in the server, and every function receives an object with the framework context merged with the application context and the component context.
10+
11+
## What is feature-driven?
1012
It means that every component is a full feature in itself, but it is up to you to decide how to break features down. As an example, you could have a "BlogPost" component or you could have a Blog a Post a Comment, and a Like component and they are nested into each other, heck you could even have an entire e-commerce application be a top-level component imported in another application, that's the beauty of full stack components.
1113

1214
In the case of the Like button for instance, you would have the server functions to load the number of likes that item has, a render function to show your likes, and an event that triggers a server function to save your like, all in a single file if you want, the main reasoning for this architecture is that the project manager's tickets, the UX and the code look pretty much the same.
1315

14-
*But my bootcamp teacher said I need at least 3 layers of abstraction to be a good developer, can I do that in Nullstack?*
16+
```jsx
17+
import Nullstack from 'nullstack'
18+
19+
class LikeButton extends Nullstack {
20+
21+
// instance variables are mutable and reactive
22+
likes = 0
23+
24+
// database is a user defined context key
25+
static async getNumberOfLikes({ database, post }) {
26+
const [likes] = await database.query('SELECT COUNT(*) FROM likes WHERE post = ?', [post])
27+
return likes
28+
}
29+
30+
// the framework injects some useful context keys by default
31+
async initiate({ params }) {
32+
// you can use the returned value of server functions seamlessly
33+
this.likes = await this.getNumberOfLikes({ post: params.post })
34+
}
35+
36+
// static async functions run in the server
37+
static async createLike({ request, database, post }) {
38+
const user = request.user.id
39+
await database.query('INSERT INTO likes (user, post) VALUES (?, ?)', [user, post])
40+
}
41+
42+
async like({ params }) {
43+
// you can mutate variables and the dom reflect the changes
44+
this.likes++
45+
// this is calling an api endpoint under the hood
46+
await this.createLike({ post: params.post })
47+
}
48+
49+
// JSX follows the HTML standards
50+
render() {
51+
return <button onclick={this.like}>{this.likes}</button>
52+
}
53+
54+
}
55+
```
56+
57+
The code above is the actual complete implementation of a LikeButton, front and back end that you can reuse in any project, with 32 lines of code removing comments.
58+
59+
*- But my bootcamp teacher said I need at least 3 layers of abstraction to be a good developer, can I do that in Nullstack?*
1560

1661
Yes you can, Nullstack is a big foot-gun you can shoot your own foot in your favorite style, just ask for the permission of an adult first.
1762

18-
# Is it a react framework?
63+
## Is it a react framework?
1964
Nope, but it uses JSX. Nullstack does not use hooks, instead, it aims to keep JavaScript's natural flow, but makes it reactive. Fun fact tho, Nullstack actually started as a react framework that just aimed to add server functions to the components, but eventually, I found that sticking to that model was limiting our creativity.
2065

21-
*But react has the support from all those big companies, why should we use Nullstack?*
22-
23-
Well, you shouldn't use it just because its a new tool, use it if you want, I love using it at AE Studio tho, though we are building brain-to-computer interface software here, and we have a few opinions about just letting meta dominate everything.
66+
## Why did you build another framework?
67+
That wasn't the original intention, We were actually trying to build a coffee shop, but We get distracted very easily... you can learn more about the history behind Nullstack in [Anny's TDC talk](https://www.youtube.com/watch?v=77qeq6cSHG8).
2468

25-
# Why did you build another framework?
26-
That wasn't the original intention, we were actually trying to build a coffee shop, but we get distracted very easily... you can learn more about the history behind Nullstack in Anny's TDC talk.
69+
Initially, We just wanted to put the server code alongside the client code, because the projects We were working on had very similar patterns, and one of those patterns was that the clients would completely change their minds all the time, and your regular clean code kinda thing was not keeping up with the changes.
2770

28-
Initially, we just wanted to put the server code alongside the client code, because the projects we were working on had very similar patterns, and one of those patterns was that the clients would completely change their minds all the time, and your regular clean code kinda thing was not keeping up with the changes.
71+
I often noticed myself trying to fit into the format of the framework and changing features, or even avoiding creating new API endpoints because i didn't wanna make things to coupled or complicated. In Nullstack i just need to create a new function in the same class that just returns whatever data i need just for that case, which makes me a lot more productive and makes me think of what i'm building a lot more often than how i am building it.
2972

30-
# Does it use a virtual dom or a compiler or signals?
31-
The answer is yes. Nullstack has what I like to call a "Virtual Pipeline" it optimizes things differently in different scenarios for different environments. However that is just an implementation detail, the main thing is that it **just works** and we may change anything internal at any time. The only condition we have is that anything that works in vanilla JS should work in Nullstack, so we won't adopt any cool new trends if it limits the developer experience, or if the developer now needs to be aware of new edge cases instead of getting stuff done.
73+
## Does it use a virtual dom or a compiler or signals?
74+
The answer is yes. Nullstack has what I like to call a "Virtual Pipeline" it optimizes things differently in different scenarios for different environments. However that is just an implementation detail, the main thing is that it **just works** and We may change anything internal at any time. The only condition We have is that anything that works in vanilla JS should work in Nullstack, so We won't adopt any cool new trends if it limits the developer experience, or if the developer now needs to be aware of new edge cases instead of getting stuff done.
3275

33-
# Does it uses Classes or Functions?
76+
## Does it uses Classes or Functions?
3477
It uses whatever JavaScript code you can come up with. By default it follows the same paradigm as vanilla: functions are pure, and classes hold state. I know I will lose a lot of devs after the previous sentence, but keep in mind when people say "classes are bad" they actually mean "classes are bad on the current framework I'm using" . In Nullstack it just feels very natural, give it a try.
3578

36-
# Is it blazingly fast?
79+
## Is it blazingly fast?
3780
Yes. But it is optimized for what I consider the "right type of fast", it's fast for the users. It uses a mix of architectures to optimize for different scenarios, but all of them aim to have the users have very responsive experiences, even when they are offline.
3881

39-
You can always benchmark things and be excited about microseconds happy, but that all ends when your user 3g is not feeling like reaching your server that day.
82+
You can always benchmark things and be excited about microseconds, but that all ends when your user 3g is not feeling like reaching your server that day.
83+
84+
That being said, We love spending time micro benchmarking things and it's actually pretty fast, if you sneak into our commit history you will notice We went for "what We need to create products" first then We went "optimization happy", as you should if you plan to code professionally and not just watching clickbait.
4085

41-
That being said, we love spending time micro benchmarking things and its actually pretty fast, if you sneak into our commit history you will notice we went for "what we need to create products" first then we went "optimization happy", as you should if you plan to code professionally and not just watch youtube videos.
86+
![Nullstack's documentation lighthouse score](/lighthouse.webp)
4287

43-
# What can i build with it? Does it scale?
44-
You can build anything you can build with regular JavaScript. We've built so far plenty of PWAs, blockchain applications across multiple blockchains (dApps), mobile games, capacitor applications, electron applications, chrome extensions, and even things to visualize brain data that require a lot of performance. Currently, we have a SaaS with hundreds of thousands of hits a day, and it is holding just fine on a "regular JavaScript-priced" server.
88+
## What can i build with it? Does it scale?
89+
You can build anything you can build with regular JavaScript. We've built so far plenty of PWAs, blockchain applications across multiple blockchains (dApps), mobile games, capacitor applications, electron applications, chrome extensions, and even things to visualize [brain to computer interface](https://ae.studio/brain-computer-interface) data that require a lot of performance. Currently, We have a SaaS with hundreds of thousands of hits a day, and it is holding just fine on a "regular JavaScript-priced" server.
4590

46-
# How can i use a new framework? it wont have an ecosystem.
47-
Remember when I mentioned we keep everything vanilla just working? that makes most JavaScript packages for browser and server compatible with Nullstack out of the box, that's a pretty huge ecosystem in my opinion. But also if you are feeling like a mad scientist, you could always just install your favorite framework on top of a Nullstack's application by rendering to an element controlled by it.
91+
## How can i use a new framework? it won't have an ecosystem.
92+
Remember when I mentioned We keep everything vanilla just working? that makes most JavaScript packages for browser and server compatible with Nullstack out of the box, that's a pretty huge ecosystem in my opinion. But also if you are feeling like a mad scientist, you could always just install your favorite framework on top of a Nullstack's application by rendering to an element controlled by it.
4893

49-
# Does it have any kind of telemetry?
50-
No, we do not collect any data. Nullstack was not built as a framework first, it was extracted from real applications we worked on over the years, so the features it has are based on what we needed as opposite of what the data would point would cause better thumbnails.
94+
## Does it have any kind of telemetry?
95+
No, We do not collect any data. Nullstack was not built as a framework first, it was extracted from real applications We worked on over the years, so the features it has are based on what We needed as opposite of what the data would point would cause better thumbnails.
5196

52-
*But how will you guys know what features we want then?*
97+
*- But how will you guys know what features We want then?*
5398

54-
You can always tell us on discord or create an issue on GitHub, we will be happy to talk about it!
99+
You can always tell us on discord or [create an issue on GitHub](https://github.com/nullstack/nullstack/issues), We will be happy to talk about it!
55100

56-
# Does Nullstack have any social media?
57-
Of the 6 main contributors of Nullstack 6 of them are autistic, including the person writing this wall of text... so you mostly lost us at the "social" part. We did try tho, and we created a YouYube Channel, a Twitter, and an Instagram, but 4 of us also have ADHD so we ended up procrastinating and not posting on it, oopsie. We are pretty active on discord though, that's the place we are forced to log in anyway to coordinate our raids.
101+
## Does Nullstack have any social media?
102+
Of the 6 main contributors of Nullstack 6 of them are autistic, including the person writing this wall of text... so you mostly lost us at the "social" part. We did try tho, and We created a [YouTube Channel](https://www.youtube.com/nullstack), a [Twitter](https://twitter.com/nullstackapp), and an [Instagram](https://www.instagram.com/nullstackapp/), but 4 of us also have ADHD so We ended up procrastinating and not posting on it, oopsie. We are pretty active on [Discord](https://discord.gg/eDZfKz264v) though, that's the place We are forced to log in anyway to coordinate our raids.
58103

59-
# What is Nulla-Chan?
104+
## What is Nulla-Chan?
60105
Nulla-Chan is the avatar of Nullstack, it belongs to a category of avatars called a "Waifu". If you don't know what a waifu is, that probably means that you have your life on the right track. Fun fact, the waifu character was created by the author's IRL waifu.
61106

62-
# What was the hardest part creating a framework?
63-
Definitively it was deciding if we should spell it "full stack", "fullstack", or "full-stack". Seriously please tell us on discord which one to pick.
107+
## What was the hardest part creating a framework?
108+
Definitively it was deciding if We should spell it "full stack", "fullstack", or "full-stack". Seriously please tell us on discord which one to pick.
64109

65-
# How can i get started?
110+
## How can i get started?
66111
Just go to your favorite terminal and type "npx create-nullstack-app app-name", and if you are feeling fancy you can also pass the flags --typescript and --tailwind.
67112

68-
## Next step
113+
### Next step
69114

70115
⚔ Learn [how to create a nullstack project](/getting-started).

Diff for: i18n/pt-BR/components/Home.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ hero:
44
heading: "Componentes JavaScript Full Stack"
55
subHeading: "Orientados a Recursos"
66
descriptions:
7-
- "Escreva o backend e frontend de um recurso em um único
8-
componente e deixe o framework decidir onde o código deve ser executado."
9-
- "O Nullstack oferece todas as ferramentas que você precisa para manter o foco no produto."
7+
- "Seu novo framework web favorito."
8+
- "Escreva o backend e o frontend de um recurso em um único componente isomórfico
9+
e deixe o framework descobrir onde o código deve ser executado."
1010
callToAction: "npx create-nullstack-app"
1111
actionLink: '/pt-br/comecando'
1212
actionCallback: 'Comando copiado, cole no terminal'
1313
trinity:
14-
heading: "A Santa Trindade"
15-
subHeading: "do desenvolvimento de aplicativos web progressivos"
14+
heading: "Excelente para o Dev. Excelente para o usuário"
15+
subHeading: "De SSR rápido a PWA offline sem nenhuma configuração"
1616
roles:
1717
- title: "Primeira visita otimizada"
1818
image: "/illustrations/nulla-tanker.webp"

Diff for: public/lighthouse.webp

15.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)