Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: "javascript_import_module_tag"
source: "Importmap::ImportmapTagsHelper#javascript_import_module_tag"
gem: "importmap-rails"
output: "html"
visibility: "public"
supported: false
supports_block: false
signature: "javascript_import_module_tag(*module_names)"
documentation_url: "https://www.rubydoc.info/gems/importmap-rails/Importmap/ImportmapTagsHelper#javascript_import_module_tag-instance_method"

description: |-
Imports the named JavaScript module(s) using a `<script type="module">` tag. Each module name becomes an `import` statement in the body of the tag. Includes the Content Security Policy nonce when one is present.

tag:
name: "script"
is_void: false
preferred: false
detect_style: "call_name"

arguments:
- name: "module_names"
position: 1
type: "string"
optional: false
splat: true
description: |-
One or more module names to import.

options: []
block_arguments: []
special_behaviors: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: "javascript_importmap_module_preload_tags"
source: "Importmap::ImportmapTagsHelper#javascript_importmap_module_preload_tags"
gem: "importmap-rails"
output: "html"
visibility: "public"
supported: false
supports_block: false
signature: "javascript_importmap_module_preload_tags(importmap = Rails.application.importmap, entry_point: \"application\")"
documentation_url: "https://www.rubydoc.info/gems/importmap-rails/Importmap/ImportmapTagsHelper#javascript_importmap_module_preload_tags-instance_method"

description: |-
Returns `<link rel="modulepreload">` tags for all modules marked as `preload: true` in the `importmap` (defaults to `Rails.application.importmap`), such that they'll be fetched in advance by browsers supporting this link type.

tag:
name: "link"
is_void: true
preferred: false
detect_style: "call_name"

arguments:
- name: "importmap"
position: 1
type: "object"
optional: true
default: "Rails.application.importmap"
description: |-
The `Importmap::Map` whose preloaded modules should be linked.

options:
- name: "entry_point"
type: "string"
description: |-
Entry point used to resolve the preloaded module packages. Defaults to `"application"`.

block_arguments: []

special_behaviors:
- "produces_multiple_elements"
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: "javascript_importmap_tags"
source: "Importmap::ImportmapTagsHelper#javascript_importmap_tags"
gem: "importmap-rails"
output: "html"
visibility: "public"
supported: false
supports_block: false
signature: "javascript_importmap_tags(entry_point = \"application\", importmap: Rails.application.importmap)"
documentation_url: "https://www.rubydoc.info/gems/importmap-rails/Importmap/ImportmapTagsHelper#javascript_importmap_tags-instance_method"

description: |-
Sets up all `<script>` tags needed to use an importmap-powered entrypoint, which defaults to `application`. Renders the inline importmap `<script>`, the `modulepreload` `<link>` tags for all preloaded modules, and the module import `<script>`.

tag: null

arguments:
- name: "entry_point"
position: 1
type: "string"
optional: true
default: "\"application\""
description: |-
Name of the JavaScript module to import as the entry point.

options:
- name: "importmap"
type: "object"
description: |-
The `Importmap::Map` to render. Defaults to `Rails.application.importmap`.

block_arguments: []

special_behaviors:
- "produces_multiple_elements"
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: "javascript_inline_importmap_tag"
source: "Importmap::ImportmapTagsHelper#javascript_inline_importmap_tag"
gem: "importmap-rails"
output: "html"
visibility: "public"
supported: false
supports_block: false
signature: "javascript_inline_importmap_tag(importmap_json = Rails.application.importmap.to_json(resolver: self))"
documentation_url: "https://www.rubydoc.info/gems/importmap-rails/Importmap/ImportmapTagsHelper#javascript_inline_importmap_tag-instance_method"

description: |-
Generates an inline importmap `<script type="importmap">` tag using the passed `importmap_json` JSON string. Defaults to `Rails.application.importmap.to_json(resolver: self)`. Includes `data-turbo-track="reload"` and the Content Security Policy nonce when one is present.

tag:
name: "script"
is_void: false
preferred: false
detect_style: "call_name"

arguments:
- name: "importmap_json"
position: 1
type: "string"
optional: true
default: "Rails.application.importmap.to_json(resolver: self)"
description: |-
JSON string of the importmap to inline.

options: []
block_arguments: []
special_behaviors: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: "javascript_module_preload_tag"
source: "Importmap::ImportmapTagsHelper#javascript_module_preload_tag"
gem: "importmap-rails"
output: "html"
visibility: "public"
supported: false
supports_block: false
signature: "javascript_module_preload_tag(*paths)"
documentation_url: "https://www.rubydoc.info/gems/importmap-rails/Importmap/ImportmapTagsHelper#javascript_module_preload_tag-instance_method"

description: |-
Returns a `<link rel="modulepreload">` tag for the JavaScript module residing in each of `*paths`. Returns one link tag per path element.

tag:
name: "link"
is_void: true
preferred: false
detect_style: "call_name"

arguments:
- name: "paths"
position: 1
type: "string"
optional: false
splat: true
description: |-
One or more module paths to preload.

options: []
block_arguments: []

special_behaviors:
- type: "multiple_elements"
source: "splat_args"
20 changes: 20 additions & 0 deletions sig/herb/action_view/helper_registry.rbs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading