You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 11, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+23-19Lines changed: 23 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,13 @@
1
-
# Svelte::Rails
1
+
# Svelte-Rails
2
2
3
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/svelte/rails`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+
Svelte-Rails integrates [Svelte](https://svelte.dev/)with Ruby on Rails. It has the following features:
4
4
5
-
TODO: Delete this and the text above, and describe your gem
5
+
* Automatically renders Svelte server-side and client-side
6
+
* Supports Webpacker >= 4.2 and Ruby on Rails >= 6
6
7
7
-
## Installation
8
+
## Usage
9
+
10
+
Make sure, you have [set-up Webpacker](https://github.com/rails/webpacker#installation) and it's [Svelte integration](https://github.com/rails/webpacker/blob/master/docs/integrations.md#svelte).
8
11
9
12
Add this line to your application's Gemfile:
10
13
@@ -15,30 +18,31 @@ gem 'svelte-rails'
15
18
And then execute:
16
19
17
20
$ bundle install
21
+
$ rails generate svelte:install
18
22
19
-
Or install it yourself as:
20
-
21
-
$ gem install svelte-rails
22
-
23
-
## Usage
23
+
An example Rails app with svelte-rails can be seen here:
24
+
https://github.com/nning/rails-svelte-poc
24
25
25
-
TODO: Write usage instructions here
26
+
## View Helper
26
27
27
-
## Development
28
+
```erb
29
+
<%= svelte_component(:Hello, name: 'Svelte') %>
30
+
```
28
31
29
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
32
+
## Missing Features
30
33
31
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
34
+
* Better documentation for setup
35
+
* Turbolinks integration
36
+
* Rails generator for initial setup (the previously mentioned line does not work, yet)
37
+
* HMR and Bundle consistency (server-rendered HTML is cached and client-side updates on changes to the sources)
38
+
* Render components directly from controllers
39
+
* Generator for components
40
+
* Render pools
32
41
33
42
## Contributing
34
43
35
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/svelte-rails. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/svelte-rails/blob/master/CODE_OF_CONDUCT.md).
36
-
44
+
Bug reports and pull requests are welcome on GitHub at https://github.com/nning/svelte-rails. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/nning/svelte-rails/blob/master/CODE_OF_CONDUCT.md).
37
45
38
46
## License
39
47
40
48
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
41
-
42
-
## Code of Conduct
43
-
44
-
Everyone interacting in the Svelte::Rails project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/svelte-rails/blob/master/CODE_OF_CONDUCT.md).
0 commit comments