islandjs-rails 0.7.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +118 -4
- data/LICENSE.md +1 -1
- data/README.md +107 -632
- data/lib/islandjs_rails/cli.rb +0 -42
- data/lib/islandjs_rails/configuration.rb +3 -55
- data/lib/islandjs_rails/core.rb +5 -422
- data/lib/islandjs_rails/core_methods.rb +27 -557
- data/lib/islandjs_rails/rails_helpers.rb +71 -278
- data/lib/islandjs_rails/railtie.rb +3 -28
- data/lib/islandjs_rails/tasks.rb +0 -105
- data/lib/islandjs_rails/version.rb +1 -1
- data/lib/islandjs_rails/vite_installer.rb +213 -0
- data/lib/islandjs_rails.rb +0 -113
- data/lib/templates/app/javascript/entrypoints/islands.js +27 -0
- data/lib/templates/app/views/islandjs_demo/index.html.erb +16 -16
- data/lib/templates/app/views/islandjs_demo/react.html.erb +8 -9
- data/lib/templates/vite.config.islands.ts +44 -0
- metadata +24 -14
- data/islandjs-rails.gemspec +0 -55
- data/lib/islandjs_rails/vendor_manager.rb +0 -271
- data/lib/templates/app/javascript/islands/index.js +0 -10
- data/lib/templates/package.json +0 -21
- data/lib/templates/webpack.config.js +0 -85
- data/package.json +0 -12
- data/yarn.lock +0 -1890
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 57e5503d06e52d1f4eca0a444de7d5b0a1a29799f37e227c953a6f7901ec6aec
|
|
4
|
+
data.tar.gz: 4cc9fd1567f4286fbe97305996d327ed37c24a5caf7567cba223fcd1da7fdc23
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bcd4c15db4b17ffd8b99f7a9a8c864aa863b161de4f9143a4ef99f8f458b73893998919e63f88218c277842df5f903b270038c2f2ae7242ed2d3946c08223246
|
|
7
|
+
data.tar.gz: 9c86c69eb088d5ac82038f47bd5cd86bcc4d9f7f8e961da877dec9e02381434870ab3dfbbad8b650cdaffd78b0ab262fa940ed49861db9380caadec9465069df
|
data/CHANGELOG.md
CHANGED
|
@@ -5,11 +5,125 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [2.0.0] - 2026-03-14
|
|
9
|
+
|
|
10
|
+
### ⚠️ BREAKING CHANGES
|
|
11
|
+
|
|
12
|
+
**React is now bundled directly** into your Islands bundle via npm. The entire UMD/vendor system has been removed — no more CDN downloads, vendor directories, or separate script tags.
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
- **`rails islandjs:init`** is now the single setup command — creates directory structure, entrypoint, Vite config, package.json, installs dependencies, and injects layout helper
|
|
16
|
+
- **`islands` helper** just renders the bundle script tag (no more vendor UMD partial)
|
|
17
|
+
- **Entrypoint template** imports React/ReactDOM directly and exposes on `window`
|
|
18
|
+
|
|
19
|
+
### Removed
|
|
20
|
+
- All `islandjs:install/update/remove/sync/clean/config/vendor:*` commands — use `yarn add/upgrade/remove` directly
|
|
21
|
+
- `VendorManager`, `ViteIntegration`, and all UMD/CDN resolution code
|
|
22
|
+
- All vendor-related helpers and configuration options
|
|
23
|
+
|
|
24
|
+
### Migration from 1.x
|
|
25
|
+
|
|
26
|
+
See [UPGRADING.md](UPGRADING.md) for step-by-step instructions. Your `react_component` calls in ERB templates work exactly the same — no view changes needed.
|
|
27
|
+
|
|
28
|
+
## [1.1.0] - 2026-01-16
|
|
29
|
+
|
|
30
|
+
### Removed
|
|
31
|
+
- **Vue Support**: Removed untested Vue framework support to keep the gem focused on battle-tested React integration
|
|
32
|
+
- Removed `vue_component` helper method
|
|
33
|
+
- Removed `generate_vue_mount_script` private method
|
|
34
|
+
- Removed Vue global name mapping from `BUILT_IN_GLOBAL_NAME_OVERRIDES`
|
|
35
|
+
- Updated `island_component` helper to only support React
|
|
36
|
+
- Updated documentation to reflect React-only focus
|
|
37
|
+
|
|
38
|
+
### Changed
|
|
39
|
+
- Updated gem description to reflect React-only focus
|
|
40
|
+
- Simplified framework support messaging in error messages
|
|
41
|
+
|
|
42
|
+
### Fixed
|
|
43
|
+
- **Ruby 4.0 Compatibility**: Added explicit `cgi` gem dependency for test suite compatibility
|
|
44
|
+
- Ruby 4.0+ extracted `cgi` from stdlib, causing VCR gem to fail
|
|
45
|
+
- Added `cgi` as development dependency to ensure test suite works on Ruby 4.0+
|
|
46
|
+
- **Critical: YarnError namespace prefix**: Fixed missing `IslandjsRails::` namespace prefix in YarnError raises
|
|
47
|
+
- Would cause `NameError: uninitialized constant YarnError` at runtime when yarn commands failed
|
|
48
|
+
- Fixed in `core_methods.rb` for add, update, and remove package operations
|
|
49
|
+
- **Consistent Rails.root handling**: Added `root_path` helper method for uniform Rails.root access
|
|
50
|
+
- Prevents crashes when gem used outside Rails context (e.g., in standalone scripts)
|
|
51
|
+
- All file operations now use consistent path resolution
|
|
52
|
+
- **JSON parsing error visibility**: Added debug logging for JSON parse failures
|
|
53
|
+
- Silent failures made debugging difficult
|
|
54
|
+
- Now logs warnings
|
|
55
|
+
- Affects package.json, manifest.json, and Vite config parsing
|
|
56
|
+
|
|
57
|
+
## [1.0.0] - 2025-11-05
|
|
58
|
+
|
|
59
|
+
### 🎉 Major Release: Webpack → Vite Migration
|
|
60
|
+
|
|
61
|
+
This release replaces webpack with Vite for a dramatically faster, more modern build system.
|
|
62
|
+
|
|
63
|
+
### ⚠️ BREAKING CHANGES
|
|
64
|
+
|
|
65
|
+
**Build System**:
|
|
66
|
+
- Replaced webpack with Vite as the build tool
|
|
67
|
+
- Config file changed: `webpack.config.js` → `vite.config.islands.ts`
|
|
68
|
+
- Build command changed: `yarn build` → `yarn build:islands`
|
|
69
|
+
- Watch command changed: `yarn watch` → `yarn watch:islands`
|
|
70
|
+
- Manifest location changed: `public/islands_manifest.json` → `public/islands/.vite/manifest.json`
|
|
71
|
+
|
|
72
|
+
**Dependencies**:
|
|
73
|
+
- Removed: `webpack`, `webpack-cli`, `webpack-manifest-plugin`
|
|
74
|
+
- Added: `vite`, `@vitejs/plugin-react`
|
|
75
|
+
- Note: Uses Vite directly via npm/yarn, not the `vite_rails` Ruby gem
|
|
76
|
+
|
|
77
|
+
**Files**:
|
|
78
|
+
- `app/javascript/islands/index.js` is no longer created (Vite uses entrypoints directly)
|
|
79
|
+
- New file: `vite.config.islands.ts` for Islands-specific Vite configuration
|
|
80
|
+
|
|
81
|
+
### ✅ What Stays the Same
|
|
82
|
+
|
|
83
|
+
**No code changes needed!** All runtime APIs remain identical:
|
|
84
|
+
- All Rails helpers work the same (`react_component`, `island_partials`, etc.)
|
|
85
|
+
- Island components don't need any changes
|
|
86
|
+
- ERB templates don't need any changes
|
|
87
|
+
- UMD vendor system works identically
|
|
88
|
+
- All `rails islandjs:*` commands work the same way
|
|
89
|
+
|
|
90
|
+
### 🚀 Benefits
|
|
91
|
+
|
|
92
|
+
- ⚡ **2-10x faster builds** compared to webpack
|
|
93
|
+
- 🔥 **Instant Hot Module Replacement (HMR)** during development
|
|
94
|
+
- 📦 **Smaller bundle sizes** with superior tree-shaking
|
|
95
|
+
- 🎯 **Simpler configuration** - no complex webpack setup needed
|
|
96
|
+
- 🌐 **Modern tooling** - built for ES modules and modern JavaScript
|
|
97
|
+
- 🔧 **Lightweight integration** - uses Vite directly without additional Ruby dependencies
|
|
98
|
+
|
|
99
|
+
### 📚 Upgrade Guide
|
|
100
|
+
|
|
101
|
+
See [UPGRADING.md](UPGRADING.md) for detailed migration instructions. Summary:
|
|
102
|
+
|
|
103
|
+
1. Update gem: `bundle update islandjs-rails`
|
|
104
|
+
2. Remove webpack files: `rm webpack.config.js`
|
|
105
|
+
3. Reinitialize: `rails islandjs:init`
|
|
106
|
+
4. Rebuild: `yarn build:islands`
|
|
107
|
+
|
|
108
|
+
### Changed
|
|
109
|
+
|
|
110
|
+
- Updated all documentation to reference Vite instead of webpack
|
|
111
|
+
- CLI and Rake task descriptions now mention "Vite externals" instead of "webpack externals"
|
|
112
|
+
- Build output messages updated for Vite workflow
|
|
113
|
+
- Error messages and hints updated to reference Vite commands
|
|
114
|
+
|
|
115
|
+
### Removed
|
|
116
|
+
|
|
117
|
+
- Webpack configuration template
|
|
118
|
+
- Webpack-related dependencies from package.json template
|
|
119
|
+
- `ESSENTIAL_DEPENDENCIES` constant (replaced with inline Vite deps)
|
|
120
|
+
- References to webpack in README, gemspec, and all documentation
|
|
121
|
+
|
|
8
122
|
## [0.7.0] - 2025-10-27
|
|
9
123
|
|
|
10
124
|
### Added
|
|
11
|
-
- **CleanIslandsPlugin**:
|
|
12
|
-
- Simplified build scripts by removing manual
|
|
125
|
+
- **CleanIslandsPlugin**: Build plugin that automatically removes old island bundle files from the public directory after new builds, preventing stale file accumulation
|
|
126
|
+
- Simplified build scripts by removing manual cleanup commands
|
|
13
127
|
|
|
14
128
|
## [0.6.0] - 2025-10-24
|
|
15
129
|
|
|
@@ -20,8 +134,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
20
134
|
## [0.5.0] - 2025-09-29
|
|
21
135
|
|
|
22
136
|
### Added
|
|
23
|
-
- **CSP support for script tags**: All IslandJS-generated `<script>` tags now automatically include a CSP nonce when one is present in the Rails request.
|
|
24
|
-
- **Flexible script attributes**: Helpers (`react_component`,
|
|
137
|
+
- **CSP support for script tags**: All IslandJS-generated `<script>` tags now automatically include a CSP nonce when one is present in the Rails request.
|
|
138
|
+
- **Flexible script attributes**: Helpers (`react_component`, etc.) now support passing standard script attributes (`nonce`, `defer`, `async`, `crossorigin`, `integrity`).
|
|
25
139
|
|
|
26
140
|
## [0.4.0] - 2025-08-10
|
|
27
141
|
|
data/LICENSE.md
CHANGED