-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for detecting Hotwire Native Components (#208)
* Add support for detecting Hotwire Native Components * Remove usused imports
- Loading branch information
Showing
33 changed files
with
701 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
test/fixtures/esbuild-hotwire-native-bridge/app/javascript/application.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Entry point for the build script in your package.json | ||
import "./controllers" |
9 changes: 9 additions & 0 deletions
9
test/fixtures/esbuild-hotwire-native-bridge/app/javascript/controllers/application.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Application } from "@hotwired/stimulus" | ||
|
||
const application = Application.start() | ||
|
||
// Configure Stimulus development experience | ||
application.debug = false | ||
window.Stimulus = application | ||
|
||
export { application } |
7 changes: 7 additions & 0 deletions
7
...ures/esbuild-hotwire-native-bridge/app/javascript/controllers/bridge/button_controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { BridgeComponent } from "@hotwired/hotwire-native-bridge" | ||
|
||
export default class extends BridgeComponent { | ||
static component = "button" | ||
|
||
connect() {} | ||
} |
11 changes: 11 additions & 0 deletions
11
test/fixtures/esbuild-hotwire-native-bridge/app/javascript/controllers/hello_controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Controller } from "@hotwired/stimulus" | ||
|
||
export class NonDefaultExportController extends Controller {} | ||
|
||
export default class extends Controller { | ||
static targets = ["name", "output"]; | ||
|
||
connect() { | ||
|
||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
test/fixtures/esbuild-hotwire-native-bridge/app/javascript/controllers/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// This file is auto-generated by ./bin/rails stimulus:manifest:update | ||
// Run that command whenever you add a new controller or create them with | ||
// ./bin/rails generate stimulus controllerName | ||
|
||
import { application } from "./application" | ||
|
||
import HelloController from "./hello_controller" | ||
application.register("hello", HelloController) | ||
|
||
import BridgeButtonComponent from "./bridge/button_controller" | ||
application.register("bridge--button", BridgeButtonComponent) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "esbuild-hotwire-native-bridge", | ||
"private": true, | ||
"dependencies": { | ||
"@hotwired/hotwire-native-bridge": "^1.0.0", | ||
"@hotwired/stimulus": "^3.2.2", | ||
"esbuild": "^0.20.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. | ||
# yarn lockfile v1 | ||
|
||
|
||
"@esbuild/[email protected]": | ||
version "0.20.0" | ||
resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.20.0.tgz#509621cca4e67caf0d18561a0c56f8b70237472f" | ||
integrity sha512-fGFDEctNh0CcSwsiRPxiaqX0P5rq+AqE0SRhYGZ4PX46Lg1FNR6oCxJghf8YgY0WQEgQuh3lErUFE4KxLeRmmw== | ||
|
||
"@esbuild/[email protected]": | ||
version "0.20.0" | ||
resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.20.0.tgz#109a6fdc4a2783fc26193d2687827045d8fef5ab" | ||
integrity sha512-aVpnM4lURNkp0D3qPoAzSG92VXStYmoVPOgXveAUoQBWRSuQzt51yvSju29J6AHPmwY1BjH49uR29oyfH1ra8Q== | ||
|
||
"@esbuild/[email protected]": | ||
version "0.20.0" | ||
resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.20.0.tgz#1397a2c54c476c4799f9b9073550ede496c94ba5" | ||
integrity sha512-3bMAfInvByLHfJwYPJRlpTeaQA75n8C/QKpEaiS4HrFWFiJlNI0vzq/zCjBrhAYcPyVPG7Eo9dMrcQXuqmNk5g== | ||
|
||
"@esbuild/[email protected]": | ||
version "0.20.0" | ||
resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.20.0.tgz#2b615abefb50dc0a70ac313971102f4ce2fdb3ca" | ||
integrity sha512-uK7wAnlRvjkCPzh8jJ+QejFyrP8ObKuR5cBIsQZ+qbMunwR8sbd8krmMbxTLSrDhiPZaJYKQAU5Y3iMDcZPhyQ== | ||
|
||
"@esbuild/[email protected]": | ||
version "0.20.0" | ||
resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.20.0.tgz#5c122ed799eb0c35b9d571097f77254964c276a2" | ||
integrity sha512-AjEcivGAlPs3UAcJedMa9qYg9eSfU6FnGHJjT8s346HSKkrcWlYezGE8VaO2xKfvvlZkgAhyvl06OJOxiMgOYQ== | ||
|
||
"@esbuild/[email protected]": | ||
version "0.20.0" | ||
resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.20.0.tgz#9561d277002ba8caf1524f209de2b22e93d170c1" | ||
integrity sha512-bsgTPoyYDnPv8ER0HqnJggXK6RyFy4PH4rtsId0V7Efa90u2+EifxytE9pZnsDgExgkARy24WUQGv9irVbTvIw== | ||
|
||
"@esbuild/[email protected]": | ||
version "0.20.0" | ||
resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.0.tgz#84178986a3138e8500d17cc380044868176dd821" | ||
integrity sha512-kQ7jYdlKS335mpGbMW5tEe3IrQFIok9r84EM3PXB8qBFJPSc6dpWfrtsC/y1pyrz82xfUIn5ZrnSHQQsd6jebQ== | ||
|
||
"@esbuild/[email protected]": | ||
version "0.20.0" | ||
resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.20.0.tgz#3f9ce53344af2f08d178551cd475629147324a83" | ||
integrity sha512-uG8B0WSepMRsBNVXAQcHf9+Ko/Tr+XqmK7Ptel9HVmnykupXdS4J7ovSQUIi0tQGIndhbqWLaIL/qO/cWhXKyQ== | ||
|
||
"@esbuild/[email protected]": | ||
version "0.20.0" | ||
resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.20.0.tgz#24efa685515689df4ecbc13031fa0a9dda910a11" | ||
integrity sha512-uTtyYAP5veqi2z9b6Gr0NUoNv9F/rOzI8tOD5jKcCvRUn7T60Bb+42NDBCWNhMjkQzI0qqwXkQGo1SY41G52nw== | ||
|
||
"@esbuild/[email protected]": | ||
version "0.20.0" | ||
resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.20.0.tgz#6b586a488e02e9b073a75a957f2952b3b6e87b4c" | ||
integrity sha512-2ezuhdiZw8vuHf1HKSf4TIk80naTbP9At7sOqZmdVwvvMyuoDiZB49YZKLsLOfKIr77+I40dWpHVeY5JHpIEIg== | ||
|
||
"@esbuild/[email protected]": | ||
version "0.20.0" | ||
resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.20.0.tgz#84ce7864f762708dcebc1b123898a397dea13624" | ||
integrity sha512-c88wwtfs8tTffPaoJ+SQn3y+lKtgTzyjkD8NgsyCtCmtoIC8RDL7PrJU05an/e9VuAke6eJqGkoMhJK1RY6z4w== | ||
|
||
"@esbuild/[email protected]": | ||
version "0.20.0" | ||
resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.20.0.tgz#1922f571f4cae1958e3ad29439c563f7d4fd9037" | ||
integrity sha512-lR2rr/128/6svngnVta6JN4gxSXle/yZEZL3o4XZ6esOqhyR4wsKyfu6qXAL04S4S5CgGfG+GYZnjFd4YiG3Aw== | ||
|
||
"@esbuild/[email protected]": | ||
version "0.20.0" | ||
resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.20.0.tgz#7ca1bd9df3f874d18dbf46af009aebdb881188fe" | ||
integrity sha512-9Sycc+1uUsDnJCelDf6ZNqgZQoK1mJvFtqf2MUz4ujTxGhvCWw+4chYfDLPepMEvVL9PDwn6HrXad5yOrNzIsQ== | ||
|
||
"@esbuild/[email protected]": | ||
version "0.20.0" | ||
resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.20.0.tgz#8f95baf05f9486343bceeb683703875d698708a4" | ||
integrity sha512-CoWSaaAXOZd+CjbUTdXIJE/t7Oz+4g90A3VBCHLbfuc5yUQU/nFDLOzQsN0cdxgXd97lYW/psIIBdjzQIwTBGw== | ||
|
||
"@esbuild/[email protected]": | ||
version "0.20.0" | ||
resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.20.0.tgz#ca63b921d5fe315e28610deb0c195e79b1a262ca" | ||
integrity sha512-mlb1hg/eYRJUpv8h/x+4ShgoNLL8wgZ64SUr26KwglTYnwAWjkhR2GpoKftDbPOCnodA9t4Y/b68H4J9XmmPzA== | ||
|
||
"@esbuild/[email protected]": | ||
version "0.20.0" | ||
resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.20.0.tgz#cb3d069f47dc202f785c997175f2307531371ef8" | ||
integrity sha512-fgf9ubb53xSnOBqyvWEY6ukBNRl1mVX1srPNu06B6mNsNK20JfH6xV6jECzrQ69/VMiTLvHMicQR/PgTOgqJUQ== | ||
|
||
"@esbuild/[email protected]": | ||
version "0.20.0" | ||
resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.20.0.tgz#ac617e0dc14e9758d3d7efd70288c14122557dc7" | ||
integrity sha512-H9Eu6MGse++204XZcYsse1yFHmRXEWgadk2N58O/xd50P9EvFMLJTQLg+lB4E1cF2xhLZU5luSWtGTb0l9UeSg== | ||
|
||
"@esbuild/[email protected]": | ||
version "0.20.0" | ||
resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.20.0.tgz#6cc778567f1513da6e08060e0aeb41f82eb0f53c" | ||
integrity sha512-lCT675rTN1v8Fo+RGrE5KjSnfY0x9Og4RN7t7lVrN3vMSjy34/+3na0q7RIfWDAj0e0rCh0OL+P88lu3Rt21MQ== | ||
|
||
"@esbuild/[email protected]": | ||
version "0.20.0" | ||
resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.20.0.tgz#76848bcf76b4372574fb4d06cd0ed1fb29ec0fbe" | ||
integrity sha512-HKoUGXz/TOVXKQ+67NhxyHv+aDSZf44QpWLa3I1lLvAwGq8x1k0T+e2HHSRvxWhfJrFxaaqre1+YyzQ99KixoA== | ||
|
||
"@esbuild/[email protected]": | ||
version "0.20.0" | ||
resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.20.0.tgz#ea4cd0639bf294ad51bc08ffbb2dac297e9b4706" | ||
integrity sha512-GDwAqgHQm1mVoPppGsoq4WJwT3vhnz/2N62CzhvApFD1eJyTroob30FPpOZabN+FgCjhG+AgcZyOPIkR8dfD7g== | ||
|
||
"@esbuild/[email protected]": | ||
version "0.20.0" | ||
resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.20.0.tgz#a5c171e4a7f7e4e8be0e9947a65812c1535a7cf0" | ||
integrity sha512-0vYsP8aC4TvMlOQYozoksiaxjlvUcQrac+muDqj1Fxy6jh9l9CZJzj7zmh8JGfiV49cYLTorFLxg7593pGldwQ== | ||
|
||
"@esbuild/[email protected]": | ||
version "0.20.0" | ||
resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.20.0.tgz#f8ac5650c412d33ea62d7551e0caf82da52b7f85" | ||
integrity sha512-p98u4rIgfh4gdpV00IqknBD5pC84LCub+4a3MO+zjqvU5MVXOc3hqR2UgT2jI2nh3h8s9EQxmOsVI3tyzv1iFg== | ||
|
||
"@esbuild/[email protected]": | ||
version "0.20.0" | ||
resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.20.0.tgz#2efddf82828aac85e64cef62482af61c29561bee" | ||
integrity sha512-NgJnesu1RtWihtTtXGFMU5YSE6JyyHPMxCwBZK7a6/8d31GuSo9l0Ss7w1Jw5QnKUawG6UEehs883kcXf5fYwg== | ||
|
||
"@hotwired/hotwire-native-bridge@^1.0.0": | ||
version "1.0.0" | ||
resolved "https://registry.yarnpkg.com/@hotwired/hotwire-native-bridge/-/hotwire-native-bridge-1.0.0.tgz#84579dda2a7980b25e26fb98b3cd0d86a101899c" | ||
integrity sha512-T8I93L+/U/iVNqLJpd0eHosL57Ay81iha7QcauwFakTDH6ZGT1tPCX4Ci2v3OtH3GFtLGd+iVUtNdKNaqm3cUw== | ||
|
||
"@hotwired/stimulus@^3.2.2": | ||
version "3.2.2" | ||
resolved "https://registry.yarnpkg.com/@hotwired/stimulus/-/stimulus-3.2.2.tgz#071aab59c600fed95b97939e605ff261a4251608" | ||
integrity sha512-eGeIqNOQpXoPAIP7tC1+1Yc1yl1xnwYqg+3mzqxyrbE5pg5YFBZcA6YoTiByJB6DKAEsiWtl6tjTJS4IYtbB7A== | ||
|
||
esbuild@^0.20.0: | ||
version "0.20.0" | ||
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.20.0.tgz#a7170b63447286cd2ff1f01579f09970e6965da4" | ||
integrity sha512-6iwE3Y2RVYCME1jLpBqq7LQWK3MW6vjV2bZy6gt/WrqkY+WE74Spyc0ThAOYpMtITvnjX09CrC6ym7A/m9mebA== | ||
optionalDependencies: | ||
"@esbuild/aix-ppc64" "0.20.0" | ||
"@esbuild/android-arm" "0.20.0" | ||
"@esbuild/android-arm64" "0.20.0" | ||
"@esbuild/android-x64" "0.20.0" | ||
"@esbuild/darwin-arm64" "0.20.0" | ||
"@esbuild/darwin-x64" "0.20.0" | ||
"@esbuild/freebsd-arm64" "0.20.0" | ||
"@esbuild/freebsd-x64" "0.20.0" | ||
"@esbuild/linux-arm" "0.20.0" | ||
"@esbuild/linux-arm64" "0.20.0" | ||
"@esbuild/linux-ia32" "0.20.0" | ||
"@esbuild/linux-loong64" "0.20.0" | ||
"@esbuild/linux-mips64el" "0.20.0" | ||
"@esbuild/linux-ppc64" "0.20.0" | ||
"@esbuild/linux-riscv64" "0.20.0" | ||
"@esbuild/linux-s390x" "0.20.0" | ||
"@esbuild/linux-x64" "0.20.0" | ||
"@esbuild/netbsd-x64" "0.20.0" | ||
"@esbuild/openbsd-x64" "0.20.0" | ||
"@esbuild/sunos-x64" "0.20.0" | ||
"@esbuild/win32-arm64" "0.20.0" | ||
"@esbuild/win32-ia32" "0.20.0" | ||
"@esbuild/win32-x64" "0.20.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Entry point for the build script in your package.json | ||
import "./controllers" |
9 changes: 9 additions & 0 deletions
9
test/fixtures/esbuild-strada/app/javascript/controllers/application.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Application } from "@hotwired/stimulus" | ||
|
||
const application = Application.start() | ||
|
||
// Configure Stimulus development experience | ||
application.debug = false | ||
window.Stimulus = application | ||
|
||
export { application } |
7 changes: 7 additions & 0 deletions
7
test/fixtures/esbuild-strada/app/javascript/controllers/bridge/button_controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { BridgeComponent } from "@hotwired/strada" | ||
|
||
export default class extends BridgeComponent { | ||
static component = "button" | ||
|
||
connect() {} | ||
} |
11 changes: 11 additions & 0 deletions
11
test/fixtures/esbuild-strada/app/javascript/controllers/hello_controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Controller } from "@hotwired/stimulus" | ||
|
||
export class NonDefaultExportController extends Controller {} | ||
|
||
export default class extends Controller { | ||
static targets = ["name", "output"]; | ||
|
||
connect() { | ||
|
||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
test/fixtures/esbuild-strada/app/javascript/controllers/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// This file is auto-generated by ./bin/rails stimulus:manifest:update | ||
// Run that command whenever you add a new controller or create them with | ||
// ./bin/rails generate stimulus controllerName | ||
|
||
import { application } from "./application" | ||
|
||
import HelloController from "./hello_controller" | ||
application.register("hello", HelloController) | ||
|
||
import BridgeButtonComponent from "./bridge/button_controller" | ||
application.register("bridge--button", BridgeButtonComponent) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "esbuild-strada", | ||
"private": true, | ||
"dependencies": { | ||
"@hotwired/strada": "^1.0.0-beta1", | ||
"esbuild": "^0.20.0" | ||
} | ||
} |
Oops, something went wrong.