All Projects â†’ PoCInnovation â†’ Sveno

PoCInnovation / Sveno

Licence: MIT license
A tool to convert any React JS app to Svelte app 🚀

Programming Languages

python
139335 projects - #7 most used programming language
javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to Sveno

auth
Sapper Authentication Implementation for Wordpress
Stars: ✭ 18 (-67.86%)
Mutual labels:  svelte
svelte-template-hot
Copy of official Svelte template with added HMR support
Stars: ✭ 61 (+8.93%)
Mutual labels:  svelte
s-date-range-picker
📅 A date range picker built with Svelte
Stars: ✭ 13 (-76.79%)
Mutual labels:  svelte
svelte-grid-responsive
Responsive grid system based on Bootstrap for Svelte
Stars: ✭ 41 (-26.79%)
Mutual labels:  svelte
vite-plugin-webfont-dl
⚡ Webfont Download Vite Plugin - Make your Vite site load faster
Stars: ✭ 69 (+23.21%)
Mutual labels:  svelte
year-in-dev
A web tool tool that displays a summary of your DEV.to blog's stats!
Stars: ✭ 22 (-60.71%)
Mutual labels:  svelte
tikz
Random collection of standalone TikZ images
Stars: ✭ 87 (+55.36%)
Mutual labels:  svelte
i18n-unused
The static analyze tool for finding, marking and removing unused and missing i18n translations in your JavaScript project
Stars: ✭ 76 (+35.71%)
Mutual labels:  svelte
wallet-adapter
Modular TypeScript wallet adapters and components for Solana applications.
Stars: ✭ 964 (+1621.43%)
Mutual labels:  svelte
svelte-cloudinary
Cloudinary SDK for Svelte
Stars: ✭ 13 (-76.79%)
Mutual labels:  svelte
perfect-home
firefox newtab/home replacement
Stars: ✭ 101 (+80.36%)
Mutual labels:  svelte
portfolio-svelte
My over-complicated personal site. A place to show off work and writing, and a place to try weird stuff.
Stars: ✭ 24 (-57.14%)
Mutual labels:  svelte
simple-cloud-music
įŪ€æīįš„įš„įŽŽäļ‰æ–đį―‘易䚑éŸģäđæ’­æ”ūå™Ļ
Stars: ✭ 306 (+446.43%)
Mutual labels:  svelte
aqua-fanpage
⚓ æđŠã‚くあ Fanpage created with Svelte and Sveltestrap.
Stars: ✭ 30 (-46.43%)
Mutual labels:  svelte
pittsburgh-steps
A short visual ode to Pittsburgh's many outdoor steps, using data from WPRDC.
Stars: ✭ 23 (-58.93%)
Mutual labels:  svelte
app-idea-generator
ðŸ’Ą Generate app ideas to take inspiration from, or to have a laugh
Stars: ✭ 13 (-76.79%)
Mutual labels:  svelte
svelte-sortable-list
A svelte 3 component that implements a list with animated drag-n-drop functionality.
Stars: ✭ 103 (+83.93%)
Mutual labels:  svelte
form-validation
FormValidation, the best validation library for JavaScript
Stars: ✭ 137 (+144.64%)
Mutual labels:  svelte
ModalFileManager
A file manager built using Svelte and Wails. It has hotkeys that are modal just like Vim and NeoVim.
Stars: ✭ 21 (-62.5%)
Mutual labels:  svelte
svelte-loader-hot
Webpack loader for svelte components with HMR support
Stars: ✭ 22 (-60.71%)
Mutual labels:  svelte

Sveno

 python version  license

Sveno is a component transpiler that transform React components to Svelte components. It only works on simple small non-library components so far, but more updates are coming. ⏎ Sveno aims to become a powerful tool able to transpile complete projects, and to help developpers ðŸ’ŧ discover the advantages of using Svelte. 😎

React to Svelte

Summary

Why Svelte

While React is a library that adds extra weight to your code base and uses a virtual DOM, Svelte compiles it's files to ideal javascript, thus reducing the actual weight ⚖ïļ. As a result, Svelte is significantly faster ðŸƒâšĄ than any framework or library using virtual DOMs when it comes to downloading webpages into a browser.

Learn more here

Setup

You'll need Python3 🐍 and pip3 installed. You will also need npm installed. Install the requirements by launching the script ./install.sh
Congratz ðŸĨģ ! You're ready to go!

Usage

The program takes 2 arguments: the react source folder and a svelte destination folder

python3 ./src/main.py react_source_folder svelte_destination_folder

How it works

  1. The program looks 🔎 through each file, starting from the source root folder, that has a .js or a .jsx extension. Style files with .css extension are also taken into account and can be integrated into the correct svelte component.
  2. Using a set of regex ðŸ”Ī (regular expressions), key elements are gathered and stored into dataclasses. Try some regex here.
  3. Dataclasses ðŸ’ū are the main element that will be worked upon. Class Components, Functionnal Components, Variables, and other important pieces of code have their own dataclass. They are used to access information and transform syntactic elements from react to svelte syntax. Some elements are substituted while others are simply deleted (eg: this.props.name will become name)
  4. New files and folders 📂 are created. Because React files can contain multiple components, contrarly to Svelte files, each component will be translated into a new file of the same name. They will be contained in a folder bearing the name of the initial react file.
    For example, a file named actions.jsx and containing 2 components named simpleAction and doubleAction will result in a folder named actions with two svelte files named simpleAction.svelte and doubleAction.svelte
  5. Components are written 📝 in the new files, using the dataclasses and corresponding templates.

Functionnalities

As of today, the following elements can be transpiled:

  • Functionnal components
  • Class components
  • 'Classic' functions
  • Props
  • Class Lifecycle methods (ComponentWillMount, ComponentDidMount, ComponentDidUpdate, GetSnapshotBeforeUpdate)
  • UseEffect (The functionnal component LifeCycle hook)
  • SetState, UseState, this.state - initialize and set variable values
  • Events (onClick, onMouseMove, etc)

Documentation

  • Install Doxygen
  • To generate the documentation, just do
    • doxygen .doxygen
  • You can now consult the documentation by running the html statically for example with chrome
    • google-chrome doc/html/index.html

Upcoming

  • ReactDOM.render() and entrypoint
  • Better utilitary files handling
  • Loops
  • Conditions
  • Routing
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].