proscenium 0.6.0-x86_64-linux → 0.7.0-x86_64-linux
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +128 -107
- data/lib/proscenium/css_module/class_names_resolver.rb +66 -0
- data/lib/proscenium/css_module/resolver.rb +76 -0
- data/lib/proscenium/css_module.rb +18 -39
- data/lib/proscenium/esbuild/golib.rb +97 -0
- data/lib/proscenium/esbuild.rb +32 -0
- data/lib/proscenium/ext/proscenium +0 -0
- data/lib/proscenium/ext/proscenium.h +109 -0
- data/lib/proscenium/helper.rb +0 -23
- data/lib/proscenium/log_subscriber.rb +26 -0
- data/lib/proscenium/middleware/base.rb +28 -36
- data/lib/proscenium/middleware/esbuild.rb +18 -44
- data/lib/proscenium/middleware/url.rb +1 -6
- data/lib/proscenium/middleware.rb +12 -16
- data/lib/proscenium/phlex/component_concerns.rb +27 -0
- data/lib/proscenium/phlex/page.rb +62 -0
- data/lib/proscenium/phlex/react_component.rb +52 -8
- data/lib/proscenium/phlex/resolve_css_modules.rb +67 -0
- data/lib/proscenium/phlex.rb +34 -33
- data/lib/proscenium/railtie.rb +41 -67
- data/lib/proscenium/side_load/ensure_loaded.rb +25 -0
- data/lib/proscenium/side_load/helper.rb +25 -0
- data/lib/proscenium/side_load/monkey.rb +48 -0
- data/lib/proscenium/side_load.rb +58 -52
- data/lib/proscenium/version.rb +1 -1
- data/lib/proscenium/view_component/react_component.rb +14 -0
- data/lib/proscenium/view_component.rb +28 -18
- data/lib/proscenium.rb +79 -2
- metadata +35 -77
- data/app/channels/proscenium/connection.rb +0 -13
- data/app/channels/proscenium/reload_channel.rb +0 -9
- data/bin/esbuild +0 -0
- data/bin/lightningcss +0 -0
- data/config/routes.rb +0 -7
- data/lib/proscenium/compiler.js +0 -84
- data/lib/proscenium/compilers/esbuild/argument_error.js +0 -24
- data/lib/proscenium/compilers/esbuild/compile_error.js +0 -148
- data/lib/proscenium/compilers/esbuild/css/postcss.js +0 -67
- data/lib/proscenium/compilers/esbuild/css_plugin.js +0 -172
- data/lib/proscenium/compilers/esbuild/env_plugin.js +0 -46
- data/lib/proscenium/compilers/esbuild/http_bundle_plugin.js +0 -53
- data/lib/proscenium/compilers/esbuild/import_map/parser.js +0 -178
- data/lib/proscenium/compilers/esbuild/import_map/read.js +0 -64
- data/lib/proscenium/compilers/esbuild/import_map/resolver.js +0 -95
- data/lib/proscenium/compilers/esbuild/import_map/utils.js +0 -25
- data/lib/proscenium/compilers/esbuild/resolve_plugin.js +0 -207
- data/lib/proscenium/compilers/esbuild/setup_plugin.js +0 -45
- data/lib/proscenium/compilers/esbuild/solidjs_plugin.js +0 -24
- data/lib/proscenium/compilers/esbuild.bench.js +0 -14
- data/lib/proscenium/compilers/esbuild.js +0 -179
- data/lib/proscenium/link_to_helper.rb +0 -40
- data/lib/proscenium/middleware/lightningcss.rb +0 -64
- data/lib/proscenium/middleware/outside_root.rb +0 -26
- data/lib/proscenium/middleware/runtime.rb +0 -22
- data/lib/proscenium/middleware/static.rb +0 -14
- data/lib/proscenium/phlex/component.rb +0 -9
- data/lib/proscenium/precompile.rb +0 -31
- data/lib/proscenium/runtime/auto_reload.js +0 -40
- data/lib/proscenium/runtime/react_shim/index.js +0 -1
- data/lib/proscenium/runtime/react_shim/package.json +0 -5
- data/lib/proscenium/utils.js +0 -12
- data/lib/tasks/assets.rake +0 -19
@@ -1,40 +0,0 @@
|
|
1
|
-
import { createConsumer } from 'https://esm.sh/v96/@rails/actioncable@7.0.4/es2022/actioncable.js'
|
2
|
-
|
3
|
-
export default socketPath => {
|
4
|
-
const uid = (Date.now() + ((Math.random() * 100) | 0)).toString()
|
5
|
-
const consumer = createConsumer(`${socketPath}?uid=${uid}`)
|
6
|
-
|
7
|
-
consumer.subscriptions.create('Proscenium::ReloadChannel', {
|
8
|
-
received: debounce(() => {
|
9
|
-
console.log('[Proscenium] Files changed; reloading...')
|
10
|
-
location.reload()
|
11
|
-
}, 200, true),
|
12
|
-
|
13
|
-
connected() {
|
14
|
-
console.log('[Proscenium] Auto-reload websocket connected')
|
15
|
-
},
|
16
|
-
|
17
|
-
disconnected() {
|
18
|
-
console.log('[Proscenium] Auto-reload websocket disconnected')
|
19
|
-
}
|
20
|
-
})
|
21
|
-
}
|
22
|
-
|
23
|
-
function debounce(func, wait, immediate) {
|
24
|
-
let timeout
|
25
|
-
|
26
|
-
return function () {
|
27
|
-
const args = arguments
|
28
|
-
|
29
|
-
const later = () => {
|
30
|
-
timeout = null
|
31
|
-
!immediate && func.apply(this, args)
|
32
|
-
}
|
33
|
-
|
34
|
-
const callNow = immediate && !timeout
|
35
|
-
clearTimeout(timeout)
|
36
|
-
timeout = setTimeout(later, wait)
|
37
|
-
|
38
|
-
callNow && func.apply(this, args)
|
39
|
-
}
|
40
|
-
}
|
@@ -1 +0,0 @@
|
|
1
|
-
export { createElement as reactCreateElement, Fragment as ReactFragment } from 'react'
|
data/lib/proscenium/utils.js
DELETED
data/lib/tasks/assets.rake
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
namespace :proscenium do
|
4
|
-
desc 'Compile all your assets with Proscenium'
|
5
|
-
task precompile: :environment do
|
6
|
-
puts 'Precompiling assets with Proscenium...'
|
7
|
-
Proscenium::Precompile.call
|
8
|
-
puts 'Proscenium successfully precompiled your assets 🎉'
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
if Rake::Task.task_defined?('assets:precompile')
|
13
|
-
Rake::Task['assets:precompile'].enhance do
|
14
|
-
Rake::Task['proscenium:precompile'].invoke
|
15
|
-
end
|
16
|
-
else
|
17
|
-
Rake::Task.define_task('assets:precompile' => ['proscenium:precompile'])
|
18
|
-
Rake::Task.define_task('assets:clean') # null task just so Heroku builds don't fail
|
19
|
-
end
|