On this auspicious day, the beta version is officially released. Looking forward to your feedback
Svelte. dev/blog/svelte…
After five months and hundreds of commits, we’re here to share SvelteKit Beta.
Even though there are some known bugs that are still unaddressed and some missing features that need to be improved, we can’t help but be excited and hopeful that you’ll want to try SvelteKit.
Creating a SvelteKit project is a breeze:
NPM init svelte@next my-app # Go to the project directory CD my-app # install dependencies NPM install # Start the development server and open the browser NPM run dev -- --openCopy the code
You can check out the full documentation in kit.svelte.dev/docs.
If you want to migrate an application written by Sapper[1] to SvelteKit, see Kit.svelte. dev/migrate to help you work out the differences.
SvelteKit is available at github.com/sveltejs/ki…
Issues and Pull Request are currently disabled, so we can arrange them properly before opening them on the selected day.
Wait, what is a SvelteKit?
Just as React was Next, Svelte’s equivalent Web framework is SvelteKit.
It is a framework for building applications with Svelte, including server-side rendering (SSR), routing, code splitting for JS and CSS, adapters for generating different code for different Serverless platforms, and more.
If you have experience with Sapper development, SvelteKit is the successor.
Abandon Snowpack from Vite
I had praised Snowpack in the video, but to my surprise, SvelteKit chose Vite after all.
We met Snowpack when we were imagining the future of SvelteKit.
Snowpack is different from Webpack and Rollup. Snowpack is an unbundled development server, which uses local imports from browsers and does 1:1 replacements for Svelte components and other things in real time.
As a result, applications can be launched quickly, with simple caching and instant module hot loading, and once in the pit, there is no turning back.
Vite is the same as Snowpack.
Vite V1 is not a good fit for SvelteKit, it is vUe-centric (both Vite and Vue were created by Evan You) and makes server-side rendering difficult.
However, Vite V2 has nothing to do with the framework and is designed with SSR as the core.
It has powerful features like CSS code splitting (previously we had to implement it ourselves). When we evaluated the two tools side by side, we came to a very difficult decision: Vite was the right time, the right fit, and the right fit for SvelteKit’s needs and future vision.
We are deeply grateful to the Snowpack team, who worked closely during the early stages of development to chart the course for Web development in the years ahead. It is highly recommended that you try out this great tool.
Death is an extreme sport
SvelteKit is still in beta, but that doesn’t mean nobody dares to use it in production.
Over the past 12 months, I’ve spent a lot of time at The New York Times tracking the coronavirus.
It uses a custom workflow that provides powerful support for most graphics and is not designed for large, multi-page projects.
When we decided late last year to create separate pages for each of the 3,000 or so counties in the US, we quickly realized that the whole project needed to be refactored.
While it’s still far from available, SvelteKit is the only framework that can meet those bizarre needs (as anyone who’s ever worked in a newsroom or worked with a CMS will know).
It now supports county level risk pages, and we are in the process of migrating existing pages to SvelteKit.
Taking orders in the face of a crisis and having the audacity to use a semi-finished product to build an application that millions of people will see is suicidal (I am eternally grateful to my colleagues for their tolerance).
I wouldn’t recommend that for most people.
But it allows us to develop applications faster and more powerful than other frameworks.
The road to V1.0
You can see a list of pending issues for the V1.0 milestone on our issue tracker. In addition, we plan to update the documentation and add more adapters.
Most importantly, we need your feedback to help us make the best application framework possible. Give it a try and let us know which features are missing.
Many thanks to all those who have tried SvelteKit despite the pit warnings and lack of documentation.
Your feedback is invaluable.
I especially want to thank GrygrFlzr for his work maintaining the unofficial documentation and a branch that fixed it when we lacked Windows support.
Dominikg’s work on Svite laid the foundation for Vite integration in SvelteKit.
Now they are the toast of the team.
——–
– Bright and clean, waiting for the days to change