Fireship · @fireship
a solid start
Uploaded November 11, 2022 · Length 4:12
Summary
solid start review: features, data fetching, and server-side code in a lightweight JavaScript framework
- solid start
- javascript framework
- server-side rendering
- data fetching
- react alternative
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:01
it is November 11 2022 and you're
- 0:04
watching the code report no great
- 0:05
JavaScript framework would be complete
- 0:07
without its own meta framework for
- 0:09
server-side rendering to go along with
- 0:10
it react has next view has next angular
- 0:13
has analog spelltas kit quick has City
- 0:16
and as of yesterday solid has start as a
- 0:19
late Comer to the JavaScript framework
- 0:20
War it has the luxury of taking the best
- 0:22
features from its peers and puts them
- 0:24
together into one beautiful package and
- 0:26
refreshingly it graciously gives all of
- 0:28
them Credit in its announcement blog
- 0:30
like when the Germans use mustard gas in
- 0:32
World War one I don't seem to recall the
- 0:33
French giving them any credit when they
- 0:35
totally copied this game-changing
- 0:36
blazingly deadly feature I think it says
- 0:38
a lot about the team behind solid giving
- 0:40
credit where credit is due but they've
- 0:41
also done a lot of their own Innovation
- 0:43
with a UI framework that's already very
- 0:45
solid like other meta Frameworks it uses
- 0:47
file system routing and supports nested
- 0:49
layouts in the same way that nux does
- 0:51
where a file can Shadow a directory that
- 0:53
then has an outlet component that
- 0:54
projects all the content from the
- 0:56
subrouts this differs from next 13 which
- 0:58
has a layout file for each of your
- 0:59
layouts both nexjs and spell kit have a
- 1:02
variety of naming conventions for the
- 1:03
files in the routing system but one
- 1:05
major criticism of this is that it leads
- 1:07
to a bunch of files with the same name
- 1:09
in your project like you'll have a
- 1:10
hundred page.js files solid start takes
- 1:13
the approach more like the old next JS
- 1:15
where a file name will represent a route
- 1:16
and it even takes things one step
- 1:18
further where instead of having a bunch
- 1:19
of index files you can wrap the file
- 1:21
name in parentheses to give it a more
- 1:23
descriptive name that's pretty cool but
- 1:25
things get a lot more interesting when
- 1:26
we start talking about data fetching
- 1:28
like many other meta Frameworks you can
- 1:30
export a function in this case called
- 1:32
route data that can fetch data on the
- 1:34
server or client when the user navigates
- 1:36
to a new route what felt kind of weird
- 1:37
at first to me was that you also need to
- 1:39
use this create route data function that
- 1:41
takes a callback that does the actual
- 1:43
data fetching my initial thought was why
- 1:45
not just simplify this API and return
- 1:46
the data from the route data function
- 1:48
but it turns out there's a good reason
- 1:50
for this that will make sense in just a
- 1:51
minute but first after we fetch this
- 1:53
data we can then go into the UI
- 1:55
component and access it with the use
- 1:57
route data hook while providing us with
- 1:59
end-to-end type safety now it doesn't


