wasmify-rails 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/generators/wasmify/pwa/pwa_generator.rb +1 -1
- data/lib/generators/wasmify/pwa/templates/pwa/boot.html +128 -96
- data/lib/generators/wasmify/pwa/templates/pwa/vite.config.js +8 -0
- data/lib/rack/data_uri_uploads.rb +3 -0
- data/lib/wasmify/rails/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b2a978cc93a769fd29e2cfa52a5c4c8aef4d6747ef05255fdd0b6be54618a98
|
4
|
+
data.tar.gz: 402d4df38fb308c5645dbd2b7379733bf6fe633c6d06cb0faa1504a85dc13cf5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e02c1a8081d57ea23f0efa5b6fe486cb0db7efab55bb3611337409703090cbbdb8f5cca667333de2874707d3d1eedfee524aa05cf8d59b83b5712439b85bd52b
|
7
|
+
data.tar.gz: 8a55254d6f625d54ac9757d94cfda2466d66bf8457d75f88cd8e0297e354caf4e27d60e4d94c51d761b40a79b4766098b13b65d2dd0833f5cc643f14647ab349
|
data/CHANGELOG.md
CHANGED
@@ -1,102 +1,134 @@
|
|
1
1
|
<!doctype html>
|
2
2
|
<html lang="en">
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
3
|
+
<head>
|
4
|
+
<meta charset="UTF-8" />
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
6
|
+
<meta name="og:title" content="Rails on Wasm" />
|
7
|
+
<meta name="og:description" content="Rails on Wasm launcher" />
|
8
|
+
<title>Rails on Wasm | Launch</title>
|
9
|
+
<script type="module" src="/boot.js"></script>
|
10
|
+
<style>
|
11
|
+
main {
|
12
|
+
max-width: 800px;
|
13
|
+
margin: 0 auto;
|
14
|
+
padding: 1em;
|
15
|
+
}
|
16
|
+
|
17
|
+
#boot-console-output {
|
18
|
+
background-color: #0c0c0c;
|
19
|
+
color: #f8f8f2;
|
20
|
+
font-family: monospace;
|
21
|
+
font-size: 0.8em;
|
22
|
+
padding: 1em;
|
23
|
+
white-space: pre-wrap;
|
24
|
+
min-height: 200px;
|
25
|
+
overflow-y: scroll;
|
26
|
+
margin-top: 0;
|
27
|
+
}
|
28
|
+
|
29
|
+
#buttons {
|
30
|
+
display: flex;
|
31
|
+
justify-content: flex-start;
|
32
|
+
gap: 0.5em;
|
33
|
+
}
|
34
|
+
|
35
|
+
#launch-button {
|
36
|
+
background-color: #007bff;
|
37
|
+
color: #fff;
|
38
|
+
border: none;
|
39
|
+
padding: 0.5em 1em;
|
40
|
+
font-size: 1em;
|
41
|
+
cursor: pointer;
|
42
|
+
border: 1px solid #007bff;
|
43
|
+
}
|
44
|
+
#launch-button:disabled {
|
45
|
+
background-color: #ccc;
|
46
|
+
border-color: #000;
|
47
|
+
color: #666;
|
48
|
+
}
|
49
|
+
#reboot-button {
|
50
|
+
background-color: #dc3545;
|
51
|
+
color: #fff;
|
52
|
+
border: none;
|
53
|
+
padding: 0.5em 1em;
|
54
|
+
font-size: 1em;
|
55
|
+
cursor: pointer;
|
56
|
+
border: 1px solid #dc3545;
|
57
|
+
}
|
58
|
+
#reboot-button:disabled {
|
59
|
+
background-color: #ccc;
|
60
|
+
color: #666;
|
61
|
+
border-color: #000;
|
62
|
+
}
|
63
|
+
#reload-button {
|
64
|
+
background-color: #eeeeee;
|
65
|
+
color: #333;
|
66
|
+
border: none;
|
67
|
+
padding: 0.5em 1em;
|
68
|
+
font-size: 1em;
|
69
|
+
cursor: pointer;
|
70
|
+
border: 1px solid #333;
|
71
|
+
}
|
72
|
+
#reload-button:disabled {
|
73
|
+
background-color: #ccc;
|
74
|
+
color: #666;
|
75
|
+
}
|
76
|
+
#reload-debug-button {
|
77
|
+
background-color: rgb(159, 166, 40);
|
78
|
+
color: #000;
|
79
|
+
border: none;
|
80
|
+
padding: 0.5em 1em;
|
81
|
+
font-size: 1em;
|
82
|
+
cursor: pointer;
|
83
|
+
border: 1px solid #000;
|
84
|
+
}
|
85
|
+
#reload-debug-button:disabled {
|
86
|
+
background-color: #ccc;
|
87
|
+
color: #666;
|
88
|
+
}
|
89
|
+
|
90
|
+
header {
|
91
|
+
display: flex;
|
92
|
+
justify-content: space-between;
|
93
|
+
align-items: center;
|
94
|
+
margin-bottom: 1em;
|
95
|
+
}
|
96
|
+
|
97
|
+
.header--links {
|
98
|
+
display: flex;
|
99
|
+
gap: 1em;
|
100
|
+
}
|
101
|
+
</style>
|
102
|
+
</head>
|
103
|
+
<body>
|
104
|
+
<main>
|
105
|
+
<header>
|
76
106
|
<h1>Rails on Wasm 🚀</h1>
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
107
|
+
</header>
|
108
|
+
<p>
|
109
|
+
Wait for the Service Worker to install and boot the app, and then hit
|
110
|
+
the "Launch" button to run a Rails application in your browser!
|
111
|
+
</p>
|
81
112
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
113
|
+
<p id="buttons">
|
114
|
+
<button id="launch-button" disabled>Launch</button>
|
115
|
+
<button id="reload-button" disabled>Reload Rails</button>
|
116
|
+
<button id="reload-debug-button" disabled>
|
117
|
+
Reload Rails (debug mode)
|
118
|
+
</button>
|
119
|
+
<button id="reboot-button" disabled>Hard Reset*</button>
|
120
|
+
</p>
|
90
121
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
</
|
122
|
+
<div id="boot-message"></div>
|
123
|
+
<progress id="boot-progress" max="100" value="0"></progress>
|
124
|
+
<pre id="boot-console-output"></pre>
|
125
|
+
<hr />
|
126
|
+
<p>
|
127
|
+
<small>
|
128
|
+
* Please ensure you close all tabs of this app before rebooting to
|
129
|
+
unregister the old Service Worker.
|
130
|
+
</small>
|
131
|
+
</p>
|
132
|
+
</main>
|
133
|
+
</body>
|
102
134
|
</html>
|
@@ -11,6 +11,14 @@ export default defineConfig({
|
|
11
11
|
optimizeDeps: {
|
12
12
|
exclude: ["@sqlite.org/sqlite-wasm"],
|
13
13
|
},
|
14
|
+
build: {
|
15
|
+
rollupOptions: {
|
16
|
+
input: {
|
17
|
+
main: resolve(__dirname, 'index.html'),
|
18
|
+
boot: resolve(__dirname, 'boot.html'),
|
19
|
+
},
|
20
|
+
},
|
21
|
+
},
|
14
22
|
plugins: [
|
15
23
|
VitePWA({
|
16
24
|
srcDir: ".",
|
@@ -21,6 +21,7 @@ module Rack
|
|
21
21
|
|
22
22
|
if request.post? || request.put? || request.patch?
|
23
23
|
transform_params(request.params)
|
24
|
+
env["action_dispatch.request.request_parameters"] = request.params
|
24
25
|
end
|
25
26
|
|
26
27
|
@app.call(env)
|
@@ -48,6 +49,8 @@ module Rack
|
|
48
49
|
encoding = matches[2]
|
49
50
|
data = matches[3]
|
50
51
|
|
52
|
+
return if data.empty?
|
53
|
+
|
51
54
|
file_data = Base64.decode64(data)
|
52
55
|
|
53
56
|
file = Tempfile.new(["upload", mime_to_extension(content_type)])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wasmify-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Dementyev
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -181,7 +181,7 @@ metadata:
|
|
181
181
|
documentation_uri: https://github.com/palkan/wasmify-rails
|
182
182
|
homepage_uri: https://github.com/palkan/wasmify-rails
|
183
183
|
source_code_uri: https://github.com/palkan/wasmify-rails
|
184
|
-
post_install_message:
|
184
|
+
post_install_message:
|
185
185
|
rdoc_options: []
|
186
186
|
require_paths:
|
187
187
|
- lib
|
@@ -197,7 +197,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
197
197
|
version: '0'
|
198
198
|
requirements: []
|
199
199
|
rubygems_version: 3.5.22
|
200
|
-
signing_key:
|
200
|
+
signing_key:
|
201
201
|
specification_version: 4
|
202
202
|
summary: Tools and extensions to package Rails apps as Wasm modules
|
203
203
|
test_files: []
|