proscenium 0.6.0-x86_64-darwin → 0.7.0-x86_64-darwin

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +128 -107
  3. data/bin/proscenium +0 -0
  4. data/bin/proscenium.h +109 -0
  5. data/config/routes.rb +0 -3
  6. data/lib/proscenium/css_module/class_names_resolver.rb +66 -0
  7. data/lib/proscenium/css_module/resolver.rb +76 -0
  8. data/lib/proscenium/css_module.rb +18 -39
  9. data/lib/proscenium/esbuild/golib.rb +97 -0
  10. data/lib/proscenium/esbuild.rb +32 -0
  11. data/lib/proscenium/helper.rb +0 -23
  12. data/lib/proscenium/log_subscriber.rb +26 -0
  13. data/lib/proscenium/middleware/base.rb +28 -36
  14. data/lib/proscenium/middleware/esbuild.rb +18 -44
  15. data/lib/proscenium/middleware/url.rb +1 -6
  16. data/lib/proscenium/middleware.rb +12 -16
  17. data/lib/proscenium/phlex/component_concerns.rb +27 -0
  18. data/lib/proscenium/phlex/page.rb +62 -0
  19. data/lib/proscenium/phlex/react_component.rb +52 -8
  20. data/lib/proscenium/phlex/resolve_css_modules.rb +67 -0
  21. data/lib/proscenium/phlex.rb +34 -33
  22. data/lib/proscenium/railtie.rb +41 -67
  23. data/lib/proscenium/side_load/ensure_loaded.rb +25 -0
  24. data/lib/proscenium/side_load/helper.rb +25 -0
  25. data/lib/proscenium/side_load/monkey.rb +48 -0
  26. data/lib/proscenium/side_load.rb +58 -52
  27. data/lib/proscenium/version.rb +1 -1
  28. data/lib/proscenium/view_component/react_component.rb +14 -0
  29. data/lib/proscenium/view_component.rb +28 -18
  30. data/lib/proscenium.rb +79 -2
  31. metadata +35 -75
  32. data/app/channels/proscenium/connection.rb +0 -13
  33. data/app/channels/proscenium/reload_channel.rb +0 -9
  34. data/bin/esbuild +0 -0
  35. data/bin/lightningcss +0 -0
  36. data/lib/proscenium/compiler.js +0 -84
  37. data/lib/proscenium/compilers/esbuild/argument_error.js +0 -24
  38. data/lib/proscenium/compilers/esbuild/compile_error.js +0 -148
  39. data/lib/proscenium/compilers/esbuild/css/postcss.js +0 -67
  40. data/lib/proscenium/compilers/esbuild/css_plugin.js +0 -172
  41. data/lib/proscenium/compilers/esbuild/env_plugin.js +0 -46
  42. data/lib/proscenium/compilers/esbuild/http_bundle_plugin.js +0 -53
  43. data/lib/proscenium/compilers/esbuild/import_map/parser.js +0 -178
  44. data/lib/proscenium/compilers/esbuild/import_map/read.js +0 -64
  45. data/lib/proscenium/compilers/esbuild/import_map/resolver.js +0 -95
  46. data/lib/proscenium/compilers/esbuild/import_map/utils.js +0 -25
  47. data/lib/proscenium/compilers/esbuild/resolve_plugin.js +0 -207
  48. data/lib/proscenium/compilers/esbuild/setup_plugin.js +0 -45
  49. data/lib/proscenium/compilers/esbuild/solidjs_plugin.js +0 -24
  50. data/lib/proscenium/compilers/esbuild.bench.js +0 -14
  51. data/lib/proscenium/compilers/esbuild.js +0 -179
  52. data/lib/proscenium/link_to_helper.rb +0 -40
  53. data/lib/proscenium/middleware/lightningcss.rb +0 -64
  54. data/lib/proscenium/middleware/outside_root.rb +0 -26
  55. data/lib/proscenium/middleware/runtime.rb +0 -22
  56. data/lib/proscenium/middleware/static.rb +0 -14
  57. data/lib/proscenium/phlex/component.rb +0 -9
  58. data/lib/proscenium/precompile.rb +0 -31
  59. data/lib/proscenium/runtime/auto_reload.js +0 -40
  60. data/lib/proscenium/runtime/react_shim/index.js +0 -1
  61. data/lib/proscenium/runtime/react_shim/package.json +0 -5
  62. data/lib/proscenium/utils.js +0 -12
  63. 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'
@@ -1,5 +0,0 @@
1
- {
2
- "name": "react_shim",
3
- "private": true,
4
- "sideEffects": false
5
- }
@@ -1,12 +0,0 @@
1
- export async function fileExists(path) {
2
- try {
3
- const fileInfo = await Deno.stat(path)
4
- return fileInfo.isFile
5
- } catch {
6
- return false
7
- }
8
- }
9
-
10
- export function isBareModule(mod) {
11
- return !mod.startsWith('/') && !mod.startsWith('.')
12
- }
@@ -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