├── test-harness
├── .cflintrc
├── views
│ ├── examples
│ │ ├── lifecycleprehydrate.cfm
│ │ ├── emitto.cfm
│ │ ├── emitup.cfm
│ │ ├── mount.cfm
│ │ ├── loading.cfm
│ │ ├── postemit.cfm
│ │ ├── preemit.cfm
│ │ ├── relocate.cfm
│ │ ├── usingset.cfm
│ │ ├── wirescripts.cfm
│ │ ├── databinding.cfm
│ │ ├── helloworld.cfm
│ │ ├── multiselect.cfm
│ │ ├── querystring.cfm
│ │ ├── wirestyles.cfm
│ │ ├── formvalidation.cfm
│ │ ├── passactionargs.cfm
│ │ ├── bindingnestdata.cfm
│ │ ├── computedproperty.cfm
│ │ ├── databindingcount.cfm
│ │ ├── nestedcomponent1.cfm
│ │ ├── alpineUpload.cfm
│ │ ├── usingviewtorender.cfm
│ │ ├── fireeventfromcomponent.cfm
│ │ ├── mounthasrequestcontext.cfm
│ │ ├── loadinganddisablingbutton.cfm
│ │ ├── fireevent.cfm
│ │ ├── helloworldwithrenderviewpropertyandargs.cfm
│ │ ├── run.cfm
│ │ ├── passparameters.cfm
│ │ ├── counter.cfm
│ │ ├── passedparametersprovidedtomount.cfm
│ │ ├── poll.cfm
│ │ ├── getter.cfm
│ │ ├── callmethod.cfm
│ │ └── resetpropertiestoinitialstate.cfm
│ ├── itb2024
│ │ └── signupForm.cfm
│ ├── main
│ │ └── index.cfm
│ ├── workshop
│ │ ├── index.cfm
│ │ ├── counter.cfm
│ │ ├── signupForm.cfm
│ │ ├── tasklist.cfm
│ │ └── nestedDataKeys.cfm
│ ├── testViewNoOuterElement.cfm
│ ├── testView.cfm
│ ├── tests
│ │ └── requestassets.cfm
│ └── beatbox
│ │ ├── upload.cfm
│ │ ├── loops.cfm
│ │ └── index.cfm
├── handlers
│ ├── Examples.cfc
│ ├── Main.cfc
│ ├── Workshop.cfc
│ └── BeatBox.cfc
├── includes
│ ├── i18n
│ │ └── _en_US.json
│ ├── images
│ │ ├── bg.jpg
│ │ └── bg2.jpg
│ ├── helpers
│ │ └── applicationHelper.cfm
│ └── workshop
│ │ ├── XRXV3I6Li01BKofIOOaBTMnFcQIG.woff2
│ │ └── github-dark.min.css
├── wires
│ ├── getter.cfm
│ ├── Form.cfc
│ ├── Teleport.cfc
│ ├── ImplicitRender.cfc
│ ├── ChildComponent.cfc
│ ├── Counter2.cfc
│ ├── LazyLoading.cfc
│ ├── SuperHeroStats.cfc
│ ├── TestChildComponent.cfc
│ ├── helloWorldWithRenderViewPropertyAndArgs.cfm
│ ├── logbox.cfm
│ ├── mount.cfm
│ ├── test
│ │ ├── should_be_able_to_call_inherited_methods_from_template.cfc
│ │ ├── should_be_able_to_access_event_from_template.cfc
│ │ ├── should_render_a_boxlang_component.bxm
│ │ ├── should_implicitly_render_a_view_template.cfm
│ │ ├── BaseWire.cfc
│ │ ├── security
│ │ │ ├── cbSecurity_secured_annotation_eq_false.cfc
│ │ │ ├── cbSecurity_secured_annotation_single_permission.cfc
│ │ │ ├── cbSecurity_secured_annotation_multiple_permission.cfc
│ │ │ ├── onsecure_block_always.cfm
│ │ │ ├── cbSecurity_secured_annotation_eq_false.cfm
│ │ │ ├── onrender_custom_block_message_from_wire.cfm
│ │ │ ├── onrender_block_from_prc.cfm
│ │ │ ├── cbSecurity_secured_annotation_multiple_permission.cfm
│ │ │ ├── cbSecurity_secured_annotation_single_permission.cfm
│ │ │ ├── cbSecurity_method_secured_annotation.cfm
│ │ │ ├── cbSecurity_secured_annotation.cfm
│ │ │ ├── onsecure_block_always.cfc
│ │ │ ├── cbSecurity_method_secured_annotation.cfc
│ │ │ ├── onrender_block_from_prc.cfc
│ │ │ ├── onrender_custom_block_message_from_wire.cfc
│ │ │ └── cbSecurity_secured_annotation.cfc
│ │ ├── should_support_passing_params_into_a_onRender_method.cfm
│ │ ├── should_be_able_to_call_inherited_methods_from_template.cfm
│ │ ├── should_render_a_boxlang_component.bx
│ │ ├── should_implicitly_render_a_view_template.cfc
│ │ ├── child2.cfm
│ │ ├── should_render_a_component.cfm
│ │ ├── should_render_with_renderIt_for_backwards_compatibility.cfc
│ │ ├── should_raise_error_for_single_file_component.cfm
│ │ ├── child1.cfm
│ │ ├── should_provide_id_variable_to_template.cfm
│ │ ├── should_support_refresh_action.cfm
│ │ ├── should_be_able_to_render_coldbox_views_using_view_from_a_component.cfc
│ │ ├── shouldnt_isolate_by_default.cfm
│ │ ├── should_raise_error_for_template_rendering_error.cfm
│ │ ├── should_support_child_components.cfm
│ │ ├── should_redirect_the_user.cfm
│ │ ├── should_render_string_booleans_as_booleans.cfm
│ │ ├── should_render_with_a_onRender_method.cfc
│ │ ├── child_component.cfm
│ │ ├── should_be_able_to_access_event_from_template.cfm
│ │ ├── should_extend_custom_basewire_from_single_file_component.cfm
│ │ ├── should_trim_string_values_if_global_setting_enabled.cfm
│ │ ├── should_be_able_to_render_coldbox_views_using_view_from_a_template.cfm
│ │ ├── should_display_component_errors_in_a_CBWIRE_custom_exception_page.cfm
│ │ ├── should_extend_custom_basewire_from_single_file_boxlang_component.bxm
│ │ ├── should_redirect_the_user_using_navigate.cfm
│ │ ├── should_be_able_to_call_udf_from_template.cfm
│ │ ├── should_support_deep_nesting.cfm
│ │ ├── should_dispatch_an_event_without_params.cfm
│ │ ├── should_isolate_when_using_isolate_true.cfm
│ │ ├── should_render_with_correct_snapshot_effects_and_id_attribute.cfm
│ │ ├── should_render_a_singlefile_boxlang_component.bxm
│ │ ├── should_support_accessing_data_properties_using_legacy_args_scope.cfm
│ │ ├── should_support_computed_properties.cfm
│ │ ├── should_dispatch_an_event_with_params.cfm
│ │ ├── should_trim_string_values_if_enabled_on_component.cfm
│ │ ├── html_with_quotes.cfm
│ │ ├── should_detect_lazy_loaded_children.cfm
│ │ ├── should_cache_computed_properties.cfm
│ │ ├── should_support_passing_params_into_a_onRender_method.cfc
│ │ ├── should_alllow_without_markers_for_single_file_component.cfm
│ │ ├── should_not_auto_set_passed_in_params_if_onMount_is_defined.cfm
│ │ ├── should_alllow_without_markers_for_single_file_boxlang_component.bxm
│ │ ├── should_not_render_cbwire_script_tags.cfm
│ │ ├── should_put_request_assets_in_head.cfm
│ │ ├── should_accept_false_flag_for_computed_properties_to_prevent_caching.cfm
│ │ ├── should_isolate_when_using_lazyLoad_true.cfm
│ │ ├── should_not_render_cbwire_assets_tags.cfm
│ │ ├── should_track_cbwire_assets_in_http_response.cfm
│ │ ├── should_have_generated_getter_accessible_in_template.cfm
│ │ ├── should_support_rendering_wires_with_xdata_and_arrow_functions.cfm
│ │ ├── should_call_onupdate.cfm
│ │ ├── should_support_onBoot_firing_when_the_component_is_initially_rendered.cfm
│ │ ├── should_be_able_to_call_getInstance_from_template_and_component.cfm
│ │ ├── should_track_scripts_in_snapshot_memo.cfm
│ │ ├── should_not_throw_exception_on_locked_data_property_empty_array.cfm
│ │ ├── should_not_throw_exception_on_locked_data_property_empty_string.cfm
│ │ ├── should_throw_exception_on_locked_data_property_array.cfm
│ │ ├── should_throw_exception_on_locked_data_property_string.cfm
│ │ ├── should_have_generated_setters_and_getters_available_in_onmount.cfm
│ │ ├── should_not_throw_exception_on_locked_data_property_other.cfm
│ │ ├── should_track_assets_in_snapshot_memo.cfm
│ │ ├── should_support_hasErrors_hasError_getError_for_validation.cfm
│ │ ├── should_throw_exception_on_locked_data_property_list.cfm
│ │ ├── should_call_onhydrate.cfm
│ │ ├── should_call_onupdate_property.cfm
│ │ ├── should_call_onuploaderror.cfm
│ │ ├── test_component_with_dot_notation_data.cfm
│ │ └── should_support_array_of_struct_data_properties.cfm
│ ├── MultiSelect.cfc
│ ├── TestChildComponent.cfm
│ ├── component.cfm
│ ├── superherostats.cfm
│ ├── PassParameters.cfc
│ ├── implicitrender.cfm
│ ├── CheckboxInput.cfc
│ ├── MultiselectInput.cfc
│ ├── SelectInput.cfc
│ ├── ExplicitTemplate.cfc
│ ├── RadioInput.cfc
│ ├── TextInput.cfc
│ ├── relocate.cfm
│ ├── testcomponentwithhelpermethods.cfm
│ ├── bindingNestedData.cfm
│ ├── DataBinding.cfc
│ ├── DirectiveModel.cfc
│ ├── testing
│ │ ├── teleport.cfm
│ │ ├── multipleouterelements.cfm
│ │ └── complexhtml.cfm
│ ├── ExplicitTemplate1234.cfm
│ ├── TestParentWithLazyChild.cfc
│ ├── TestParentWithOverride.cfc
│ ├── DataBindingLive.cfc
│ ├── queryString.cfm
│ ├── TaskItem.cfm
│ ├── computedProperty.cfm
│ ├── postEmit.cfm
│ ├── preEmit.cfm
│ ├── HelloWorld.cfc
│ ├── poll.cfm
│ ├── databinding.cfm
│ ├── usingSet.cfm
│ ├── BindingNestedData.cfc
│ ├── DirectiveLoading.cfc
│ ├── passActionArgs.cfm
│ ├── ComputedPropertiesCache.cfc
│ ├── TestAlwaysLazyComponent.cfm
│ ├── loadingAndDisablingButton.cfm
│ ├── testcomponentwithmalformedtemplate.cfm
│ ├── DirectiveDirty.cfc
│ ├── dataBindingCount.cfm
│ ├── ChildComponent.cfm
│ ├── DirectiveClick.cfc
│ ├── Getter.cfc
│ ├── NestedComponents.cfc
│ ├── TeleportChild.cfc
│ ├── loading.cfm
│ ├── deferloading.cfm
│ ├── ShowCode.cfc
│ ├── DirectiveKeydown.cfc
│ ├── OnHydrate.cfm
│ ├── TestComponentWithInvalidListener.cfc
│ ├── js.cfm
│ ├── DirectivePoll.cfc
│ ├── Entangle.cfc
│ ├── TaskItem.cfc
│ ├── computedPropertiesCache.cfm
│ ├── nestedComponent2.cfm
│ ├── WireModel.cfc
│ ├── testuicomponent.cfm
│ ├── CallAction.cfc
│ ├── WireModelLive.cfc
│ ├── Loading.cfc
│ ├── SubmitButton.cfc
│ ├── TestParentWithLazyChild.cfm
│ ├── computedpropertygetter.cfm
│ ├── LogBox.cfc
│ ├── callaction.cfm
│ ├── lazyloading.cfm
│ ├── fireEvent.cfm
│ ├── nestedcomponents.cfm
│ ├── teleport.cfm
│ ├── CounterUsingArgsDot.cfm
│ ├── CounterUsingDataDot.cfm
│ ├── TestParentWithOverride.cfm
│ ├── directivedirty.cfm
│ ├── emitTo.cfm
│ ├── DataProperties.cfm
│ ├── listeners.cfm
│ ├── passparameters.cfm
│ ├── Counter.cfm
│ ├── CounterUsingComputedProperty.cfm
│ ├── EmitTo.cfc
│ ├── UsingSet.cfc
│ ├── superheroesvalidation.cfm
│ ├── DeferLoading.cfc
│ ├── HelloWorldWithRenderViewPropertyAndArgs.cfc
│ ├── LoadingAndDisablingButton.cfc
│ ├── OnUploadError.cfm
│ ├── SignupForm.cfc
│ ├── TestComponentWithoutPlaceholder.cfm
│ ├── nestedComponent
│ │ └── NestedFolderComponent.cfm
│ ├── passedparametersprovidedtomount.cfm
│ ├── Counter.cfc
│ ├── TestAlwaysLazyComponent.cfc
│ ├── nestedComponent1.cfm
│ ├── PassedParametersProvidedToMount.cfc
│ ├── computedproperties.cfm
│ ├── DataBindingCount.cfc
│ ├── ParentChildComponent.cfc
│ ├── Poll.cfc
│ ├── Listeners.cfc
│ ├── NestedComponent1.cfc
│ ├── Relocate.cfc
│ ├── JS.cfc
│ ├── Mount.cfc
│ ├── NestedComponent2.cfc
│ ├── TestTableRowComponent.cfm
│ ├── teleportchild.cfm
│ ├── directivepoll.cfm
│ ├── TestSingleFileComponent.cfm
│ ├── ComputedPropertyGetter.cfc
│ ├── Validation.cfc
│ ├── checkboxinput.cfm
│ ├── resetPropertiesToInitialState.cfm
│ ├── FormValidation.cfc
│ ├── submitbutton.cfm
│ ├── QueryString.cfc
│ ├── TaskList.cfc
│ ├── textinput.cfm
│ ├── ChatGPT.cfc
│ ├── OnHydrate.cfc
│ ├── FileUpload.cfc
│ ├── wiremodellive.cfm
│ ├── PassActionArgs.cfc
│ ├── multiselect.cfm
│ ├── testcomponentusingargs.cfm
│ ├── CounterWithOnMount.cfc
│ ├── DataProperties.cfc
│ ├── MountHasRequestContext.cfc
│ ├── PreEmit.cfc
│ ├── PostEmit.cfc
│ ├── directiveclick.cfm
│ ├── DirectiveInit.cfc
│ ├── emitUp.cfm
│ ├── stream.cfm
│ ├── SlowComponent.cfc
│ ├── directiveinit.cfm
│ ├── ComputedProperty.cfc
│ ├── Stream.cfc
│ ├── DataWithStructWire.cfm
│ ├── dataWithStructWire.cfm
│ ├── TestComponent.cfm
│ ├── FireEventFromComponent.cfc
│ ├── Loops.cfc
│ ├── FireEvent2.cfc
│ ├── FireEvent.cfc
│ ├── Actions.cfc
│ ├── superheroes.cfm
│ ├── OnUploadError.cfc
│ ├── actions.cfm
│ ├── CounterComplete.cfc
│ ├── ResetPropertiesToInitialState.cfc
│ ├── radioinput.cfm
│ ├── databindinglive.cfm
│ ├── validation.cfm
│ ├── wiremodel.cfm
│ ├── directiveloading.cfm
│ ├── formvalidation.cfm
│ ├── selectinput.cfm
│ ├── TaskList.cfm
│ ├── multiselectinput.cfm
│ ├── dataWithStructWire.cfc
│ ├── OnUpdate.cfc
│ ├── InlineWire.cfm
│ ├── chatgpt.cfm
│ ├── TaskListComplete.cfm
│ ├── TaskListComplete.cfc
│ ├── directivemodel.cfm
│ ├── showCode.cfm
│ ├── ParentChildComponent.cfm
│ ├── SignupFormComplete.cfc
│ ├── entangle.cfm
│ ├── EmitUp.cfc
│ ├── directivekeydown.cfm
│ ├── TestUIComponent.cfc
│ ├── SuperHeroes.cfc
│ ├── CounterComplete.cfm
│ ├── CounterUsingCBWIRE3.cfc
│ ├── loops.cfm
│ └── AlpineUpload.cfm
├── tests
│ ├── resources
│ │ ├── RendererStub.cfm
│ │ └── logo.png
│ └── templates
│ │ ├── templateWithoutOuterElement.cfm
│ │ ├── template.cfm
│ │ ├── datapropertyusingargs.cfm
│ │ ├── onmount.cfm
│ │ ├── onload.cfm
│ │ ├── cbi18n.cfm
│ │ ├── cachedcomputedproperty.cfm
│ │ ├── computedproperty.cfm
│ │ ├── templateWithTwoOuterElements.cfm
│ │ ├── globaludf.cfm
│ │ ├── childcomponent.cfm
│ │ ├── entangle.cfm
│ │ ├── childcomponentwithkey.cfm
│ │ ├── SingleFileComponent.cfm
│ │ ├── validation.cfm
│ │ ├── udfmethod.cfm
│ │ ├── basicCFComponent.cfc
│ │ ├── templateWithComments.cfm
│ │ ├── dataproperty.cfm
│ │ └── withoutOnMountEvent.cfm
├── models
│ ├── Adder.cfc
│ └── TaskService.cfc
├── modules_external
│ └── ExternalModule
│ │ ├── views
│ │ └── home
│ │ │ └── index.cfm
│ │ ├── wires
│ │ └── should_load_external_modules.cfm
│ │ ├── handlers
│ │ └── Home.cfc
│ │ └── config
│ │ ├── Router.cfc
│ │ └── Scheduler.cfc
├── config
│ ├── Application.cfc
│ ├── Router.cfc
│ └── WireBox.cfc
├── layouts
│ └── Main.cfm
├── .cfconfig.json
├── anotherFolder
│ └── OutsideFolderComponent.cfm
├── modules_app
│ └── testingmodule
│ │ ├── myComponents
│ │ └── NestedModuleComponent.cfm
│ │ ├── wires
│ │ ├── nestedComponent
│ │ │ └── NestedFolderComponent.cfm
│ │ └── NestedModuleDefaultComponent.cfm
│ │ └── ModuleConfig.cfc
├── index.cfm
├── server-lucee@5.json
├── server-lucee@6.json
├── server-adobe@2023.json
├── server-adobe@2025.json
├── server-boxlang-cfml@1.json
└── box.json
├── interceptors
└── ComponentMounting.cfc
├── includes
└── js
│ ├── livewire
│ ├── dist
│ │ └── manifest.json
│ └── js
│ │ ├── jsconfig.json
│ │ ├── directives
│ │ ├── wire-cloak.js
│ │ ├── wire-init.js
│ │ ├── wire-replace.js
│ │ ├── wire-ignore.js
│ │ ├── index.js
│ │ ├── wire-show.js
│ │ ├── wire-text.js
│ │ ├── wire-offline.js
│ │ ├── wire-navigate.js
│ │ └── wire-confirm.js
│ │ ├── plugins
│ │ ├── navigate
│ │ │ ├── bus.js
│ │ │ └── teleport.js
│ │ └── history
│ │ │ └── url.js
│ │ └── features
│ │ ├── supportRedirects.js
│ │ ├── supportDispatches.js
│ │ ├── supportMorphDom.js
│ │ ├── supportIsolating.js
│ │ ├── index.js
│ │ ├── supportJsEvaluation.js
│ │ ├── supportNavigate.js
│ │ ├── supportListeners.js
│ │ ├── supportHotReloading.js
│ │ └── supportLazyLoading.js
│ └── previous
│ └── manifest.json
├── logo.png
├── package.json
├── .github
├── FUNDING.yml
└── dependabot.yml
├── .gitmodules
├── changelog.md
├── models
├── EmptySingleFileComponent.bx
├── EmptySingleFileComponent.cfc
├── services
│ ├── UtilityService.cfc
│ └── ConfigService.cfc
├── BaseWireTest.cfc
├── IncomingRequest.cfc
├── IncomingFileUpload.cfc
├── IncomingFilePreview.cfc
├── preprocessor
│ └── TeleportPreprocessor.cfc
├── scripts.cfm
└── styles.cfm
├── .claude
└── settings.local.json
├── .markdownlint.json
├── .editorconfig
├── .gitattributes
├── .gitignore
├── readme.md
├── .vscode
└── settings.json
└── handlers
└── Main.cfc
/test-harness/.cflintrc:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/interceptors/ComponentMounting.cfc:
--------------------------------------------------------------------------------
1 | component {}
--------------------------------------------------------------------------------
/test-harness/views/examples/lifecycleprehydrate.cfm:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test-harness/handlers/Examples.cfc:
--------------------------------------------------------------------------------
1 | component {
2 |
3 | }
--------------------------------------------------------------------------------
/test-harness/views/itb2024/signupForm.cfm:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test-harness/views/main/index.cfm:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/test-harness/includes/i18n/_en_US.json:
--------------------------------------------------------------------------------
1 | {
2 | "test": "whatever"
3 | }
--------------------------------------------------------------------------------
/test-harness/wires/getter.cfm:
--------------------------------------------------------------------------------
1 | #args.name#
--------------------------------------------------------------------------------
/includes/js/livewire/dist/manifest.json:
--------------------------------------------------------------------------------
1 |
2 | {"/livewire.js":"df3a17f2"}
3 |
--------------------------------------------------------------------------------
/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coldbox-modules/cbwire/HEAD/logo.png
--------------------------------------------------------------------------------
/test-harness/views/examples/emitto.cfm:
--------------------------------------------------------------------------------
1 | #wire( "EmitTo" )#
--------------------------------------------------------------------------------
/test-harness/views/examples/emitup.cfm:
--------------------------------------------------------------------------------
1 | #wire( "EmitUp" )#
--------------------------------------------------------------------------------
/test-harness/views/examples/mount.cfm:
--------------------------------------------------------------------------------
1 | #wire( "Mount" )#
--------------------------------------------------------------------------------
/test-harness/views/workshop/index.cfm:
--------------------------------------------------------------------------------
1 |
Welcome ITB 2024 CBWIRE Workshop
--------------------------------------------------------------------------------
/test-harness/tests/resources/RendererStub.cfm:
--------------------------------------------------------------------------------
1 | Rendered abc123
--------------------------------------------------------------------------------
/test-harness/views/examples/loading.cfm:
--------------------------------------------------------------------------------
1 | #wire( "Loading" )#
--------------------------------------------------------------------------------
/test-harness/views/examples/postemit.cfm:
--------------------------------------------------------------------------------
1 | #wire( "PostEmit" )#
--------------------------------------------------------------------------------
/test-harness/views/examples/preemit.cfm:
--------------------------------------------------------------------------------
1 | #wire( "PreEmit" )#
--------------------------------------------------------------------------------
/test-harness/views/examples/relocate.cfm:
--------------------------------------------------------------------------------
1 | #wire( "Relocate" )#
--------------------------------------------------------------------------------
/test-harness/views/examples/usingset.cfm:
--------------------------------------------------------------------------------
1 | #wire( "UsingSet" )#
--------------------------------------------------------------------------------
/test-harness/views/examples/wirescripts.cfm:
--------------------------------------------------------------------------------
1 | #wireScripts()#
--------------------------------------------------------------------------------
/test-harness/views/testViewNoOuterElement.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/test-harness/views/workshop/counter.cfm:
--------------------------------------------------------------------------------
1 | #wire( "Counter" )#
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "devDependencies": {
3 | "rollup": "^2.58.0"
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/test-harness/views/examples/databinding.cfm:
--------------------------------------------------------------------------------
1 | #wire( "DataBinding" )#
--------------------------------------------------------------------------------
/test-harness/views/examples/helloworld.cfm:
--------------------------------------------------------------------------------
1 | #wire( "HelloWorld" )#
--------------------------------------------------------------------------------
/test-harness/views/examples/multiselect.cfm:
--------------------------------------------------------------------------------
1 | #wire( "MultiSelect" )#
--------------------------------------------------------------------------------
/test-harness/views/examples/querystring.cfm:
--------------------------------------------------------------------------------
1 | #wire( "QueryString" )#
--------------------------------------------------------------------------------
/test-harness/views/examples/wirestyles.cfm:
--------------------------------------------------------------------------------
1 | #wireStyles()#
--------------------------------------------------------------------------------
/test-harness/views/workshop/signupForm.cfm:
--------------------------------------------------------------------------------
1 | #wire( "SignupForm" )#
--------------------------------------------------------------------------------
/test-harness/wires/Form.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | }
--------------------------------------------------------------------------------
/test-harness/wires/Teleport.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | }
--------------------------------------------------------------------------------
/includes/js/previous/manifest.json:
--------------------------------------------------------------------------------
1 | {"/livewire.js":"/livewire.js?id=c69d0f2801c01fcf8166"}
--------------------------------------------------------------------------------
/test-harness/views/examples/formvalidation.cfm:
--------------------------------------------------------------------------------
1 | #wire( "FormValidation" )#
--------------------------------------------------------------------------------
/test-harness/views/examples/passactionargs.cfm:
--------------------------------------------------------------------------------
1 | #wire( "PassActionArgs" )#
--------------------------------------------------------------------------------
/test-harness/wires/ImplicitRender.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | }
--------------------------------------------------------------------------------
/test-harness/views/examples/bindingnestdata.cfm:
--------------------------------------------------------------------------------
1 | #wire( "BindingNestedData" )#
--------------------------------------------------------------------------------
/test-harness/views/examples/computedproperty.cfm:
--------------------------------------------------------------------------------
1 | #wire( "ComputedProperty" )#
--------------------------------------------------------------------------------
/test-harness/views/examples/databindingcount.cfm:
--------------------------------------------------------------------------------
1 | #wire( "DataBindingCount" )#
--------------------------------------------------------------------------------
/test-harness/views/examples/nestedcomponent1.cfm:
--------------------------------------------------------------------------------
1 | #wire( "NestedComponent1" )#
--------------------------------------------------------------------------------
/test-harness/wires/ChildComponent.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | }
--------------------------------------------------------------------------------
/test-harness/wires/Counter2.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 |
4 | }
--------------------------------------------------------------------------------
/test-harness/wires/LazyLoading.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | }
--------------------------------------------------------------------------------
/test-harness/wires/SuperHeroStats.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | }
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | patreon: ortussolutions
4 |
--------------------------------------------------------------------------------
/test-harness/tests/templates/templateWithoutOuterElement.cfm:
--------------------------------------------------------------------------------
1 |
2 | #now()#
3 |
--------------------------------------------------------------------------------
/test-harness/views/examples/alpineUpload.cfm:
--------------------------------------------------------------------------------
1 |
2 | #wire( "AlpineUpload" )#
3 |
--------------------------------------------------------------------------------
/test-harness/views/examples/usingviewtorender.cfm:
--------------------------------------------------------------------------------
1 | #wire( "UsingViewToRender" )#
--------------------------------------------------------------------------------
/test-harness/views/workshop/tasklist.cfm:
--------------------------------------------------------------------------------
1 |
2 | #wire( name="TaskList" )#
3 |
--------------------------------------------------------------------------------
/test-harness/wires/TestChildComponent.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | }
--------------------------------------------------------------------------------
/test-harness/tests/templates/template.cfm:
--------------------------------------------------------------------------------
1 |
2 | Current time: #now()#
3 |
--------------------------------------------------------------------------------
/test-harness/wires/helloWorldWithRenderViewPropertyAndArgs.cfm:
--------------------------------------------------------------------------------
1 | #args.message#
--------------------------------------------------------------------------------
/test-harness/wires/logbox.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | Got logger
4 |
5 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "livewire"]
2 | path = livewire
3 | url = https://github.com/livewire/livewire.git
4 |
--------------------------------------------------------------------------------
/test-harness/views/examples/fireeventfromcomponent.cfm:
--------------------------------------------------------------------------------
1 | #wire( "FireEventFromComponent" )#
--------------------------------------------------------------------------------
/test-harness/views/examples/mounthasrequestcontext.cfm:
--------------------------------------------------------------------------------
1 | #wire( "MountHasRequestContext" )#
--------------------------------------------------------------------------------
/test-harness/wires/mount.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | #args.message#
4 |
5 |
--------------------------------------------------------------------------------
/test-harness/tests/templates/datapropertyusingargs.cfm:
--------------------------------------------------------------------------------
1 |
2 | name: #args.name#
3 |
--------------------------------------------------------------------------------
/test-harness/views/examples/loadinganddisablingbutton.cfm:
--------------------------------------------------------------------------------
1 | #wire( "LoadingAndDisablingButton" )#
--------------------------------------------------------------------------------
/test-harness/views/testView.cfm:
--------------------------------------------------------------------------------
1 |
2 |
5 |
--------------------------------------------------------------------------------
/test-harness/models/Adder.cfc:
--------------------------------------------------------------------------------
1 | component {
2 |
3 | function add( a, b ) {
4 | return a + b;
5 | }
6 | }
--------------------------------------------------------------------------------
/test-harness/wires/test/should_be_able_to_call_inherited_methods_from_template.cfc:
--------------------------------------------------------------------------------
1 | component extends="BaseWire" {
2 |
3 | }
--------------------------------------------------------------------------------
/changelog.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | Please visit https://cbwire.ortusbooks.com/release-history for changelog updates of CBWIRE.
--------------------------------------------------------------------------------
/test-harness/includes/images/bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coldbox-modules/cbwire/HEAD/test-harness/includes/images/bg.jpg
--------------------------------------------------------------------------------
/test-harness/tests/templates/onmount.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | mounted: #mounted#
4 |
5 |
--------------------------------------------------------------------------------
/test-harness/views/tests/requestassets.cfm:
--------------------------------------------------------------------------------
1 |
2 | #wire( "test.should_put_request_assets_in_head" )#
3 |
--------------------------------------------------------------------------------
/test-harness/wires/MultiSelect.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 | data = { "greeting" : "" };
3 | }
4 |
--------------------------------------------------------------------------------
/test-harness/includes/images/bg2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coldbox-modules/cbwire/HEAD/test-harness/includes/images/bg2.jpg
--------------------------------------------------------------------------------
/test-harness/tests/resources/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coldbox-modules/cbwire/HEAD/test-harness/tests/resources/logo.png
--------------------------------------------------------------------------------
/test-harness/tests/templates/onload.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | loaded: #calledLoaded#
4 |
5 |
--------------------------------------------------------------------------------
/test-harness/wires/TestChildComponent.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Child component
4 |
5 |
--------------------------------------------------------------------------------
/test-harness/wires/component.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | Component
4 | #args._id#
5 |
6 |
--------------------------------------------------------------------------------
/test-harness/wires/superherostats.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Super Hero Status
4 |
5 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_be_able_to_access_event_from_template.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | }
4 |
--------------------------------------------------------------------------------
/test-harness/tests/templates/cbi18n.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | cbi18n says: #$r( "test" )#
4 |
5 |
--------------------------------------------------------------------------------
/test-harness/views/examples/fireevent.cfm:
--------------------------------------------------------------------------------
1 | #wire( "FireEvent" )#
2 |
3 | #wire( "FireEvent2" )#
--------------------------------------------------------------------------------
/test-harness/wires/PassParameters.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 | data = { "pizzaToppings" : [] };
3 | }
4 |
--------------------------------------------------------------------------------
/test-harness/wires/implicitrender.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
I rendered implicitly
4 |
5 |
--------------------------------------------------------------------------------
/test-harness/modules_external/ExternalModule/views/home/index.cfm:
--------------------------------------------------------------------------------
1 |
2 | Welcome to my cool module page!
3 |
4 |
--------------------------------------------------------------------------------
/test-harness/tests/templates/cachedcomputedproperty.cfm:
--------------------------------------------------------------------------------
1 |
2 | #getTick()#|#getTick()#|#getTick(false)#
3 |
--------------------------------------------------------------------------------
/test-harness/tests/templates/computedproperty.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | result: #fivePlusFive()#
4 |
5 |
--------------------------------------------------------------------------------
/test-harness/views/examples/helloworldwithrenderviewpropertyandargs.cfm:
--------------------------------------------------------------------------------
1 | #wire( "HelloWorldWithRenderViewPropertyAndArgs" )#
--------------------------------------------------------------------------------
/test-harness/tests/templates/templateWithTwoOuterElements.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | div2
4 |
--------------------------------------------------------------------------------
/test-harness/views/examples/run.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | #wire( name=rc.component )#
4 |
5 |
--------------------------------------------------------------------------------
/test-harness/wires/CheckboxInput.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "isChecked": ""
5 | };
6 | }
--------------------------------------------------------------------------------
/test-harness/wires/MultiselectInput.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "heroes": []
5 | };
6 | }
--------------------------------------------------------------------------------
/test-harness/wires/SelectInput.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "hero": ""
5 | };
6 | }
--------------------------------------------------------------------------------
/test-harness/wires/test/should_render_a_boxlang_component.bxm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
#title#
4 |
5 |
--------------------------------------------------------------------------------
/test-harness/includes/helpers/applicationHelper.cfm:
--------------------------------------------------------------------------------
1 |
2 | function someGlobalUDF() {
3 | return "yay!";
4 | }
5 |
--------------------------------------------------------------------------------
/test-harness/views/examples/passparameters.cfm:
--------------------------------------------------------------------------------
1 | #wire( "PassParameters", { pizzaToppings: [ "Pepperoni", "Ham", "Mo cheese" ] } )#
--------------------------------------------------------------------------------
/test-harness/wires/ExplicitTemplate.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | template = "/wires/ExplicitTemplate1234.cfm";
4 | }
--------------------------------------------------------------------------------
/test-harness/wires/RadioInput.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "isSharkWeek": "false"
5 | };
6 | }
--------------------------------------------------------------------------------
/test-harness/wires/TextInput.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "companyName": ""
5 | };
6 |
7 | }
--------------------------------------------------------------------------------
/test-harness/wires/relocate.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | Redirect me
4 |
5 |
--------------------------------------------------------------------------------
/test-harness/wires/testcomponentwithhelpermethods.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | someGlobalUDF: #someGlobalUDF()#
4 |
5 |
--------------------------------------------------------------------------------
/test-harness/views/examples/counter.cfm:
--------------------------------------------------------------------------------
1 |
2 | #wire( "Counter", { defaultValue: 10 } )#
3 |
4 | #wire( "Counter" )#
5 |
--------------------------------------------------------------------------------
/test-harness/wires/bindingNestedData.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/test-harness/tests/templates/globaludf.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Global UDF
4 | #someGlobalUDF()#
5 |
6 |
--------------------------------------------------------------------------------
/test-harness/wires/DataBinding.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "message" : "Data binding!"
5 | };
6 | }
7 |
--------------------------------------------------------------------------------
/test-harness/wires/DirectiveModel.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "message": "Default message"
5 | };
6 | }
--------------------------------------------------------------------------------
/test-harness/wires/test/should_implicitly_render_a_view_template.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Implicitly rendered
4 |
5 |
--------------------------------------------------------------------------------
/test-harness/wires/testing/teleport.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | @teleport( '##someId' )
4 |
5 | @endTeleport
6 |
7 |
--------------------------------------------------------------------------------
/test-harness/wires/ExplicitTemplate1234.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | This was loaded using variables.template .
4 |
5 |
--------------------------------------------------------------------------------
/test-harness/wires/test/BaseWire.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | function sayHello() {
4 | return "Hello World!";
5 | }
6 |
7 | }
--------------------------------------------------------------------------------
/test-harness/wires/test/security/cbSecurity_secured_annotation_eq_false.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" secured="false" {
2 |
3 | data = {};
4 |
5 | }
6 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_support_passing_params_into_a_onRender_method.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Passed in: #value#
4 |
5 |
--------------------------------------------------------------------------------
/includes/js/livewire/js/jsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "baseUrl": ".",
4 | "paths": {
5 | "@/*": ["*"]
6 | }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/test-harness/tests/templates/childcomponent.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Main component
4 | #wire( "ChildComponent" )#
5 |
6 |
--------------------------------------------------------------------------------
/test-harness/tests/templates/entangle.cfm:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
--------------------------------------------------------------------------------
/test-harness/wires/TestParentWithLazyChild.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "title": "Parent Component"
5 | };
6 |
7 | }
--------------------------------------------------------------------------------
/test-harness/wires/TestParentWithOverride.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "title": "Parent Component"
5 | };
6 |
7 | }
--------------------------------------------------------------------------------
/test-harness/wires/test/security/cbSecurity_secured_annotation_single_permission.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" secured="write" {
2 |
3 | data = {};
4 |
5 | }
--------------------------------------------------------------------------------
/test-harness/wires/test/should_be_able_to_call_inherited_methods_from_template.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Result: #sayHello()#
4 |
5 |
--------------------------------------------------------------------------------
/test-harness/wires/testing/multipleouterelements.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | Outer 1
4 |
5 |
6 | Outer 2
7 |
8 |
--------------------------------------------------------------------------------
/test-harness/views/examples/passedparametersprovidedtomount.cfm:
--------------------------------------------------------------------------------
1 | #wire( "PassedParametersProvidedToMount", { "otherPizzaToppings": [ "Bacon", "Mushrooms" ] } )#
--------------------------------------------------------------------------------
/test-harness/wires/DataBindingLive.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 | // Data properties for binding
3 | data = [
4 | "username": ""
5 | ];
6 | }
--------------------------------------------------------------------------------
/test-harness/wires/queryString.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_render_a_boxlang_component.bx:
--------------------------------------------------------------------------------
1 | class extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "title": "A Boxlang Component"
5 | };
6 | }
--------------------------------------------------------------------------------
/test-harness/config/Application.cfc:
--------------------------------------------------------------------------------
1 | /**
2 | * This is a protection Application cfm for the config file. You do not
3 | * need to modify this file
4 | */
5 | component{
6 | abort;
7 | }
--------------------------------------------------------------------------------
/test-harness/includes/workshop/XRXV3I6Li01BKofIOOaBTMnFcQIG.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coldbox-modules/cbwire/HEAD/test-harness/includes/workshop/XRXV3I6Li01BKofIOOaBTMnFcQIG.woff2
--------------------------------------------------------------------------------
/test-harness/wires/TaskItem.cfm:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/test-harness/wires/computedProperty.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/test-harness/wires/postEmit.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Emit Event
4 |
#args.message#
5 |
6 |
--------------------------------------------------------------------------------
/test-harness/wires/preEmit.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Emit Event
4 |
#args.message#
5 |
6 |
--------------------------------------------------------------------------------
/test-harness/wires/test/security/cbSecurity_secured_annotation_multiple_permission.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" secured="write,delete" {
2 |
3 | data = {};
4 |
5 | }
--------------------------------------------------------------------------------
/test-harness/wires/HelloWorld.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | function onRender(){
4 | return "Hello World #now()#
";
5 | }
6 |
7 | }
8 |
--------------------------------------------------------------------------------
/test-harness/wires/test/security/onsecure_block_always.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
This wire should never render.
4 |
KeyOne:#keyOne#
5 |
6 |
--------------------------------------------------------------------------------
/test-harness/wires/poll.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | Current timestamp: #dateTimeFormat( args.timestamp, "full")#
4 |
5 |
--------------------------------------------------------------------------------
/test-harness/wires/databinding.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Length: #len( args.message )#
4 |
#args.message#
5 |
6 |
--------------------------------------------------------------------------------
/test-harness/tests/templates/childcomponentwithkey.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Main component
4 | #wire( "ChildComponent", {}, "childComponent" )#
5 |
6 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_implicitly_render_a_view_template.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | title: "I rendered from onRender"
5 | };
6 |
7 | }
8 |
--------------------------------------------------------------------------------
/test-harness/wires/usingSet.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | #args.name#
4 |
Reset Name
5 |
6 |
--------------------------------------------------------------------------------
/models/EmptySingleFileComponent.bx:
--------------------------------------------------------------------------------
1 | class extends="{{ EXTENDS_PATH }}" {
2 |
3 | {{ CFC_CONTENTS }}
4 |
5 | function onRender() {
6 | return template( "{{ TEMPLATE_PATH }}" );
7 | }
8 |
9 | }
--------------------------------------------------------------------------------
/test-harness/wires/BindingNestedData.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | function onRender(){
4 | return this.renderView( "wires/bindingNestedData" );
5 | }
6 |
7 | }
8 |
--------------------------------------------------------------------------------
/test-harness/wires/DirectiveLoading.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | function start() {
4 | // Simulate some long running process
5 | sleep( 5000 );
6 | }
7 | }
--------------------------------------------------------------------------------
/test-harness/wires/passActionArgs.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | Say Hello To Waldo
4 | #args.message#
5 |
6 |
--------------------------------------------------------------------------------
/test-harness/wires/test/child2.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
child 2
4 |
5 |
6 |
7 |
8 | // @startWire
9 |
10 | // @endWire
11 |
--------------------------------------------------------------------------------
/test-harness/wires/test/security/cbSecurity_secured_annotation_eq_false.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Wire Template: cbSecurity_secured_annotation_eq_false.cfm
4 |
5 |
6 |
--------------------------------------------------------------------------------
/models/EmptySingleFileComponent.cfc:
--------------------------------------------------------------------------------
1 | component extends="{{ EXTENDS_PATH }}" {
2 |
3 | {{ CFC_CONTENTS }}
4 |
5 | function onRender() {
6 | return template( "{{ TEMPLATE_PATH }}" );
7 | }
8 |
9 | }
--------------------------------------------------------------------------------
/test-harness/tests/templates/SingleFileComponent.cfm:
--------------------------------------------------------------------------------
1 |
2 | data = {
3 | "name": "Single File Component"
4 | };
5 |
6 |
7 |
8 | Name: #name#
9 |
--------------------------------------------------------------------------------
/test-harness/wires/ComputedPropertiesCache.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | function getTick() computed {
4 | sleep( 1000 );
5 | return getTickCount();
6 | }
7 | }
--------------------------------------------------------------------------------
/test-harness/wires/TestAlwaysLazyComponent.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
#data.title#
4 |
This component has lazy = true and should always be lazy loaded by default.
5 |
6 |
--------------------------------------------------------------------------------
/test-harness/wires/test/security/onrender_custom_block_message_from_wire.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Wire Template: onrender_custom_block_message_from_wire.cfm
4 |
5 |
6 |
--------------------------------------------------------------------------------
/test-harness/wires/loadingAndDisablingButton.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Checkout
5 |
6 |
7 |
--------------------------------------------------------------------------------
/test-harness/wires/test/security/onrender_block_from_prc.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
A CBWire Secure Component
4 |
This component uses the onSecure() method.
5 |
6 |
7 |
--------------------------------------------------------------------------------
/test-harness/wires/testcomponentwithmalformedtemplate.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Test Component
4 |
5 |
6 |
This is a bad template
7 |
8 |
--------------------------------------------------------------------------------
/test-harness/wires/DirectiveDirty.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "foo": ""
5 | };
6 |
7 | function save() {
8 | // do something
9 | }
10 | }
--------------------------------------------------------------------------------
/test-harness/wires/dataBindingCount.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | +
4 | #args.count#
5 |
6 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_render_a_component.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 |
4 | // @endWire
5 |
6 |
7 |
8 |
9 | Component
10 |
11 |
--------------------------------------------------------------------------------
/test-harness/wires/ChildComponent.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Child Component
4 |
Rendered at #now()#
5 |
Refresh
6 |
7 |
--------------------------------------------------------------------------------
/test-harness/wires/DirectiveClick.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "clicks": 0
5 | };
6 |
7 | function increment() {
8 | data.clicks += 1;
9 | }
10 | }
--------------------------------------------------------------------------------
/test-harness/wires/test/security/cbSecurity_secured_annotation_multiple_permission.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Wire Template: cbSecurity_secured_annotation_multiple_permission.cfm
4 |
5 |
--------------------------------------------------------------------------------
/test-harness/wires/test/security/cbSecurity_secured_annotation_single_permission.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Wire Template: cbSecurity_secured_annotation_single_permission.cfm
4 |
5 |
6 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_render_with_renderIt_for_backwards_compatibility.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 | function renderIt() {
3 | return "I rendered from renderIt
";
4 | }
5 | }
--------------------------------------------------------------------------------
/test-harness/wires/Getter.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | computed = { "name" : "Rubble on the double" };
4 |
5 | function onMount(){
6 | data.name = "Blah";
7 | }
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/test-harness/wires/NestedComponents.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "clicked": false
5 | };
6 |
7 | function click() {
8 | data.clicked = true;
9 | }
10 | }
--------------------------------------------------------------------------------
/test-harness/wires/TeleportChild.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "ran": false
5 | };
6 |
7 | function runTeleport() {
8 | data.ran = true;
9 | }
10 | }
--------------------------------------------------------------------------------
/test-harness/wires/loading.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Checkout
4 |
5 |
6 | Processing payment...
7 |
8 |
9 |
--------------------------------------------------------------------------------
/test-harness/tests/templates/validation.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | #validation.getAllErrors( "email" ).first()#
5 |
6 |
7 |
--------------------------------------------------------------------------------
/test-harness/views/examples/poll.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | #wire( wireComponent )#
5 | #renderView( view="/wires/showCode", args={
6 | wireComponent: wireComponent
7 | } )#
8 |
--------------------------------------------------------------------------------
/test-harness/wires/deferloading.cfm:
--------------------------------------------------------------------------------
1 |
2 |
9 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_raise_error_for_single_file_component.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/test-harness/views/examples/getter.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | #wire( wireComponent )#
5 | #renderView( view="/wires/showCode", args={
6 | wireComponent: wireComponent
7 | } )#
8 |
--------------------------------------------------------------------------------
/test-harness/wires/ShowCode.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = [
4 | "component": ""
5 | ];
6 |
7 | function onMount( params ) {
8 | data.component = params.wire;
9 | }
10 | }
--------------------------------------------------------------------------------
/includes/js/livewire/js/directives/wire-cloak.js:
--------------------------------------------------------------------------------
1 | import Alpine from 'alpinejs'
2 |
3 | Alpine.interceptInit(el => {
4 | if (el.hasAttribute('wire:cloak')) {
5 | Alpine.mutateDom(() => el.removeAttribute('wire:cloak'))
6 | }
7 | })
8 |
--------------------------------------------------------------------------------
/test-harness/tests/templates/udfmethod.cfm:
--------------------------------------------------------------------------------
1 |
2 |
9 |
--------------------------------------------------------------------------------
/test-harness/views/examples/callmethod.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | #wire( wireComponent )#
5 | #renderView( view="/wires/showCode", args={
6 | wireComponent: wireComponent
7 | } )#
8 |
--------------------------------------------------------------------------------
/test-harness/wires/DirectiveKeydown.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "lastTyping": now()
5 | };
6 |
7 | function updateTime() {
8 | data.lastTyping = now();
9 | }
10 | }
--------------------------------------------------------------------------------
/test-harness/wires/OnHydrate.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Hydrated: #hydrated#
4 |
Hydrated Property: #hydratedProperty#
5 |
Click me
6 |
7 |
--------------------------------------------------------------------------------
/test-harness/wires/TestComponentWithInvalidListener.cfc:
--------------------------------------------------------------------------------
1 | component extends="TestComponent" {
2 |
3 | listeners = {
4 | "someEvent": "someMethod"
5 | };
6 |
7 | function init() {
8 | super.init();
9 | }
10 | }
--------------------------------------------------------------------------------
/test-harness/wires/js.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | Submitted: #submitted#
4 |
5 | Submit
6 |
7 |
--------------------------------------------------------------------------------
/test-harness/wires/test/child1.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
child 1
4 | #wire( "test.child2" )#
5 |
6 |
7 |
8 |
9 | // @startWire
10 |
11 | // @endWire
12 |
--------------------------------------------------------------------------------
/test-harness/wires/DirectivePoll.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "loop": 1,
5 | "seconds": 5
6 | };
7 |
8 | function incrementLoop() {
9 | data.loop += 1;
10 | }
11 | }
--------------------------------------------------------------------------------
/test-harness/wires/Entangle.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "counter": 0,
5 | "name": "Grant"
6 | };
7 |
8 | function increment() {
9 | data.counter += 1;
10 | }
11 | }
--------------------------------------------------------------------------------
/test-harness/wires/TaskItem.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "task": ""
5 | };
6 |
7 | function deleteTask( task ) {
8 | dispatch( "deleteTask", { task: task } );
9 | }
10 | }
--------------------------------------------------------------------------------
/test-harness/wires/computedPropertiesCache.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Computed Properties Cache
4 | #getTick()#
5 | #getTick()#
6 | #getTick( false )#
7 |
8 |
--------------------------------------------------------------------------------
/test-harness/wires/nestedComponent2.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | Nested component 2
4 |
Say Something Again
5 |
#args.message#
6 |
7 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_provide_id_variable_to_template.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 |
4 | // @endWire
5 |
6 |
7 |
8 |
9 |
Component ID: #_id#
10 |
11 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_support_refresh_action.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 |
4 | // @endWire
5 |
6 |
7 |
8 |
9 |
Refreshed at #getTickCount()#
10 |
11 |
--------------------------------------------------------------------------------
/test-harness/wires/WireModel.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 | data = [
3 | "username": ""
4 | ];
5 |
6 | function submit(){
7 | // Called by wire:submit
8 | // Do nothing for now
9 | }
10 | }
--------------------------------------------------------------------------------
/test-harness/wires/test/security/cbSecurity_method_secured_annotation.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Wire Template: cbSecurity_method_secured_annotation.cfm
4 |
KeyOne:#keyOne#
5 |
KeyTwo:#keyTwo#
6 |
7 |
--------------------------------------------------------------------------------
/test-harness/wires/testuicomponent.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
#args.message#
4 |
Count #args.computed.counter()#
5 |
6 | The button
7 |
8 |
9 |
--------------------------------------------------------------------------------
/test-harness/wires/CallAction.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "message": ""
5 | };
6 |
7 | function callAction(){
8 | data.message = "We have called our action!";
9 | }
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/test-harness/wires/WireModelLive.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 | data = [
3 | "username": ""
4 | ];
5 |
6 | function submit(){
7 | // Called by wire:submit
8 | // Do nothing for now
9 | }
10 | }
--------------------------------------------------------------------------------
/test-harness/wires/test/should_be_able_to_render_coldbox_views_using_view_from_a_component.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | function onRender() {
4 | return view( "testView", { input: "Rendered from component!" } );
5 | }
6 | }
--------------------------------------------------------------------------------
/test-harness/layouts/Main.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CBWIRE 4
6 |
7 |
8 |
9 | Welcome to CBWIRE
10 |
11 |
12 | #view()#
13 |
14 |
15 |
--------------------------------------------------------------------------------
/test-harness/wires/Loading.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | function checkout(){
4 | sleep( 5000 );
5 | }
6 |
7 | function onRender(){
8 | return this.renderView( "wires/loading" );
9 | }
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/test-harness/wires/SubmitButton.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "message": ""
5 | };
6 |
7 | function clickButton() {
8 | data.message = "Form submit button was clicked!";
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/test-harness/wires/TestParentWithLazyChild.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
#data.title#
4 |
This parent component renders a child component with lazy = true:
5 | #wire( name="TestAlwaysLazyComponent", key="lazyChild" )#
6 |
7 |
--------------------------------------------------------------------------------
/test-harness/wires/computedpropertygetter.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
My computed property getter
4 |
Calculation: #args.calculation#
5 |
Do Something
6 |
7 |
--------------------------------------------------------------------------------
/.claude/settings.local.json:
--------------------------------------------------------------------------------
1 | {
2 | "permissions": {
3 | "allow": [
4 | "Bash(find:*)",
5 | "Bash(box testbox run:*)",
6 | "WebSearch",
7 | "WebFetch(domain:github.com)"
8 | ],
9 | "deny": [],
10 | "ask": []
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/test-harness/.cfconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "debuggingEnabled":true,
3 | "debuggingReportExecutionTimes":false,
4 | "disableInternalCFJavaComponents":false,
5 | "inspectTemplate":"always",
6 | "requestTimeout":"0,0,0,90",
7 | "robustExceptionEnabled":true
8 | }
--------------------------------------------------------------------------------
/test-harness/modules_external/ExternalModule/wires/should_load_external_modules.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
External Module Loaded
4 |
5 |
6 |
7 |
8 | // @startWire
9 |
10 | // @endWire
11 |
--------------------------------------------------------------------------------
/test-harness/wires/LogBox.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component"{
2 |
3 | function onMount(){
4 | log.debug( "Loaded mount()" );
5 | }
6 |
7 | function onRender(){
8 | return renderView( "wires/logbox" );
9 | }
10 |
11 | }
--------------------------------------------------------------------------------
/test-harness/wires/callaction.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Call action
5 | #args.message#
6 |
7 |
8 |
--------------------------------------------------------------------------------
/test-harness/wires/lazyloading.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Lazy Loading
4 |
5 |
6 | #wire( name="SlowComponent", params={ "sleepTime": 1000 }, lazy=true )#
7 |
8 |
9 |
--------------------------------------------------------------------------------
/test-harness/wires/test/shouldnt_isolate_by_default.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 | data = {
4 | };
5 | // @endWire
6 |
7 |
8 |
9 |
10 |
Shouldn't isolate by default
11 |
12 |
--------------------------------------------------------------------------------
/test-harness/modules_external/ExternalModule/handlers/Home.cfc:
--------------------------------------------------------------------------------
1 | /**
2 | * The main module handler
3 | */
4 | component{
5 |
6 | /**
7 | * Module EntryPoint
8 | */
9 | function index( event, rc, prc ){
10 | event.setView( "home/index" );
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/test-harness/wires/fireEvent.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Emit An Event
4 |
JS $emit('someOtherEvent')
5 |
#args.message#
6 |
7 |
--------------------------------------------------------------------------------
/test-harness/wires/nestedcomponents.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | Click Me
4 |
5 | #wire( "NestedComponents" )#
6 |
7 |
8 |
--------------------------------------------------------------------------------
/test-harness/wires/teleport.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Teleport
4 |
5 | #wire( "TeleportChild" )#
6 |
7 |
Teleported Data from Child
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/test-harness/modules_external/ExternalModule/config/Router.cfc:
--------------------------------------------------------------------------------
1 | /**
2 | * Module Router
3 | * https://coldbox.ortusbooks.com/the-basics/routing/routing-dsl
4 | */
5 | component{
6 |
7 | function configure(){
8 |
9 | route( "/", "Home.index" );
10 |
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/test-harness/views/examples/resetpropertiestoinitialstate.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | #wire( wireComponent )#
5 | #renderView( view="/wires/showCode", args={
6 | wireComponent: wireComponent
7 | } )#
8 |
--------------------------------------------------------------------------------
/test-harness/wires/CounterUsingArgsDot.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Counter: #data.count#
5 |
6 |
7 | Increment
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/test-harness/wires/CounterUsingDataDot.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Counter: #data.count#
5 |
6 |
7 | Increment
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/test-harness/wires/TestParentWithOverride.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
#data.title#
4 |
This parent component overrides child's lazy = true with lazy = false:
5 | #wire( name="TestAlwaysLazyComponent", key="overrideChild", lazy=false )#
6 |
7 |
--------------------------------------------------------------------------------
/test-harness/wires/directivedirty.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
Save
5 |
There's some stuff not saved yet.
6 |
7 |
--------------------------------------------------------------------------------
/test-harness/wires/emitTo.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | Fire this.$emitTo( "livewire.FireEvent2", "someEvent" ) within an action
4 |
5 | FireEvent2
6 | #wire( "FireEvent2" )#
7 |
8 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_raise_error_for_template_rendering_error.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 |
4 | // @endWire
5 |
6 |
7 |
8 |
11 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_support_child_components.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 |
4 | // @endWire
5 |
6 |
7 |
8 |
9 |
Main component
10 | #wire( "wires.test.child_component" )#
11 |
12 |
--------------------------------------------------------------------------------
/test-harness/anotherFolder/OutsideFolderComponent.cfm:
--------------------------------------------------------------------------------
1 |
2 | //@startWire
3 |
4 | data = {
5 | "title": "outside component"
6 | }
7 |
8 | //@endWire
9 |
10 |
11 |
12 |
13 | #title#
14 |
15 |
--------------------------------------------------------------------------------
/test-harness/wires/DataProperties.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Welcome To #conference#
4 |
5 | toggle value: #toggleValue#
6 | Toggle value
7 |
8 |
9 |
--------------------------------------------------------------------------------
/test-harness/wires/listeners.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
--------------------------------------------------------------------------------
/test-harness/wires/passparameters.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | Pizza Toppings:
4 |
5 |
6 | #topping#
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_redirect_the_user.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 | function someMethod() {
4 | redirect( "/some-uri" );
5 | }
6 | // @endWire
7 |
8 |
9 |
10 |
11 | Component
12 |
13 |
--------------------------------------------------------------------------------
/test-harness/wires/Counter.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Counter
4 |
Current: #counter#
5 |
6 | Increment
7 |
8 |
9 |
--------------------------------------------------------------------------------
/test-harness/wires/CounterUsingComputedProperty.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Counter: #countPlusTen()#
5 |
6 |
7 | Increment
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/test-harness/wires/EmitTo.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | function someAction(){
4 | this.emitTo( "wires.FireEvent2", "someEvent" );
5 | }
6 |
7 | function onRender(){
8 | return this.renderView( "wires/emitTo" );
9 | }
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/test-harness/wires/UsingSet.cfc:
--------------------------------------------------------------------------------
1 | component
2 | extends="cbwire.models.Component"
3 | accessors="true"
4 | {
5 |
6 | data = {
7 | "name": "Marty"
8 | };
9 |
10 | function onRender(){
11 | return this.renderView( "wires/usingSet" );
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/test-harness/wires/superheroesvalidation.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | #error.getMessage()#
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_render_string_booleans_as_booleans.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 | data = {
4 | "stringBooleanValue": "true"
5 | }
6 | // @endWire
7 |
8 |
9 |
10 |
11 | Component
12 |
13 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_render_with_a_onRender_method.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | title: "I rendered from onRender"
5 | };
6 |
7 | function onRender() {
8 | return "";
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/test-harness/handlers/Main.cfc:
--------------------------------------------------------------------------------
1 | /**
2 | * My Event Handler Hint
3 | */
4 | component {
5 |
6 | // Index
7 | any function index( event, rc, prc ){
8 | event.setView( "main/index" );
9 | }
10 |
11 | // Run on first init
12 | any function onAppInit( event, rc, prc ){
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/test-harness/wires/DeferLoading.cfc:
--------------------------------------------------------------------------------
1 |
2 | // ./wires/TaskList.cfc
3 | component extends="cbwire.models.Component" {
4 |
5 | data = {
6 | "tasks": []
7 | };
8 |
9 | function loadTasks(){
10 | data.tasks = data.tasks.append( "yep" );
11 | }
12 |
13 |
14 | }
--------------------------------------------------------------------------------
/test-harness/wires/HelloWorldWithRenderViewPropertyAndArgs.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = { "message" : "Hello world" };
4 |
5 | function onRender(){
6 | return this.view( "wires/helloWorldWithRenderViewPropertyAndArgs" );
7 | }
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/test-harness/wires/LoadingAndDisablingButton.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | function checkout(){
4 | sleep( 5000 );
5 | }
6 |
7 | function onRender(){
8 | return this.renderView( "wires/loadingAndDisablingButton" );
9 | }
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/test-harness/wires/test/child_component.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 | function placeholder() {
4 | return "placeholder
";
5 | }
6 | // @endWire
7 |
8 |
9 |
10 |
11 |
Child component
12 |
13 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_be_able_to_access_event_from_template.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Event is object: #isObject( event ) ? 'true' : 'false'#
4 |
Request collection is struct: #isStruct( event.getCollection() ) ? 'true' : 'false'#
5 |
6 |
7 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_extend_custom_basewire_from_single_file_component.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Result: #sayHello()#
4 |
5 |
6 |
7 |
8 | // @extends('wires.test.BaseWire')
9 | // @startWire
10 |
11 | // @endWire
12 |
13 |
--------------------------------------------------------------------------------
/includes/js/livewire/js/directives/wire-init.js:
--------------------------------------------------------------------------------
1 | import { directive } from "@/directives"
2 | import Alpine from 'alpinejs'
3 |
4 | directive('init', ({ el, directive }) => {
5 | let fullMethod = directive.expression ?? '$refresh'
6 |
7 | Alpine.evaluate(el, `$wire.${fullMethod}`)
8 | })
9 |
10 |
--------------------------------------------------------------------------------
/test-harness/wires/OnUploadError.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Upload Errored: #uploadErrored#
4 |
Errored Property Name: #erroredPropertyName#
5 |
Error Info: #errorInfo#
6 |
Is Multiple: #isMultiple#
7 |
8 |
9 |
--------------------------------------------------------------------------------
/test-harness/wires/SignupForm.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "name": "",
5 | "email": "",
6 | "zip": "",
7 | "submitted": false
8 | };
9 |
10 | function submitForm() {
11 | data.submitted = true;
12 | }
13 | }
--------------------------------------------------------------------------------
/test-harness/wires/TestComponentWithoutPlaceholder.cfm:
--------------------------------------------------------------------------------
1 |
2 | test component without placeholder
3 |
4 |
5 |
6 | // @startWire
7 | data = {};
8 |
9 | function placeholder() {
10 | return "";
11 | }
12 | // @endWire
13 |
--------------------------------------------------------------------------------
/test-harness/wires/nestedComponent/NestedFolderComponent.cfm:
--------------------------------------------------------------------------------
1 |
2 | //@startWire
3 |
4 | data = {
5 | "title": "Nested folder component"
6 | }
7 |
8 | //@endWire
9 |
10 |
11 |
12 |
13 | #title#
14 |
15 |
--------------------------------------------------------------------------------
/test-harness/wires/passedparametersprovidedtomount.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | Pizza Toppings:
4 |
5 |
6 | #topping#
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_trim_string_values_if_global_setting_enabled.cfm:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 | // @startWire
9 | data = {
10 | "name": "Jane Doe"
11 | };
12 | // @endWire
13 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_be_able_to_render_coldbox_views_using_view_from_a_template.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 |
4 | // @endWire
5 |
6 |
7 |
8 |
9 | #view( view="testView", args={ input: "Rendered using view()!" })#
10 |
11 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_display_component_errors_in_a_CBWIRE_custom_exception_page.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 | function onMount() {
4 | x = y;
5 | }
6 | // @endWire
7 |
8 |
9 |
10 |
11 | Component
12 |
13 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_extend_custom_basewire_from_single_file_boxlang_component.bxm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Result: #sayHello()#
4 |
5 |
6 |
7 |
8 | // @extends('wires.test.BaseWire')
9 | // @startWire
10 |
11 | // @endWire
12 |
13 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_redirect_the_user_using_navigate.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 | function someMethod() {
4 | redirect( "/some-uri", true );
5 | }
6 | // @endWire
7 |
8 |
9 |
10 |
11 | Component
12 |
13 |
--------------------------------------------------------------------------------
/includes/js/livewire/js/plugins/navigate/bus.js:
--------------------------------------------------------------------------------
1 | let listeners = {}
2 |
3 | export function listen(event, callback) {
4 | listeners[event] = [...(listeners[event] || []), callback]
5 | }
6 |
7 | export function emit(event, ...props) {
8 | (listeners[event] || []).forEach(handle => handle(...props))
9 | }
10 |
--------------------------------------------------------------------------------
/test-harness/wires/Counter.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 | data = {
3 | "counter": 0
4 | };
5 |
6 | function increment() {
7 | data.counter++;
8 | }
9 |
10 | function placeholder() {
11 | return "some placeholder
";
12 | }
13 |
14 | }
--------------------------------------------------------------------------------
/test-harness/wires/TestAlwaysLazyComponent.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | lazy = true;
4 |
5 | data = {
6 | "title": "Always Lazy Component"
7 | };
8 |
9 | function placeholder() {
10 | return "Always Lazy Placeholder
";
11 | }
12 |
13 | }
--------------------------------------------------------------------------------
/test-harness/wires/nestedComponent1.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | Nested component 1
4 |
Say Something
5 |
#args.message#
6 |
7 | #wire( "NestedComponent2" )#
8 |
9 |
10 |
--------------------------------------------------------------------------------
/test-harness/wires/test/security/cbSecurity_secured_annotation.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Wire Template: cbSecurity_secured_annotation.cfm
4 |
KeyOne:#keyOne#
5 |
KeyTwo:#keyTwo#
6 |
KeyThree:#keyThree#
7 |
KeyFour:#keyFour#
8 |
9 |
10 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_be_able_to_call_udf_from_template.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 | function adder( a, b ) {
4 | return a + b;
5 | }
6 | // @endWire
7 |
8 |
9 |
10 |
11 |
Result: #adder( 1, 2 )#
12 |
13 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_support_deep_nesting.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Should support deep nesting
4 | #wire( "test.child1" )#
5 | #wire( "test.child1" )#
6 |
7 |
8 |
9 |
10 | // @startWire
11 |
12 | // @endWire
13 |
--------------------------------------------------------------------------------
/includes/js/livewire/js/directives/wire-replace.js:
--------------------------------------------------------------------------------
1 | import { directive } from "@/directives"
2 |
3 | directive('replace', ({ el, directive }) => {
4 | if (directive.modifiers.includes('self')) {
5 | el.__livewire_replace_self = true
6 | } else {
7 | el.__livewire_replace = true
8 | }
9 | })
10 |
--------------------------------------------------------------------------------
/test-harness/modules_app/testingmodule/myComponents/NestedModuleComponent.cfm:
--------------------------------------------------------------------------------
1 |
2 | //@startWire
3 |
4 | data = {
5 | "title": "Nested module component"
6 | }
7 |
8 | //@endWire
9 |
10 |
11 |
12 |
13 | #title#
14 |
15 |
--------------------------------------------------------------------------------
/test-harness/tests/templates/basicCFComponent.cfc:
--------------------------------------------------------------------------------
1 | component displayname="basicCFComponent" output="false" {
2 |
3 | public basicCFComponent function init() {
4 | return this;
5 | }
6 |
7 | public string function helloTestBox(){
8 | return "Hello Testbox! "
9 | }
10 |
11 | }
--------------------------------------------------------------------------------
/test-harness/wires/PassedParametersProvidedToMount.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "pizzaToppings": ""
5 | };
6 |
7 | function onMount( parameters, event, rc, prc ){
8 | data.pizzaToppings = arguments.parameters.otherPizzaToppings;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_dispatch_an_event_without_params.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 | function dispatchWithoutParams() {
4 | dispatch( "someEvent" );
5 | }
6 | // @endWire
7 |
8 |
9 |
10 |
11 | Component
12 |
13 |
14 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_isolate_when_using_isolate_true.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 | isolate = true;
4 |
5 | data = {
6 | };
7 | // @endWire
8 |
9 |
10 |
11 |
12 |
Should isolate when using isolate=true
13 |
14 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_render_with_correct_snapshot_effects_and_id_attribute.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 | data = {
4 | "name": "Jane Doe"
5 | }
6 | // @endWire
7 |
8 |
9 |
10 |
11 |
Content goes here
12 |
13 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_render_a_singlefile_boxlang_component.bxm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
#title#
4 |
5 |
6 |
7 |
8 | // @startWire
9 | data = {
10 | "title": "A Single File Boxlang Component"
11 | };
12 | // @endWire
13 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_support_accessing_data_properties_using_legacy_args_scope.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 | data = {
4 | "name": "Jane Doe"
5 | };
6 | // @endWire
7 |
8 |
9 |
10 |
11 |
Name: #args.name#
12 |
13 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_support_computed_properties.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 | function generateUUID() computed {
4 | return createUUID();
5 | }
6 | // @endWire
7 |
8 |
9 |
10 |
11 |
UUID: #generateUUID()#
12 |
13 |
--------------------------------------------------------------------------------
/test-harness/modules_app/testingmodule/wires/nestedComponent/NestedFolderComponent.cfm:
--------------------------------------------------------------------------------
1 |
2 | //@startWire
3 |
4 | data = {
5 | "title": "Nested folder component"
6 | }
7 |
8 | //@endWire
9 |
10 |
11 |
12 |
13 | #title#
14 |
15 |
--------------------------------------------------------------------------------
/test-harness/wires/computedproperties.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Welcome To #conference()#
4 |
Speakers
5 |
6 |
7 | #firstname# #lastname#
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/test-harness/wires/DataBindingCount.cfc:
--------------------------------------------------------------------------------
1 | component
2 | extends="cbwire.models.Component"
3 | {
4 |
5 | data = { "count" : 0 };
6 |
7 | function increment(){
8 | data.count += 1;
9 | }
10 |
11 | function onRender(){
12 | return this.renderView( "wires/dataBindingCount" );
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/test-harness/wires/ParentChildComponent.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 | data = {
3 | "name": "Grant",
4 | "toggle": true
5 | };
6 |
7 | function toggleComps() {
8 | data.toggle = !data.toggle;
9 | }
10 |
11 | function reload() {
12 | refresh();
13 | }
14 | }
--------------------------------------------------------------------------------
/test-harness/wires/Poll.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "timestamp": now()
5 | };
6 |
7 | function getTimestamp(){
8 | return now() & "what!";
9 | }
10 |
11 | function onRender(){
12 | return this.renderView( "wires/poll" );
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_dispatch_an_event_with_params.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 | function dispatchWithParams() {
4 | dispatch( "someEvent", { name: "CBWIRE" } );
5 | }
6 | // @endWire
7 |
8 |
9 |
10 |
11 | Component
12 |
13 |
14 |
--------------------------------------------------------------------------------
/test-harness/tests/templates/templateWithComments.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 | Template with comments
9 | #now()#
10 |
11 |
--------------------------------------------------------------------------------
/test-harness/wires/Listeners.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | // Data properties
4 | data = {
5 | "message": "Is it lunch time yet?"
6 | };
7 |
8 | // Action
9 | function sendMessage() {
10 | // Emit event from CBWIRE
11 | dispatch( "success", now() );
12 | }
13 | }
--------------------------------------------------------------------------------
/test-harness/wires/NestedComponent1.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = { "message" : "" };
4 |
5 | function saySomething(){
6 | data.message = "Something";
7 | }
8 |
9 | function onRender(){
10 | return this.renderView( "wires/nestedComponent1" );
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/test-harness/wires/Relocate.cfc:
--------------------------------------------------------------------------------
1 | component
2 | extends="cbwire.models.Component"
3 | accessors="true"
4 | {
5 |
6 | function goElsewhere(){
7 | return relocate( url = "https://www.google.com" );
8 | }
9 |
10 | function onRender(){
11 | return renderView( "wires/relocate" );
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/test-harness/wires/JS.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "submitted": false
5 | };
6 |
7 | function submit() {
8 | js( "alert('Hello from CBWIRE!')" );
9 | js( "console.log( 'Output to console from CBWIRE!')" );
10 | js( "$wire.submitted = true" );
11 | }
12 | }
--------------------------------------------------------------------------------
/test-harness/wires/test/should_trim_string_values_if_enabled_on_component.cfm:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 | // @startWire
9 | trimStringValues = true;
10 |
11 | data = {
12 | "name": "Jane Doe"
13 | };
14 | // @endWire
15 |
--------------------------------------------------------------------------------
/test-harness/modules_app/testingmodule/wires/NestedModuleDefaultComponent.cfm:
--------------------------------------------------------------------------------
1 |
2 | //@startWire
3 |
4 | data = {
5 | "title": "Nested module component using default wires location"
6 | }
7 |
8 | //@endWire
9 |
10 |
11 |
12 |
13 | #title#
14 |
15 |
--------------------------------------------------------------------------------
/test-harness/wires/Mount.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "message": "Default value"
5 | };
6 |
7 | function onMount(){
8 | data.message = "Mounted value";
9 | }
10 |
11 | function onRender(){
12 | return this.renderView( "wires/mount" );
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/test-harness/wires/NestedComponent2.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = { "message" : "" };
4 |
5 | function saySomething(){
6 | data.message = "Something ( again )!";
7 | }
8 |
9 | function onRender(){
10 | return this.renderView( "wires/nestedComponent2" );
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/test-harness/wires/TestTableRowComponent.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | test table row component
4 |
5 |
6 |
7 |
8 | // @startWire
9 | data = {};
10 |
11 | function placeholder() {
12 | return "some placholder ";
13 | }
14 | // @endWire
15 |
--------------------------------------------------------------------------------
/test-harness/wires/teleportchild.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Run Teleport
5 |
6 |
7 |
8 | @teleport("##teleport-div")
9 | #now()#
10 | @endTeleport
11 |
12 |
13 |
--------------------------------------------------------------------------------
/test-harness/wires/test/security/onsecure_block_always.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "keyOne" : "valueOne"
5 | };
6 |
7 | function onSecure( event, prc, isInitial, params ) {
8 | return false;
9 | }
10 |
11 | function updateDataKeyOne() {
12 | data.keyOne = "updatedValueOne";
13 | }
14 |
15 | }
--------------------------------------------------------------------------------
/test-harness/wires/directivepoll.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Polling
4 |
5 |
6 |
7 | #now()#
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/test-harness/wires/test/html_with_quotes.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | #content#
4 |
5 |
6 |
7 |
8 | // @startWire
9 | data = {
10 | "content": ""
11 | }
12 |
13 | function onMount( params ) {
14 | data.content = params.content;
15 | }
16 | // @endWire
17 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_detect_lazy_loaded_children.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 |
4 | // @endWire
5 |
6 |
7 |
8 |
9 |
Parent
10 |
11 | #wire( name="test.child_component", lazy=true )#
12 |
13 |
14 |
--------------------------------------------------------------------------------
/test-harness/wires/TestSingleFileComponent.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | something goes here #name#
4 |
5 |
6 |
7 |
8 | // @startWire
9 | data = {
10 | "name": "someName123234"
11 | };
12 |
13 | function test() {
14 |
15 | }
16 | // @endWire
17 |
18 |
--------------------------------------------------------------------------------
/.markdownlint.json:
--------------------------------------------------------------------------------
1 | {
2 | "line-length": false,
3 | "single-h1": false,
4 | "no-hard-tabs" : false,
5 | "fenced-code-language" : false,
6 | "no-bare-urls" : false,
7 | "first-line-h1": false,
8 | "no-multiple-blanks": {
9 | "maximum": 2
10 | },
11 | "no-duplicate-header" : {
12 | "siblings_only" : true
13 | },
14 | "no-inline-html" : false
15 | }
16 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_cache_computed_properties.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 | function generateUUID() computed {
4 | return createUUID();
5 | }
6 | // @endWire
7 |
8 |
9 |
10 |
11 |
UUID: #generateUUID()#
12 |
UUID2: #generateUUID()#
13 |
14 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_support_passing_params_into_a_onRender_method.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | title: "I rendered from onRender"
5 | };
6 |
7 | function onRender() {
8 | return template( "wires.test.should_support_passing_params_into_a_onRender_method", { "value": 5 } );
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/test-harness/wires/ComputedPropertyGetter.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component"{
2 |
3 | data = {
4 | "calculation": 0
5 | };
6 |
7 | computed = {
8 | "onePlusTwo": function() {
9 | return 1 + 2;
10 | }
11 | }
12 |
13 | function doSomething(){
14 | data.calculation = this.getOnePlusTwo();
15 | }
16 | }
--------------------------------------------------------------------------------
/test-harness/wires/Validation.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "firstname": "sdfsad",
5 | "lastname": ""
6 | }
7 |
8 | this.constraints = {
9 | "firstname": { required: true }
10 | };
11 |
12 | function submit() {
13 | validateOrFail();
14 | data.firstname = "what";
15 | }
16 | }
--------------------------------------------------------------------------------
/test-harness/wires/checkboxinput.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Toggle
5 |
6 |
7 |
8 |
9 | Checkbox is checked!
10 |
11 |
12 |
--------------------------------------------------------------------------------
/test-harness/wires/resetPropertiesToInitialState.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | #args.name#
5 |
6 |
7 | Change Name
8 | Reset Name
9 |
10 |
11 |
--------------------------------------------------------------------------------
/test-harness/wires/FormValidation.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | constraints = {
4 | "email": { required: true, type: "email" }
5 | };
6 |
7 | data = {
8 | "email": "",
9 | "success": false
10 | };
11 |
12 | function addEmail() {
13 | validateOrFail();
14 | data.success = true;
15 | }
16 | }
--------------------------------------------------------------------------------
/test-harness/wires/submitbutton.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_alllow_without_markers_for_single_file_component.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | someString="Hello, CBWIRE!";
8 |
9 |
10 |
11 |
12 |
Test Without @startWire & @endWire
13 |
SUCCESS!
14 |
#someString#
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_not_auto_set_passed_in_params_if_onMount_is_defined.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 | data = {
4 | "name": "John Doe"
5 | };
6 |
7 | function onMount() {
8 | // do nothing for now
9 | }
10 | // @endWire
11 |
12 |
13 |
14 |
15 | Hello #name#!
16 |
17 |
--------------------------------------------------------------------------------
/test-harness/wires/QueryString.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = { "search" : "" };
4 |
5 | queryString = [ "search" ];
6 |
7 |
8 | function onMount( event ){
9 | data[ "search" ] = event.getValue( "search", "" );
10 | }
11 |
12 | function onRender(){
13 | return template( "wires.queryString" );
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/test-harness/wires/TaskList.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "newTask": "",
5 | "tasks": []
6 | };
7 |
8 | function addTask() {
9 | data.tasks.append( data.newTask );
10 | reset( "newTask" );
11 | }
12 |
13 | function onRender() {
14 | return template( "wires.TaskList" );
15 | }
16 |
17 | }
--------------------------------------------------------------------------------
/test-harness/wires/test/security/cbSecurity_method_secured_annotation.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "keyOne": "valueOne",
5 | "keyTwo": "valueTwo"
6 | };
7 |
8 | function updateDataKeyOne() {
9 | data.keyOne = "updatedValueOne";
10 | }
11 |
12 | function updateDataKeyTwo() secured {
13 | data.keyTwo = "updatedValueTwo";
14 | }
15 |
16 | }
--------------------------------------------------------------------------------
/test-harness/wires/test/should_alllow_without_markers_for_single_file_boxlang_component.bxm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | someString="Hello, CBWIRE!";
8 |
9 |
10 |
11 |
12 |
Test Without @startWire & @endWire
13 |
SUCCESS!
14 |
#someString#
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/test-harness/wires/textinput.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Length: #companyName.len()#
5 |
6 |
7 | Company name is too long
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/includes/js/livewire/js/features/supportRedirects.js:
--------------------------------------------------------------------------------
1 | import { on } from "@/hooks"
2 | import { shouldRedirectUsingNavigateOr } from "./supportNavigate"
3 |
4 | on('effect', ({ effects }) => {
5 | if (! effects['redirect']) return
6 |
7 | let url = effects['redirect']
8 |
9 | shouldRedirectUsingNavigateOr(effects, url, () => {
10 | window.location.href = url
11 | })
12 | })
13 |
--------------------------------------------------------------------------------
/test-harness/wires/ChatGPT.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | property name="jokeService" inject="JokeService";
4 |
5 | data = {
6 | "joke": ""
7 | };
8 |
9 | function getJoke() {
10 | stream( "joke", "", true );
11 | jokeService.getJoke( function( chunk ) {
12 | stream( "joke", chunk, false );
13 | } );
14 | }
15 | }
--------------------------------------------------------------------------------
/test-harness/wires/OnHydrate.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "hydrated": false,
5 | "hydratedProperty": false
6 | };
7 |
8 | function clicked() {}
9 |
10 | function onHydrate() {
11 | data.hydrated = true;
12 | }
13 |
14 | function onHydrateHydrated(){
15 | data.hydratedProperty = true;
16 | }
17 |
18 | }
--------------------------------------------------------------------------------
/test-harness/wires/test/should_not_render_cbwire_script_tags.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Should not render cbwire script tags
4 |
5 |
6 |
7 |
8 | // @startWire
9 |
10 | // @endWire
11 |
12 |
13 |
14 |
17 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_put_request_assets_in_head.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Should put assets in head
4 |
5 |
6 |
7 |
8 | // @startWire
9 |
10 | // @endWire
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # http://editorconfig.org
2 |
3 | root = true
4 |
5 | [*]
6 | end_of_line = lf
7 | charset = utf-8
8 | trim_trailing_whitespace = true
9 | insert_final_newline = false
10 | indent_style = tab
11 | indent_size = 4
12 | tab_width = 4
13 |
14 | [*.yml]
15 | indent_style = space
16 | indent_size = 2
17 |
18 | [*.{md,markdown}]
19 | trim_trailing_whitespace = false
20 | insert_final_newline = false
--------------------------------------------------------------------------------
/test-harness/wires/FileUpload.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "photo": "",
5 | "photos": []
6 | };
7 |
8 | function save() {
9 | // s3.put( data.myFile.get() );
10 | if ( isObject( data.photo ) ) {
11 | data.photo.destroy();
12 | }
13 | }
14 |
15 | function update() {
16 |
17 | }
18 | }
--------------------------------------------------------------------------------
/test-harness/wires/test/should_accept_false_flag_for_computed_properties_to_prevent_caching.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 | function generateUUID() computed {
4 | return createUUID();
5 | }
6 | // @endWire
7 |
8 |
9 |
10 |
11 |
UUID: #generateUUID()#
12 |
UUID2: #generateUUID( false )#
13 |
14 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_isolate_when_using_lazyLoad_true.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 | lazy = true;
4 |
5 | data = {
6 | };
7 |
8 | function placeholder() {
9 | return "Loading...
";
10 | }
11 | // @endWire
12 |
13 |
14 |
15 |
16 |
Should isolate when using lazy=true
17 |
18 |
--------------------------------------------------------------------------------
/models/services/UtilityService.cfc:
--------------------------------------------------------------------------------
1 | component accessors="true" {
2 |
3 | /**
4 | * Checks whether a file exists at the given path.
5 | *
6 | * @path string - The absolute path to check.
7 | * @return boolean - True if the file exists, false otherwise.
8 | */
9 | function fileExists( required string path ) {
10 | return fileExists( arguments.path );
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_not_render_cbwire_assets_tags.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Should not render cbwire assets tags
4 |
5 |
6 |
7 |
8 | // @startWire
9 |
10 | // @endWire
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_track_cbwire_assets_in_http_response.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Should track assets in http response
4 |
5 |
6 |
7 |
8 | // @startWire
9 |
10 | // @endWire
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/test-harness/wires/wiremodellive.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 | Hello, #username#!
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/includes/js/livewire/js/directives/wire-ignore.js:
--------------------------------------------------------------------------------
1 | import { directive } from "@/directives"
2 |
3 | directive('ignore', ({ el, directive }) => {
4 | if (directive.modifiers.includes('self')) {
5 | el.__livewire_ignore_self = true
6 | } else if (directive.modifiers.includes('children')) {
7 | el.__livewire_ignore_children = true
8 | } else {
9 | el.__livewire_ignore = true
10 | }
11 | })
12 |
--------------------------------------------------------------------------------
/test-harness/wires/PassActionArgs.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "message"= ""
5 | };
6 |
7 | function sayHello( required firstname, required lastname ){
8 | data.message = "Well hello " & arguments.firstname & " " & arguments.lastname;
9 | }
10 |
11 | function onRender(){
12 | return renderView( "wires/passActionArgs" );
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/test-harness/wires/multiselect.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Hello
5 | Adios
6 |
7 |
8 |
9 |
10 | You have selected #arrayLen( args.greeting )# options.
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/test-harness/wires/test/security/onrender_block_from_prc.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {};
4 |
5 | function onSecure( event, prc, isInitial, params ) {
6 | // Return true to allow rendering, false to block rendering
7 |
8 | // get the value from the event to determine if rendering is allowed
9 | return event.getValue( "allowTestWireRender", false, true );
10 | }
11 |
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/test-harness/wires/testcomponentusingargs.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Modules
4 |
5 |
Number Of Modules: #args.modules.len()#
6 |
7 |
8 |
9 |
10 | #module#
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/test-harness/index.cfm:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
--------------------------------------------------------------------------------
/test-harness/wires/CounterWithOnMount.cfc:
--------------------------------------------------------------------------------
1 | component extends="Counter" {
2 |
3 | function onMount( event, rc, prc, params ) {
4 | data.count = params.count;
5 | event.getValue( "test", "" );
6 | if ( !isStruct( arguments.rc ) ) {
7 | throw( "rc is not a struct" );
8 | }
9 | if ( !isStruct( arguments.prc ) ) {
10 | throw( "prc is not a struct" );
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/test-harness/wires/test/should_have_generated_getter_accessible_in_template.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 | data = {
4 | "name": "John",
5 | "age": 30,
6 | "city": "New York"
7 | };
8 | // @endWire
9 |
10 |
11 |
12 |
13 |
14 |
Name: #getName()#
15 |
Age: #getAge()#
16 |
City: #getCity()#
17 |
18 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_support_rendering_wires_with_xdata_and_arrow_functions.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 |
4 | // @endWire
5 |
6 |
7 |
8 |
16 | Component
17 |
18 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | # GitHub Actions - updates uses: statements in workflows
4 | - package-ecosystem: "github-actions"
5 | directory: "/" # Where your .github/workflows/ folder is
6 | schedule:
7 | interval: "weekly"
8 |
9 | # NPM
10 | - package-ecosystem: "npm"
11 | directory: "/system/exceptions" # adjust if needed
12 | schedule:
13 | interval: "weekly"
14 |
--------------------------------------------------------------------------------
/test-harness/wires/DataProperties.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" accessors="true" {
2 |
3 | data = {
4 | "conference": "Into the box",
5 | "toggleValue": false
6 | };
7 |
8 | computed = {
9 | "someComputedProp": function( data ) {
10 | return data.conference & " yep ";
11 | }
12 | }
13 |
14 | function getConference(){
15 | return "test";
16 | }
17 |
18 | }
--------------------------------------------------------------------------------
/test-harness/wires/MountHasRequestContext.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = { "message" : "Default value" };
4 |
5 | function onMount( event, rc, prc ){
6 | var message = event.paramValue( "message", "Mounted value" );
7 | this.setMessage( event.getValue( "message" ) );
8 | }
9 |
10 | function onRender(){
11 | return this.renderView( "wires/mount" );
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/test-harness/wires/PreEmit.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = { "message" : "" };
4 |
5 | function emitEvent(){
6 | this.emit( "SomeEvent" );
7 | }
8 |
9 | function preEmit( eventName, parameters ){
10 | data.message = "Called preEmit for event '#arguments.eventName#'!";
11 | }
12 |
13 | function onRender(){
14 | return this.renderView( "wires/preEmit" );
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/models/services/ConfigService.cfc:
--------------------------------------------------------------------------------
1 | component accessors="true" {
2 |
3 | property name="settings" inject="coldbox:modulesettings:cbwire";
4 |
5 | /**
6 | * Returns true if trimStringValues is enabled, either globally
7 | * or for the component.
8 | *
9 | * @return boolean
10 | */
11 | function trimStringValues() {
12 | return settings.keyExists( "trimStringValues" ) && settings.trimStringValues == true;
13 | }
14 |
15 | }
--------------------------------------------------------------------------------
/test-harness/wires/PostEmit.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = { "message" : "" };
4 |
5 | function emitEvent(){
6 | this.emit( "SomeEvent" );
7 | }
8 |
9 | function postEmit( eventName, parameters ){
10 | data.message = "Called postEmit for event '#arguments.eventName#'!";
11 | }
12 |
13 | function onRender(){
14 | return this.renderView( "wires/postEmit" );
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/test-harness/wires/directiveclick.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | Clicks:
#args.clicks#
4 |
5 |
Click
6 |
Click
7 |
Click
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/test-harness/wires/DirectiveInit.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "messages": []
5 | };
6 |
7 | function loadMessages() {
8 | // Simulate something that takes 400 ms
9 | sleep( 400 );
10 | data.messages = [
11 | {
12 | message: "message1"
13 | },
14 | {
15 | message: "message2"
16 | }
17 | ];
18 | }
19 | }
--------------------------------------------------------------------------------
/test-harness/wires/emitUp.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Emit Up
4 |
5 |
6 | Emit Up Via $emitUp On Button
7 | Emit Up Via Action
8 |
9 | #args.message#
10 | #wire( "EmitUp", { isChild: true } )#
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_call_onupdate.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Should Call OnUpdate
4 |
5 | onUpdateCalled: #onUpdateCalled#
6 |
7 |
8 |
9 |
10 |
11 | // @startWire
12 | data = {
13 | "onUpdateCalled": false
14 | };
15 |
16 | function onUpdate( newValues, oldValues ){
17 | data.onUpdateCalled = true;
18 | }
19 | // @endWire
20 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_support_onBoot_firing_when_the_component_is_initially_rendered.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 | data = {
4 | "hasBooted": false
5 | };
6 |
7 | function onBoot() {
8 | data.hasBooted = true;
9 | }
10 | // @endWire
11 |
12 |
13 |
14 |
15 |
16 | OnBoot Fired
17 |
18 |
19 |
--------------------------------------------------------------------------------
/test-harness/wires/stream.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Stream
4 |
5 |
Start Processing
6 |
7 |
8 |
9 | Finished!
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/test-harness/wires/SlowComponent.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = [
4 | "sleepTime": ""
5 | ];
6 |
7 | function onMount( params ) {
8 | data.sleepTime = params.sleepTime;
9 | sleep( params.sleepTime );
10 | }
11 |
12 | function placeholder() {
13 | return "Loading...
";
14 | }
15 |
16 | function onRender() {
17 | return "Loaded after #data.sleepTime# ms
";
18 | }
19 | }
--------------------------------------------------------------------------------
/test-harness/wires/directiveinit.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Pulling down messages...
5 |
6 |
7 |
8 |
9 | #messageObj.message#
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/test-harness/wires/ComputedProperty.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | // Data properties
4 | data = {
5 | "timestamp" : now(),
6 | "myQuery" : ""
7 | };
8 |
9 | // Computed properties
10 | computed = {
11 | "myTimestamp" : function(){
12 | return data.timestamp;
13 | }
14 | }
15 |
16 | function onRender(){
17 | return this.renderView( "wires/computedProperty" );
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/test-harness/wires/Stream.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "finished": false
5 | };
6 |
7 | function start() {
8 | stream( "response", "Fetching report data...", true );
9 | sleep( 3000 );
10 | stream( "response", "Inspecting for errors...", true );
11 | sleep( 3000 );
12 | stream( "response", "Parsing records...", true );
13 | sleep( 3000 );
14 | data.finished = true;
15 | }
16 | }
--------------------------------------------------------------------------------
/test-harness/wires/test/should_be_able_to_call_getInstance_from_template_and_component.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 | data = {
4 | "result": 0
5 | };
6 |
7 | function onMount() {
8 | data.result = getInstance( "Adder" ).add( 1, 2 );
9 | }
10 | // @endWire
11 |
12 |
13 |
14 |
15 |
OnMount Result: #result#
16 |
Inline Result: #getInstance( "Adder" ).add( 1, 4 )#
17 |
18 |
--------------------------------------------------------------------------------
/test-harness/wires/DataWithStructWire.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
#args.title#
4 |
States
5 |
Number Of States In data.states: #states.len()#
6 |
7 |
8 |
9 | #currentState.abr# : #currentState.name#
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/test-harness/wires/dataWithStructWire.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
#args.title#
4 |
States
5 |
Number Of States In data.states: #states.len()#
6 |
7 |
8 |
9 | #currentState.abr# : #currentState.name#
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/test-harness/handlers/Workshop.cfc:
--------------------------------------------------------------------------------
1 | component {
2 |
3 | function preHandler( event, rc, prc ) {
4 | event.setLayout( "workshop" );
5 | }
6 |
7 | function index() {}
8 |
9 | function counter() {}
10 |
11 | function signupForm() {}
12 |
13 | function taskList() {}
14 |
15 | function nestedDataKeys() {
16 | // Clear any previously run interceptors
17 | lock name="clearEventInterceptorKey" timeout="1" {
18 | application.delete( "cbwire_interceptors_run" );
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/test-harness/wires/TestComponent.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Title: #args.title#
4 |
5 |
Modules
6 |
7 |
Number Of Modules: #modules.len()#
8 |
9 |
10 |
11 |
12 | #module#
13 |
14 |
15 |
16 |
17 | #wire( name="TestChildComponent" )#
18 |
19 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_track_scripts_in_snapshot_memo.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Should track scripts
4 |
5 |
6 |
7 |
8 | // @startWire
9 |
10 | // @endWire
11 |
12 |
13 |
14 |
17 |
18 |
19 |
20 |
23 |
--------------------------------------------------------------------------------
/models/BaseWireTest.cfc:
--------------------------------------------------------------------------------
1 | component extends="coldbox.system.testing.BaseTestCase" {
2 |
3 | /**
4 | * Bootstraps our cbwire component with a suite of test utilities.
5 | *
6 | * @componentName Name of cbwire component.
7 | * @return TestComponentSpec
8 | */
9 | function wire( required componentName, params = {} ){
10 | return getInstance(
11 | name = "TestComponentSpec@cbwire",
12 | initArguments = { componentName : arguments.componentName, parameters : arguments.params }
13 | );
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/test-harness/wires/FireEventFromComponent.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data.message = "";
4 |
5 | listeners = { "someEvent" : "someListener" };
6 |
7 | function someAction(){
8 | this.emit( "someEvent" );
9 | }
10 |
11 | function someListener(){
12 | data.message = "We have fired someListener() using this.emit in our component!";
13 | }
14 |
15 | function onRender(){
16 | return this.renderView( "wires/fireEvent" );
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/test-harness/wires/Loops.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | property name="beatBoxService" inject="BeatBoxService";
4 |
5 | data = {
6 | "genres": [],
7 | "loops": []
8 | };
9 |
10 | function onMount( event, rc, prc ) {
11 | sleep( 3000 ); // slow database
12 | data.genres = beatBoxService.getGenres();
13 | data.loops = beatBoxService.getLoops();
14 | }
15 |
16 | function placeholder() {
17 | return "Loading...";
18 | }
19 | }
--------------------------------------------------------------------------------
/test-harness/wires/test/should_not_throw_exception_on_locked_data_property_empty_array.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Should Not Throw Exception
4 |
When a locked property is an empty array the wire should ignore continue.
5 |
Locked Property Value: #lockedPropertyKey#
6 |
7 |
8 |
9 |
10 | // @startWire
11 | data = {
12 | "lockedPropertyKey": "I AM NOT LOCKED!"
13 | };
14 |
15 | locked = [];
16 |
17 | // @endWire
18 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_not_throw_exception_on_locked_data_property_empty_string.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Should Not Throw Exception
4 |
When a locked property is an empty string the wire should ignore continue.
5 |
Locked Property Value: #lockedPropertyKey#
6 |
7 |
8 |
9 |
10 | // @startWire
11 | data = {
12 | "lockedPropertyKey": "I AM NOT LOCKED!"
13 | };
14 |
15 | locked = "";
16 |
17 | // @endWire
18 |
--------------------------------------------------------------------------------
/includes/js/livewire/js/directives/index.js:
--------------------------------------------------------------------------------
1 |
2 | import './wire-transition';
3 | import './wire-wildcard';
4 | import './wire-navigate';
5 | import './wire-confirm';
6 | import './wire-current';
7 | import './wire-offline';
8 | import './wire-loading';
9 | import './wire-stream';
10 | import './wire-replace';
11 | import './wire-ignore';
12 | import './wire-cloak';
13 | import './wire-dirty';
14 | import './wire-model';
15 | import './wire-init';
16 | import './wire-poll';
17 | import './wire-show';
18 | import './wire-text';
19 |
--------------------------------------------------------------------------------
/test-harness/wires/test/security/onrender_custom_block_message_from_wire.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | secureMountFailMessage = "BLOCK MESSSAGE FROM COMPONENT VARIABLE
";
4 |
5 | data = {};
6 |
7 | function onSecure( event, prc, isInitial, params ) {
8 | // Return true to allow rendering, false to block rendering
9 |
10 | // get the value from the event to determine if rendering is allowed
11 | return event.getValue( "allowTestWireRender", false, true );
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_throw_exception_on_locked_data_property_array.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Should Throw Exception on Locked Property
4 |
When a property is locked with an array, it should throw an exception when trying to set any of the keys in the array.
5 |
6 |
7 |
8 |
9 | // @startWire
10 | data = {
11 | "lockedPropertyKey": "I AM LOCKED!"
12 | };
13 |
14 | locked = ["lockedPropertyKey"];
15 |
16 | // @endWire
17 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_throw_exception_on_locked_data_property_string.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Should Throw Exception on Locked Property
4 |
When a property is locked with an string (single value), it should throw an exception when trying to set the provided key.
5 |
6 |
7 |
8 |
9 | // @startWire
10 | data = {
11 | "lockedPropertyKey": "I AM LOCKED!"
12 | };
13 |
14 | locked = "lockedPropertyKey";
15 |
16 | // @endWire
17 |
--------------------------------------------------------------------------------
/test-harness/server-lucee@5.json:
--------------------------------------------------------------------------------
1 | {
2 | "name":"cbwire-lucee@5",
3 | "app":{
4 | "serverHomeDirectory":".engine/lucee5",
5 | "cfengine":"lucee@5"
6 | },
7 | "web":{
8 | "caseSensitivePaths":false,
9 | "http":{
10 | "port":"60299"
11 | },
12 | "rewrites":{
13 | "enable":"true"
14 | },
15 | "aliases":{
16 | "/modules/cbwire":"../",
17 | "/moduleroot/cbwire":"../"
18 | }
19 | },
20 | "openBrowser":"false"
21 | }
--------------------------------------------------------------------------------
/test-harness/wires/FireEvent2.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 |
4 | data = {
5 | "message": "test"
6 | };
7 |
8 | listeners = { "someEvent" : "someListener" };
9 |
10 | function someAction(){
11 | this.emit( "someEvent" );
12 | }
13 |
14 | function someListener(){
15 | data.message = "We have fired someListener() from a second listener!";
16 | }
17 |
18 | function onRender(){
19 | return this.renderView( "wires/fireEvent" );
20 | }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/test-harness/wires/FireEvent.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = { "message" : "test" };
4 |
5 | listeners = { "someOtherEvent" : "someListener" };
6 |
7 | function someListener(){
8 | data.message = "We have fired someListener() from a listener!";
9 | }
10 |
11 | function someAction(){
12 | this.emit( "someOtherEvent", [ "grant", "allen", "copley" ] );
13 | }
14 |
15 | function onRender(){
16 | return this.renderView( "wires/fireEvent" );
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/test-harness/views/beatbox/upload.cfm:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
--------------------------------------------------------------------------------
/test-harness/wires/Actions.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "conference": "Into The Box"
5 | };
6 |
7 | // Actions
8 | function changeConference() {
9 | data.conference = "CF Summit";
10 | }
11 |
12 | function addYear( currentYear ) {
13 | data.conference &= " " & currentYear;
14 | }
15 |
16 | function resetConference() {
17 | reset( "conference" );
18 | }
19 |
20 | function onRender(){
21 | return template( "wires.actions" );
22 | }
23 | }
--------------------------------------------------------------------------------
/test-harness/wires/superheroes.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Super Heroes
4 |
5 |
Number Of Heroes: #heroes.len()#
6 |
7 |
8 |
9 |
10 | #hero#
11 |
12 |
13 |
14 |
15 |
16 | #wire( "SuperHeroStats", {}, "super-hero" )#
17 | #wire( "SuperHeroStats" )#
18 |
19 |
20 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_have_generated_setters_and_getters_available_in_onmount.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 | data = {
4 | "name": "John Doe",
5 | "copiedName": "",
6 | "age": 30,
7 | "city": "New York"
8 | };
9 |
10 | function onMount() {
11 | setCopiedName( getName() );
12 | setName( "Jane Doe" );
13 | }
14 | // @endWire
15 |
16 |
17 |
18 |
19 |
Name: #name#
20 |
Copied name: #copiedName#
21 |
22 |
--------------------------------------------------------------------------------
/test-harness/wires/OnUploadError.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "uploadErrored": false,
5 | "erroredPropertyName": "",
6 | "errorInfo": "",
7 | "isMultiple": false
8 | };
9 |
10 | function onUploadError( property, errors, multiple ) {
11 | data.uploadErrored = true;
12 | data.erroredPropertyName = arguments.property;
13 | data.errorInfo = isNull( arguments.errors ) ? "null" : "has errors";
14 | data.isMultiple = arguments.multiple;
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/test-harness/wires/actions.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
#conference#
5 |
6 |
11 |
12 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_not_throw_exception_on_locked_data_property_other.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Should Not Throw Exception
4 |
When a locked property is a data type other than an array, string/list the wire should ignore continue.
5 |
Locked Property Value: #lockedPropertyKey#
6 |
7 |
8 |
9 |
10 | // @startWire
11 | data = {
12 | "lockedPropertyKey": "I AM NOT LOCKED!"
13 | };
14 |
15 | locked = { "lockedPropertyKey" : "someValue" };
16 |
17 | // @endWire
18 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 | *.sln merge=union
7 | *.csproj merge=union
8 | *.vbproj merge=union
9 | *.fsproj merge=union
10 | *.dbproj merge=union
11 |
12 | # Standard to msysgit
13 | *.doc diff=astextplain
14 | *.DOC diff=astextplain
15 | *.docx diff=astextplain
16 | *.DOCX diff=astextplain
17 | *.dot diff=astextplain
18 | *.DOT diff=astextplain
19 | *.pdf diff=astextplain
20 | *.PDF diff=astextplain
21 | *.rtf diff=astextplain
22 | *.RTF diff=astextplain
23 |
--------------------------------------------------------------------------------
/includes/js/livewire/js/features/supportDispatches.js:
--------------------------------------------------------------------------------
1 | import { dispatch, dispatchSelf, dispatchTo } from '@/events'
2 | import { on } from '@/hooks'
3 |
4 | on('effect', ({ component, effects }) => {
5 | dispatchEvents(component, effects.dispatches || [])
6 | })
7 |
8 | function dispatchEvents(component, dispatches) {
9 | dispatches.forEach(({ name, params = {}, self = false, to }) => {
10 | if (self) dispatchSelf(component, name, params)
11 | else if (to) dispatchTo(to, name, params)
12 | else dispatch(component, name, params)
13 | })
14 | }
15 |
16 |
17 |
--------------------------------------------------------------------------------
/test-harness/modules_external/ExternalModule/config/Scheduler.cfc:
--------------------------------------------------------------------------------
1 | /**
2 | * Module Task Scheduler
3 | * https://coldbox.ortusbooks.com/digging-deeper/scheduled-tasks
4 | */
5 | component {
6 |
7 | function configure(){
8 |
9 | /* task( "photoNumbers" )
10 | .call( () => {
11 | var random = getInstance( "PhotoService" ).getRandom();
12 | writeDump( var="xxxxxxx> Photo numbers: #random#", output="console" );
13 | return random;
14 | } )
15 | .every( 15, "seconds" )
16 | .delay( 60, "seconds" )
17 | .onEnvironment( "development" ); */
18 |
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/test-harness/views/beatbox/loops.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Browse Loops
4 | #wire( name="Loops", lazy=true )#
5 |
6 | #wire( name="Loops", lazy=true )#
7 |
8 | #wire( name="Loops", lazy=true )#
9 |
10 |
11 |
18 |
19 |
--------------------------------------------------------------------------------
/test-harness/wires/CounterComplete.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 | data = {
3 | "counter": 0
4 | };
5 |
6 | function increment() {
7 | data.counter++;
8 | }
9 |
10 | function decrement() {
11 | data.counter--;
12 | }
13 |
14 | function isEven() {
15 | return data.counter % 2 == 0;
16 | }
17 |
18 | function incrementBy( amount ) {
19 | data.counter += amount;
20 | }
21 |
22 | function onRender() {
23 | return template( "wires.CounterComplete", { isEven: isEven() } );
24 | }
25 | }
--------------------------------------------------------------------------------
/test-harness/tests/templates/dataproperty.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | name: #name#
4 | email: #email#
5 | hydrated: #hydrated#
6 | listener: #listener#
7 | updated: #updated#
8 | onDIComplete: #onDIComplete#
9 | getInstance: #calledGetInstance#
10 | validateOrFail: #validateOrFail#
11 | validate: #validate#
12 | toggled: #toggled#
13 | sum: #sum#
14 | someStruct: #someStruct.someKey#
15 | someArray: #someArray[1].someKey#
16 |
17 |
--------------------------------------------------------------------------------
/test-harness/server-lucee@6.json:
--------------------------------------------------------------------------------
1 | {
2 | "name":"cbwire-lucee@6",
3 | "app":{
4 | "serverHomeDirectory":".engine/lucee6",
5 | "cfengine":"lucee@6"
6 | },
7 | "web":{
8 | "caseSensitivePaths":false,
9 | "http":{
10 | "port":"60299"
11 | },
12 | "rewrites":{
13 | "enable":"true"
14 | },
15 | "aliases":{
16 | "/modules/cbwire":"../",
17 | "/moduleroot/cbwire":"../"
18 | }
19 | },
20 | "openBrowser":"false",
21 | "jvm":{
22 | "javaVersion":"openjdk21"
23 | }
24 | }
--------------------------------------------------------------------------------
/test-harness/wires/ResetPropertiesToInitialState.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = { "name" : "test" };
4 |
5 | /**
6 | * Render our wire object.
7 | */
8 | function onRender(){
9 | return this.renderView( "wires/resetPropertiesToInitialState" );
10 | }
11 |
12 | /**
13 | * Changes our name
14 | */
15 | function changeName(){
16 | this.setName( "Blah #now()#" );
17 | }
18 |
19 | /**
20 | * Reset our name property
21 | */
22 | function resetName(){
23 | reset( "name" );
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_track_assets_in_snapshot_memo.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Should track assets in snapshot memo
4 |
5 |
6 |
7 |
8 | // @startWire
9 | function placeholder() {
10 | return "This is a placeholder
";
11 | }
12 | // @endWire
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/includes/js/livewire/js/features/supportMorphDom.js:
--------------------------------------------------------------------------------
1 | import { morph } from '@/morph'
2 | import { on } from '@/hooks'
3 |
4 | on('effect', ({ component, effects }) => {
5 | let html = effects.html
6 | if (! html) return
7 |
8 | // Wrapping this in a double queueMicrotask. The first one puts it after all
9 | // other "effect" hooks, and the second one puts it after all reactive
10 | // Alpine effects (that are processed via flushJobs in scheduler).
11 | queueMicrotask(() => {
12 | queueMicrotask(() => {
13 | morph(component, component.el, html)
14 | })
15 | })
16 | })
17 |
--------------------------------------------------------------------------------
/test-harness/wires/radioinput.cfm:
--------------------------------------------------------------------------------
1 |
2 |
16 |
--------------------------------------------------------------------------------
/test-harness/wires/databindinglive.cfm:
--------------------------------------------------------------------------------
1 |
2 |
14 |
--------------------------------------------------------------------------------
/test-harness/wires/validation.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WELL DANG
5 |
6 |
7 |
Submit
8 | #args.validation.hasErrors()#
9 |
10 |
11 |
12 | #error.getMessage()#
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/test-harness/server-adobe@2023.json:
--------------------------------------------------------------------------------
1 | {
2 | "name":"cbwire-adobe@2023",
3 | "app":{
4 | "serverHomeDirectory":".engine/adobe2023",
5 | "cfengine":"adobe@2023"
6 | },
7 | "web":{
8 | "caseSensitivePaths":false,
9 | "http":{
10 | "port":"60299"
11 | },
12 | "rewrites":{
13 | "enable":"true"
14 | },
15 | "aliases":{
16 | "/modules/cbwire":"../",
17 | "/moduleroot/cbwire":"../"
18 | }
19 | },
20 | "openBrowser":"false",
21 | "scripts":{
22 | "onServerInstall":"cfpm install zip"
23 | }
24 | }
--------------------------------------------------------------------------------
/test-harness/wires/test/should_support_hasErrors_hasError_getError_for_validation.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 | data = {
4 | "name": ""
5 | };
6 |
7 | constraints = {
8 | "name": { required: true, requiredMessage: "The 'name' field is required" }
9 | };
10 | // @endWire
11 |
12 |
13 |
14 |
15 |
Has errors: #hasErrors() ? "true" : "false"#
16 |
Has error: #hasError( "name" ) ? "true" : "false"#
17 |
Get errors length: #getErrors().len()#
18 |
Error: #getError( "name" )#
19 |
20 |
--------------------------------------------------------------------------------
/test-harness/wires/wiremodel.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 |
12 |
13 | Hello, #username#!
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/test-harness/wires/directiveloading.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Start five-second process
6 | Processing
7 |
8 |
9 |
10 | Start five-second process
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .artifacts/**
2 | .tmp/**
3 |
4 | docbox/**
5 | /dist/**
6 |
7 | modules/**
8 |
9 | .engine/**
10 | test-harness/.engine/**
11 | test-harness/coldbox/**
12 | test-harness/docbox/**
13 | test-harness/testbox/**
14 | test-harness/tests/results/**
15 | test-harness/logs/**
16 | test-harness/modules/**
17 | views/tmp/**
18 |
19 | # log files
20 | logs/**
21 |
22 | # node modules
23 | node_modules/**
24 |
25 | /livewire/**
26 |
27 | models/tmp/**
28 |
29 | # Test generated files
30 | test-harness/tests/resources/fileupload_metadata.json
31 | test-harness/tests/resources/logo_*.png
32 |
33 | .DS_Store
34 | .claude/settings.local.json
35 |
--------------------------------------------------------------------------------
/test-harness/wires/formvalidation.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
Add Email
5 |
6 |
7 | Success!
8 |
9 | no success
10 |
11 |
12 |
13 |
14 |
15 | #error#
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/models/IncomingRequest.cfc:
--------------------------------------------------------------------------------
1 | component accessors="true" singleton {
2 |
3 | /*
4 | * Inject the component loader to get the component instance.
5 | */
6 | property name="componentLoader" inject="ComponentLoader@cbwire";
7 |
8 | /**
9 | * Primary entry point for cbwire requests.
10 | *
11 | * Currently uses /livewire URI to support Livewire JS.
12 | *
13 | * URI: /livewire/messages/:wireComponent
14 | */
15 | function handle( event, rc, prc ){
16 | return componentLoader.load( rc.wireComponent )
17 | .startup( initialRender = false )
18 | .hydrate()
19 | .subsequentRenderIt( event=event, rc=rc, prc=prc );
20 | }
21 | }
--------------------------------------------------------------------------------
/includes/js/livewire/js/features/supportIsolating.js:
--------------------------------------------------------------------------------
1 | import { on } from '@/hooks'
2 |
3 | let componentsThatAreIsolated = new WeakSet
4 |
5 | on('component.init', ({ component }) => {
6 | let memo = component.snapshot.memo
7 |
8 | // We only care about isolated components...
9 | if (memo.isolate !== true) return
10 |
11 | componentsThatAreIsolated.add(component)
12 | })
13 |
14 | on('commit.pooling', ({ commits }) => {
15 | commits.forEach(commit => {
16 | // We only care about isolated components...
17 | if (! componentsThatAreIsolated.has(commit.component)) return
18 |
19 | commit.isolate = true
20 | })
21 | })
22 |
--------------------------------------------------------------------------------
/models/IncomingFileUpload.cfc:
--------------------------------------------------------------------------------
1 | component singleton {
2 |
3 | /*
4 | Uploads all files from the request to the specified destination.
5 | Each file is saved to a unique file name.
6 | Returns a list of the paths to the saved files.
7 |
8 | @return void
9 | */
10 | function handle( required event, required rc, required prc ){
11 | var results = fileUploadAll( destination = expandPath( "/" ), nameConflict = "makeUnique" );
12 | var paths = results.map( function( result ){
13 | var id = createUUID();
14 | fileWrite( expandPath( "/#id#.json" ), serializeJSON( result ) );
15 | return id;
16 | } );
17 | return { "paths" : paths };
18 | }
19 | }
--------------------------------------------------------------------------------
/test-harness/wires/test/should_throw_exception_on_locked_data_property_list.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Should Throw Exception on Locked Property
4 |
When a property is locked with an list, it should throw an exception when trying to set any of the keys in the list.
5 |
6 |
7 |
8 |
9 | // @startWire
10 | data = {
11 | "lockedPropertyKey": "I AM LOCKED!",
12 | "lockedPropertyKeyTwo": "I AM ALSO LOCKED!",
13 | "lockedPropertyKeyThree": "I AM LOCKED AS WELL!"
14 | };
15 |
16 | locked = "lockedPropertyKeyThree,lockedPropertyKey";
17 |
18 | // @endWire
19 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | # CBWIRE
2 |
3 | [](https://github.com/coldbox-modules/cbwire/actions/workflows/ci.yml)
4 |
5 | Become a web development hero with CBWIRE! CBWIRE is a ColdBox module that helps you build modern, reactive, single-page CFML applications in record time - without using much JavaScript or building backend APIs.
6 |
7 |
8 |
9 |
10 |
11 | ## Get Started
12 |
13 | Get up and running in seconds with CBWIRE. https://cbwire.ortusbooks.com/
14 |
--------------------------------------------------------------------------------
/test-harness/wires/selectinput.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Batman
6 | Superman
7 |
8 |
9 |
10 | Bruce Wayne!
11 |
12 | Clark Kent!
13 |
14 | Select a hero please.
15 |
16 |
17 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_call_onhydrate.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 | data = {
4 | "hydrated": false,
5 | "hydratedProperty": false
6 | };
7 |
8 | function clicked() {}
9 |
10 | function onHydrate() {
11 | data.hydrated = true;
12 | }
13 |
14 | function onHydrateHydrated(){
15 | data.hydratedProperty = true;
16 | }
17 | // @endWire
18 |
19 |
20 |
21 |
22 |
Hydrated: #hydrated#
23 |
Hydrated Property: #hydratedProperty#
24 |
Click me
25 |
26 |
27 |
--------------------------------------------------------------------------------
/test-harness/wires/TaskList.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Task List
4 |
5 |
9 |
10 |
11 |
12 |
13 | No tasks found.
14 |
15 |
16 |
17 | dsdafasdf
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/test-harness/wires/multiselectinput.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Batman
6 | Superman
7 | Iron Man
8 |
9 |
10 |
11 |
12 | You selected #arrayToList( args.heroes )# .
13 |
14 | Select a hero please.
15 |
16 |
17 |
--------------------------------------------------------------------------------
/test-harness/server-adobe@2025.json:
--------------------------------------------------------------------------------
1 | {
2 | "name":"cbwire-adobe@2025",
3 | "app":{
4 | "serverHomeDirectory":".engine/adobe2025",
5 | "cfengine":"adobe@2025"
6 | },
7 | "web":{
8 | "caseSensitivePaths":false,
9 | "http":{
10 | "port":"60299"
11 | },
12 | "rewrites":{
13 | "enable":"true"
14 | },
15 | "aliases":{
16 | "/modules/cbwire":"../",
17 | "/moduleroot/cbwire":"../"
18 | }
19 | },
20 | "JVM":{
21 | "javaVersion":"openjdk21"
22 | },
23 | "openBrowser":"false",
24 | "scripts":{
25 | "onServerInstall":"cfpm install zip"
26 | }
27 | }
--------------------------------------------------------------------------------
/test-harness/wires/dataWithStructWire.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = [
4 | "title": "CBWIRE Rocks!",
5 | "states": []
6 | ];
7 |
8 | function addState( abr, name ){
9 | data.states.append( { "name" : name, "abr" : abr } );
10 | }
11 |
12 | function onMount( params, event, rc, prc ) {
13 | // Initialize some states
14 | data.states.append( { "name" : "Maryland", "abr" : "MD" } );
15 | data.states.append( { "name" : "Virginia", "abr" : "VA" } );
16 | data.states.append( { "name" : "Florida", "abr" : "FL" } );
17 | data.states.append( { "name" : "Wyoming", "abr" : "WY" } );
18 | }
19 |
20 | }
--------------------------------------------------------------------------------
/test-harness/wires/test/should_call_onupdate_property.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Should call onupdate property
4 |
CBWIRE Version: #cbwireVersion#
5 |
New Value: #newValue#
6 |
Old Value: #oldValue#
7 |
8 |
9 |
10 |
11 | // @startWire
12 | data = {
13 | "cbwireVersion": 3,
14 | "newValue": "",
15 | "oldValue": ""
16 | };
17 |
18 | function onUpdateCBWIREVersion( value, oldValue ) {
19 | data.cbwireVersion = arguments.value;
20 | data.newValue = arguments.value;
21 | data.oldValue = arguments.oldValue;
22 | }
23 | // @endWire
24 |
--------------------------------------------------------------------------------
/test-harness/wires/OnUpdate.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "onUpdateMessage": false,
5 | "onUpdate": false,
6 | "message": ""
7 | };
8 |
9 | function onUpdate() {
10 | data.onUpdate = true;
11 | }
12 |
13 | function onUpdateMessage(){
14 | data.onUpdateMessage = true;
15 | }
16 |
17 | function onRender() {
18 | return "
19 |
20 |
onUpdate() called: #data.onUpdate#
21 |
onUpdateMessage() called: #data.onUpdateMessage#
22 |
23 |
24 | ";
25 | }
26 | }
--------------------------------------------------------------------------------
/test-harness/wires/test/security/cbSecurity_secured_annotation.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" secured {
2 |
3 | data = {
4 | "keyOne" : "valueOne",
5 | "keyTwo" : "valueTwo",
6 | "keyThree" : "valueThree",
7 | "keyFour" : "valueFour"
8 | };
9 |
10 | function updateDataKeyOne() secured="read" {
11 | data.keyOne = "updatedValueOne";
12 | }
13 |
14 | function updateDataKeyTwo() secured="write" {
15 | data.keyTwo = "updatedValueTwo";
16 | }
17 |
18 | function updateDataKeyThree() secured="read, write" {
19 | data.keyThree = "updatedValueThree";
20 | }
21 |
22 | function updateDataKeyFour() secured="noSuchPermission" {
23 | data.keyFour = "updatedValueFour";
24 | }
25 |
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/test-harness/wires/InlineWire.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 | data = {
4 | "counter": 0
5 | };
6 |
7 | function isEven() computed {
8 | return data.counter % 2 == 0 ? true : false;
9 | }
10 |
11 | function increment() {
12 | data.counter += 1;
13 | }
14 | // @endWire
15 |
16 |
17 |
18 |
19 | InlineWire
20 |
21 | Counter: #counter#
22 |
23 |
24 | Is even: #isEven()#
25 |
26 |
27 | Increment
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/includes/js/livewire/js/features/index.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * Features where order matters:
4 | */
5 | import './supportListeners';
6 | import './supportScriptsAndAssets';
7 | import './supportJsEvaluation';
8 | import './supportMorphDom';
9 | import './supportDispatches';
10 |
11 | /**
12 | * Features where order does NOT matter:
13 | */
14 | import './supportDisablingFormsDuringRequest';
15 | import './supportPropsAndModelables';
16 | import './supportFileDownloads';
17 | import './supportLazyLoading';
18 | import './supportFileUploads';
19 | import './supportQueryString';
20 | import './supportLaravelEcho';
21 | import './supportIsolating';
22 | import './supportRedirects';
23 | import './supportNavigate';
24 | import './supportEntangle';
25 |
--------------------------------------------------------------------------------
/models/IncomingFilePreview.cfc:
--------------------------------------------------------------------------------
1 | component singleton {
2 |
3 | /*
4 | Builds a binary preview for an uploaded file.
5 | @return void
6 | */
7 | function handle( required event, required rc, required prc ){
8 | var uuid = event.getValue( "uploadUUID", "" );
9 | if ( !len( uuid ) ) {
10 | return event.noRender();
11 | }
12 |
13 | var metaJSON = deserializeJSON( fileRead( expandPath( "./#uuid#.json" ) ) );
14 | var contents = fileReadBinary( expandPath( "./#metaJSON.serverFile#" ) );
15 | event
16 | .sendFile(
17 | file = contents,
18 | disposition = "inline",
19 | extension = metaJSON.serverFileExt,
20 | mimeType = "#metaJSON.contentType#/#metaJSON.contentSubType#"
21 | )
22 | .noRender();
23 | }
24 | }
--------------------------------------------------------------------------------
/test-harness/config/Router.cfc:
--------------------------------------------------------------------------------
1 | component {
2 |
3 | function configure(){
4 | // Your Application Routes
5 | route( pattern="/examples/index", target="examples.index" );
6 | route( pattern="/examples/wireStyles", target="examples.wireStyles" );
7 | route( pattern="/examples/wireScripts", target="examples.wireScripts" );
8 | route( pattern="/examples/passParameters", target="examples.passParameters" );
9 | route( pattern="/examples/passedParametersProvidedToMount", target="examples.passedParametersProvidedToMount" );
10 | route( pattern="/workshop/Counter", target="workshop.counter" );
11 | route( pattern="/workshop/AlpineUpload", target="workshop.alpineUpload" );
12 | route( ":handler/:action?" ).end();
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/test-harness/wires/chatgpt.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Chat
4 |
5 |
Next Joke
8 |
9 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/includes/js/livewire/js/directives/wire-show.js:
--------------------------------------------------------------------------------
1 | import Alpine from 'alpinejs'
2 |
3 | Alpine.interceptInit(el => {
4 | for (let i = 0; i < el.attributes.length; i++) {
5 | if (el.attributes[i].name.startsWith('wire:show')) {
6 | let { name, value } = el.attributes[i]
7 |
8 | let modifierString = name.split('wire:show')[1]
9 |
10 | let expression = value.startsWith('!')
11 | ? '!$wire.' + value.slice(1).trim()
12 | : '$wire.' + value.trim()
13 |
14 | Alpine.bind(el, {
15 | ['x-show' + modifierString]() {
16 | return Alpine.evaluate(el, expression)
17 | }
18 | })
19 | }
20 | }
21 | })
--------------------------------------------------------------------------------
/includes/js/livewire/js/directives/wire-text.js:
--------------------------------------------------------------------------------
1 | import Alpine from 'alpinejs'
2 |
3 | Alpine.interceptInit(el => {
4 | for (let i = 0; i < el.attributes.length; i++) {
5 | if (el.attributes[i].name.startsWith('wire:text')) {
6 | let { name, value } = el.attributes[i]
7 |
8 | let modifierString = name.split('wire:text')[1]
9 |
10 | let expression = value.startsWith('!')
11 | ? '!$wire.' + value.slice(1).trim()
12 | : '$wire.' + value.trim()
13 |
14 | Alpine.bind(el, {
15 | ['x-text' + modifierString]() {
16 | return Alpine.evaluate(el, expression)
17 | }
18 | })
19 | }
20 | }
21 | })
22 |
--------------------------------------------------------------------------------
/test-harness/models/TaskService.cfc:
--------------------------------------------------------------------------------
1 | component singleton {
2 |
3 | function init() {
4 | variables.tasks = [];
5 | // You can initialize any data or perform setup here
6 | }
7 |
8 | function addTask( task ) {
9 | variables.tasks.append( arguments.task );
10 | // This function adds a new task to the tasks array
11 | }
12 |
13 | function deleteTask( task ) {
14 | variables.tasks.delete( arguments.task );
15 | // This function removes a task from the tasks array
16 | }
17 |
18 | function getTasks() {
19 | // Simulates a delay, like fetching data from a database
20 | sleep( 3000 );
21 | // Returns the current list of tasks
22 | return variables.tasks;
23 | }
24 |
25 | }
--------------------------------------------------------------------------------
/test-harness/wires/TaskListComplete.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Task List
4 |
5 |
9 |
10 |
11 |
12 |
13 | No tasks found.
14 |
15 |
16 |
17 | #wire( name="TaskItem", params={ task: task }, key=hash(task) )#
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/test-harness/views/beatbox/index.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
The Worlds Best Beats and Loops!
4 |
BeatBox is the world's number one website for finding beats for your next music project. Whether you're a singer, rapper, or producer, BeatBox offers a vast collection of high-quality beats in various genres to suit your creative needs. With our user-friendly interface and advanced search features, discovering the perfect beat has never been easier. Join our vibrant community of musicians and take your music to the next level with BeatBox!
5 |
8 | #wire( name="Counter" )#
9 | #wire( name="Counter2" )#
10 |
11 |
12 |
--------------------------------------------------------------------------------
/test-harness/wires/TaskListComplete.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | property name="TaskService" inject="TaskService";
4 |
5 | data = {
6 | "newTask": ""
7 | };
8 |
9 | listeners = {
10 | "deleteTask": "deleteTask"
11 | };
12 |
13 | function placeholder() {
14 | return "Loading task list...
";
15 | }
16 |
17 | function tasks() {
18 | return taskService.getTasks();
19 | }
20 |
21 | function addTask() {
22 | taskService.addTask( data.newTask );
23 | reset( "newTask" );
24 | }
25 |
26 | function deleteTask( task ){
27 | taskService.deleteTask( arguments.task );
28 | }
29 |
30 | function onRender() {
31 | return template( "wires.TaskListComplete" );
32 | }
33 |
34 | }
--------------------------------------------------------------------------------
/test-harness/wires/testing/complexhtml.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | Complex HTML
4 | Here is some complex HTML that is being output from a ColdFusion template.
5 | This is a link
6 |
21 |
22 |
--------------------------------------------------------------------------------
/includes/js/livewire/js/directives/wire-offline.js:
--------------------------------------------------------------------------------
1 | import { toggleBooleanStateDirective } from './shared'
2 | import { directive } from '@/directives'
3 |
4 | let offlineHandlers = new Set
5 | let onlineHandlers = new Set
6 |
7 | window.addEventListener('offline', () => offlineHandlers.forEach(i => i()))
8 | window.addEventListener('online', () => onlineHandlers.forEach(i => i()))
9 |
10 | directive('offline', ({ el, directive, cleanup }) => {
11 | let setOffline = () => toggleBooleanStateDirective(el, directive, true)
12 | let setOnline = () => toggleBooleanStateDirective(el, directive, false)
13 |
14 | offlineHandlers.add(setOffline)
15 | onlineHandlers.add(setOnline)
16 |
17 | cleanup(() => {
18 | offlineHandlers.delete(setOffline)
19 | onlineHandlers.delete(setOnline)
20 | })
21 | })
22 |
--------------------------------------------------------------------------------
/test-harness/tests/templates/withoutOnMountEvent.cfm:
--------------------------------------------------------------------------------
1 |
2 | data = {
3 | "preDefinedString" : "Pre Defined String Value",
4 | "preDefinedNumber" : 1234
5 | };
6 |
7 |
8 |
9 |
10 |
Test Wire Component Without OnMount() Event
11 |
12 | Output from variables.data
13 |
14 | variables.data.#key# = #serializeJSON( variables.data[key] )#
15 |
16 |
17 |
18 | Output from variables
19 |
20 | variables.#key# = #serializeJSON( variables[key] )#
21 |
22 |
23 |
24 | COMPLETED-PROCESSING
25 |
26 |
--------------------------------------------------------------------------------
/test-harness/wires/directivemodel.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Message: #args.message#
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | With one second debounce:
14 |
15 |
16 |
17 |
18 |
19 | With lazy attribute, waits for onBlur:
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/test-harness/wires/showCode.cfm:
--------------------------------------------------------------------------------
1 |
2 | componentPath = expandPath( './wires/#lCase( data.component )#.cfc');
3 | templatePath = expandPath( './wires/#lCase( data.component )#.cfm');
4 | //viewCode = '##wire( "#wire#" )## ';
5 | viewCode = fileRead( templatePath );
6 | componentCode = fileExists( componentPath ) ? fileRead( componentPath ) : "";
7 | //componentCode = "" & chr( 10 ) & componentCode;
8 |
9 |
10 |
11 |
12 |
// File: ./wires/Test.cfc#chr( 10 )##htmlEditFormat( componentCode )#
13 |
<!-- File: ./wires/test.cfm -->#chr(10)##htmlEditFormat( viewCode )#
14 |
15 |
--------------------------------------------------------------------------------
/test-harness/wires/ParentChildComponent.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Parent
4 |
Rendered at #now()#
5 |
#name#
6 |
toggle = #toggle#
7 |
reload
8 |
$refresh
9 |
toggle
10 |
change name
11 |
12 |
13 | #wire( "ChildComponent", {}, "some_id" )#
14 |
15 | #wire( "DataBinding" )#
16 |
17 |
18 | Counter goes here
19 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/test-harness/wires/SignupFormComplete.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "name": "",
5 | "email": "",
6 | "zip": "",
7 | "submitted": false
8 | };
9 |
10 | // constraints = {
11 | // "name": { "required": true },
12 | // "zip": { "required": true, "regex": "^[0-9]{5}" },
13 | // "email": { "required": true, "type": "email", typeMessage: "Your email is whack!" },
14 | // };
15 |
16 | function submitForm() {
17 | sleep( 1000 );
18 | reset();
19 | //data.submitted = true;
20 | js( '
21 | Swal.fire({
22 | title: "Good job!",
23 | text: "You clicked the button!",
24 | icon: "success"
25 | });
26 | ' );
27 |
28 | return "yay!";
29 | }
30 | }
--------------------------------------------------------------------------------
/test-harness/wires/entangle.cfm:
--------------------------------------------------------------------------------
1 |
2 |
6 |
CBWIRE value: #counter#
7 |
AlpineJS value:
8 |
Increment with CBWIRE
9 |
Increment with AlpineJS
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | CBWIRE value: #name#
19 |
20 |
21 |
--------------------------------------------------------------------------------
/includes/js/livewire/js/directives/wire-navigate.js:
--------------------------------------------------------------------------------
1 | import Alpine from 'alpinejs'
2 |
3 | Alpine.addInitSelector(() => `[wire\\:navigate]`)
4 | Alpine.addInitSelector(() => `[wire\\:navigate\\.hover]`)
5 |
6 | Alpine.interceptInit(
7 | Alpine.skipDuringClone(el => {
8 | if (el.hasAttribute('wire:navigate')) {
9 | Alpine.bind(el, { ['x-navigate']: true })
10 | } else if (el.hasAttribute('wire:navigate.hover')) {
11 | Alpine.bind(el, { ['x-navigate.hover']: true })
12 | }
13 | })
14 | )
15 |
16 | document.addEventListener('alpine:navigating', () => {
17 | // Before navigating away, we'll inscribe the latest state of each component
18 | // in their HTML so that upon return, they will have the latest state...
19 | Livewire.all().forEach(component => {
20 | component.inscribeSnapshotAndEffectsOnElement()
21 | })
22 | })
23 |
--------------------------------------------------------------------------------
/test-harness/wires/EmitUp.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "isChild" : false,
5 | "message" : ""
6 | };
7 |
8 | function $getListeners(){
9 | if ( data.isChild ){
10 | return {};
11 | }
12 | return {
13 | "postAdded" : "postAddedListener",
14 | "emitUpFired" : "emitViaActionCall"
15 | };
16 | }
17 |
18 | function emitViaActionCall(){
19 | data.message = "emitUpFired() fired!";
20 | }
21 |
22 | function emitViaAction(){
23 | this.emitUp( "emitUpFired" );
24 | }
25 |
26 | function postAddedListener(){
27 | data.message = "postAddedListener() fired!";
28 | this.emitUp( "emitUpFired" );
29 | }
30 |
31 | function onRender(){
32 | return this.renderView( "wires/emitUp" );
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/test-harness/wires/directivekeydown.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Last typing: #dateTimeFormat( args.lastTyping, "full" )#
5 |
6 |
7 |
8 | I'll update the time as you type ANY KEY.
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | I'll update the time only when you hit ENTER.
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_call_onuploaderror.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 | data = {
4 | "uploadErrored": false,
5 | "erroredPropertyName": "",
6 | "errorInfo": "",
7 | "isMultiple": false
8 | };
9 |
10 | function onUploadError( property, errors, multiple ) {
11 | data.uploadErrored = true;
12 | data.erroredPropertyName = arguments.property;
13 | data.errorInfo = isNull( arguments.errors ) ? "null" : "has errors";
14 | data.isMultiple = arguments.multiple;
15 | }
16 | // @endWire
17 |
18 |
19 |
20 |
21 |
Upload Errored: #uploadErrored#
22 |
Errored Property Name: #erroredPropertyName#
23 |
Error Info: #errorInfo#
24 |
Is Multiple: #isMultiple ? "true" : "false"#
25 |
26 |
27 |
--------------------------------------------------------------------------------
/test-harness/views/workshop/nestedDataKeys.cfm:
--------------------------------------------------------------------------------
1 | #wire( "workshop.NestedDataKeys" )#
2 |
3 |
4 |
5 | The cfdump below is NOT coming from the wire component, but from the nestedDataKeys.cfm view after the wire has rendered.
6 | It shows any CBWire interceptors that ran during the wire lifecycle for this inital page render.
7 | The data is being injected into the application scope by the TestHarnessInterceptor.cfc interceptor.
8 | The application.cbwire_interceptors_run structure is cleared at the start of the Workshop.nestedDataKeys() handler method to ensure only the interceptors for this wire are shown.
9 |
10 | CBWire Interceptors That Ran:
11 |
12 |
--------------------------------------------------------------------------------
/test-harness/wires/TestUIComponent.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component"{
2 |
3 | // Data Properties
4 | data = {
5 | "message": "This is the default template",
6 | "showButton": false
7 | };
8 |
9 | // Computed properties
10 | computed = {
11 | "counter": function() { return 0; }
12 | };
13 |
14 | // Listeners
15 | listeners = {
16 | "fooEvent": "fooEventCalled"
17 | };
18 |
19 | // Actions
20 | function foo( bar = false ) {
21 | if ( arguments.bar ) {
22 | data.message = "Foo called with params";
23 | } else {
24 | data.message = "Foo called";
25 | }
26 | }
27 |
28 | function fooEventCalled( name ){
29 | if ( !isNull( name ) ){
30 | data.message = "Foo event called by #name#";
31 | } else {
32 | data.message = "Foo event called";
33 | }
34 | }
35 | }
--------------------------------------------------------------------------------
/test-harness/server-boxlang-cfml@1.json:
--------------------------------------------------------------------------------
1 | {
2 | "name":"cbwire-boxlang-cfml@1",
3 | "app":{
4 | "serverHomeDirectory":".engine/boxlang",
5 | "cfengine":"boxlang@be"
6 | },
7 | "web":{
8 | "caseSensitivePaths":false,
9 | "http":{
10 | "port":"60299"
11 | },
12 | "rewrites":{
13 | "enable":"true"
14 | },
15 | "aliases":{
16 | "/modules/cbwire":"../",
17 | "/moduleroot/cbwire":"../"
18 | }
19 | },
20 | "openBrowser":"false",
21 | "fusionreactor":{
22 | "enable":false
23 | },
24 | "jvm":{
25 | "heapSize":"1024",
26 | "javaVersion":"openjdk21_jre",
27 | "args":"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8888"
28 | },
29 | "scripts":{
30 | "onServerInitialInstall":"install bx-compat-cfml --noSave && install bx-esapi --noSave"
31 | }
32 | }
--------------------------------------------------------------------------------
/includes/js/livewire/js/features/supportJsEvaluation.js:
--------------------------------------------------------------------------------
1 | import { closestComponent } from '@/store'
2 | import { overrideMethod } from '@/$wire'
3 | import { on } from '@/hooks'
4 | import Alpine from 'alpinejs'
5 |
6 | Alpine.magic('js', el => {
7 | let component = closestComponent(el)
8 |
9 | return component.$wire.js
10 | })
11 |
12 | on('effect', ({ component, effects }) => {
13 | let js = effects.js
14 | let xjs = effects.xjs
15 |
16 | if (js) {
17 | Object.entries(js).forEach(([method, body]) => {
18 | overrideMethod(component, method, () => {
19 | Alpine.evaluate(component.el, body)
20 | })
21 | })
22 | }
23 |
24 | if (xjs) {
25 | xjs.forEach(({ expression, params }) => {
26 | params = Object.values(params)
27 |
28 | Alpine.evaluate(component.el, expression, { scope: component.jsActions, params })
29 | })
30 | }
31 | })
32 |
--------------------------------------------------------------------------------
/models/preprocessor/TeleportPreprocessor.cfc:
--------------------------------------------------------------------------------
1 | /**
2 | * This component is responsible for handling the preprocessing of content that contains teleport directives.
3 | * It replaces the @teleport(selector) syntax with and @endteleport with .
4 | */
5 | component singleton {
6 |
7 | function handle( content ) {
8 | // Replace @teleport( selector ) with
9 | // This handles optional spacing, and both single and double quotes around the selector
10 | arguments.content = arguments.content.reReplaceNoCase( "@teleport\s*\(\s*['""]?([^)'""\s]+)['""]?\s*\)", "", "all" );
11 |
12 | // Replace @endteleport with
13 | arguments.content = arguments.content.replaceNoCase( "@endteleport", " ", "all" );
14 |
15 | // Return the modified content
16 | return arguments.content;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/test-harness/wires/SuperHeroes.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" {
2 |
3 | data = {
4 | "mailinglist": "x-men at marvel.com",
5 | "heroes": [],
6 | "villians": [],
7 | "isMarvel": true,
8 | "isDC": false,
9 | "showStats": false
10 | };
11 |
12 | constraints = {
13 | "mailingList": { required: true, type: "email" }
14 | };
15 |
16 | function defeatVillians(){
17 | data.villians = [];
18 | }
19 |
20 | function addHero(hero){
21 | data.heroes.append(hero);
22 | }
23 |
24 | function addVillian(villian){
25 | data.villians.append(villian);
26 | }
27 |
28 | function numberOfHeroes() computed {
29 | return data.heroes.len();
30 | }
31 |
32 | function numberOfVillians() computed {
33 | return data.villians.len();
34 | }
35 |
36 | function calculateStrength() computed {
37 | return getTickCount();
38 | }
39 | }
--------------------------------------------------------------------------------
/test-harness/wires/CounterComplete.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
Counter
5 |
Current: #counter#
6 |
Is Even: #isEven#
7 |
8 |
Increment
9 |
Increment By 10
10 |
Decrement
11 |
14 |
15 |
16 |
17 |
18 | The number is even!
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "git.ignoreLimitWarning": true,
3 | "editor.detectIndentation": true,
4 | "workbench.colorCustomizations": {
5 | "titleBar.activeBackground": "#E6B444",
6 | "titleBar.inactiveBackground": "#E6B444",
7 | "titleBar.activeForeground": "#000000",
8 | "titleBar.inactiveForeground": "#000000",
9 | "activityBar.background": "#E6B444",
10 | "activityBar.foreground": "#000000",
11 | "activityBar.inactiveForeground": "#333333"
12 | },
13 | "scm.diffDecorations": "none",
14 | "search.exclude": {
15 | "**/*.git": true,
16 | "**/*.sql": true,
17 | "**/*.zip": true,
18 | "**/coverageReport": true,
19 | "**/tests/captures": true
20 | },
21 | "files.exclude": {
22 | "**/*.git": true,
23 | "**/*.sql": true,
24 | "**/*.zip": true,
25 | "**/coverageReport": true,
26 | "**/tests/captures": true
27 | },
28 | "search.ripgrep.maxThreads": 3
29 | }
--------------------------------------------------------------------------------
/models/scripts.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
22 |
23 |
--------------------------------------------------------------------------------
/test-harness/wires/test/test_component_with_dot_notation_data.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 | data = {
4 | "title": {
5 | "label" : "CBWIRE Rocks!"
6 | },
7 | "newValue": "",
8 | "oldValue": "",
9 | "modules": {
10 | "names" : [
11 | "Module 1",
12 | "Module 2",
13 | "Module 3"
14 | ]
15 | }
16 | };
17 |
18 | function onUpdatetitle_label( value, oldValue ) {
19 | data.title.label = arguments.value;
20 | data.newValue = arguments.value;
21 | data.oldValue = arguments.oldValue;
22 | }
23 | // @endWire
24 |
25 |
26 |
27 |
28 |
Title: #title.label#
29 |
New Value: #newValue#
30 |
Old Value: #oldValue#
31 |
32 |
33 |
34 | #module#
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/test-harness/wires/CounterUsingCBWIRE3.cfc:
--------------------------------------------------------------------------------
1 | component extends="cbwire.models.Component" accessors="true" {
2 |
3 | data = {
4 | "count": 1
5 | };
6 |
7 | computed = {
8 | "countPlusTen": function() {
9 | return data.count + 10;
10 | },
11 | "tick": function(){
12 | return getTickCount();
13 | }
14 | };
15 |
16 | function onMount( params ) {
17 | data.count = 10;
18 | }
19 |
20 | /**
21 | * Increments the counter by 1.
22 | */
23 | public function increment() {
24 | data.count += 1;
25 | }
26 |
27 | /**
28 | * Decrements the counter by 1.
29 | */
30 | public function decrement() {
31 | data.count -= 1;
32 | }
33 |
34 |
35 | /**
36 | * Renders the component's HTML output with Livewire-compatible attributes.
37 | * @return The HTML representation of the component, including Livewire data attributes.
38 | */
39 | public string function onRender() {
40 | return template("wires.CounterUsingDataDot");
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/includes/js/livewire/js/directives/wire-confirm.js:
--------------------------------------------------------------------------------
1 | import { directive } from "@/directives"
2 |
3 | directive('confirm', ({ el, directive }) => {
4 | let message = directive.expression
5 | let shouldPrompt = directive.modifiers.includes('prompt')
6 |
7 | // Convert sanitized linebreaks ("\n") to real line breaks...
8 | message = message.replaceAll('\\n', '\n')
9 |
10 | if (message === '') message = 'Are you sure?'
11 |
12 | el.__livewire_confirm = (action, instead) => {
13 | if (shouldPrompt) {
14 | let [question, expected] = message.split('|')
15 |
16 | if (! expected) {
17 | console.warn('Livewire: Must provide expectation with wire:confirm.prompt')
18 | } else {
19 | let input = prompt(question)
20 |
21 | if (input === expected) {
22 | action()
23 | } else {
24 | instead()
25 | }
26 | }
27 | } else {
28 | if (confirm(message)) action()
29 | else instead()
30 | }
31 | }
32 | })
33 |
--------------------------------------------------------------------------------
/includes/js/livewire/js/plugins/history/url.js:
--------------------------------------------------------------------------------
1 |
2 | export function hasQueryParam(param) {
3 | let queryParams = new URLSearchParams(window.location.search);
4 |
5 | return queryParams.has(param)
6 | }
7 |
8 | export function getQueryParam(param) {
9 | let queryParams = new URLSearchParams(window.location.search);
10 |
11 | return queryParams.get(param)
12 | }
13 |
14 | export function setQueryParam(param, value) {
15 | let queryParams = new URLSearchParams(window.location.search);
16 |
17 | queryParams.set(param, value)
18 |
19 | let url = urlFromQueryParams(queryParams)
20 |
21 | history.replaceState(history.state, '', url)
22 | }
23 |
24 | function urlFromParams(params = {}) {
25 | let queryParams = new URLSearchParams(window.location.search);
26 |
27 | Object.entries(params).forEach(([key, value]) => {
28 | queryParams.set(key, value)
29 | })
30 |
31 | let queryString = Array.from(queryParams.entries()).length > 0
32 | ? '?'+params.toString()
33 | : ''
34 |
35 | return window.location.origin + window.location.pathname + '?'+queryString + window.location.hash
36 | }
37 |
--------------------------------------------------------------------------------
/test-harness/handlers/BeatBox.cfc:
--------------------------------------------------------------------------------
1 | component {
2 |
3 | property name="beatBoxService" inject="BeatBoxService";
4 |
5 | function preHandler( event ) {
6 | event.setLayout( "BeatBox" );
7 | }
8 |
9 | function index( event, rc, prc ) {}
10 |
11 | function loops( event, rc, prc ) {
12 | prc.searchCriteria = event.getValue( "search", "" );
13 | prc.genreCriteria = event.getValue( "genre", "" );
14 | prc.genres = beatBoxService.getGenres();
15 | prc.loops = beatBoxService.getLoops();
16 |
17 | // Filter our loops by the search criteria.
18 | if ( prc.searchCriteria.len() ) {
19 | prc.loops = prc.loops.filter( function( _loop ) {
20 | return _loop.title contains prc.searchCriteria;
21 | } );
22 | }
23 |
24 | // Filter our loops by the genre.
25 | if ( prc.genreCriteria.len() ) {
26 | prc.loops = prc.loops.filter( function( _loop ) {
27 | return _loop.genre contains prc.genreCriteria;
28 | } );
29 | }
30 | }
31 |
32 | function upload( event, rc, prc ) {}
33 |
34 | function contact( event, rc, prc ) {}
35 | }
--------------------------------------------------------------------------------
/includes/js/livewire/js/features/supportNavigate.js:
--------------------------------------------------------------------------------
1 |
2 | shouldHideProgressBar() && Alpine.navigate.disableProgressBar()
3 |
4 | document.addEventListener('alpine:navigate', e => forwardEvent('livewire:navigate', e))
5 | document.addEventListener('alpine:navigating', e => forwardEvent('livewire:navigating', e))
6 | document.addEventListener('alpine:navigated', e => forwardEvent('livewire:navigated', e))
7 |
8 | function forwardEvent(name, original) {
9 | let event = new CustomEvent(name, { cancelable: true, bubbles: true, detail: original.detail })
10 |
11 | document.dispatchEvent(event)
12 |
13 | if (event.defaultPrevented) {
14 | original.preventDefault()
15 | }
16 | }
17 |
18 | export function shouldRedirectUsingNavigateOr(effects, url, or) {
19 | let forceNavigate = effects.redirectUsingNavigate
20 |
21 | if (forceNavigate) {
22 | Alpine.navigate(url)
23 | } else {
24 | or()
25 | }
26 | }
27 |
28 | function shouldHideProgressBar() {
29 | if (!! document.querySelector('[data-no-progress-bar]')) return true
30 |
31 | if (window.livewireScriptConfig && window.livewireScriptConfig.progressBar === false) return true
32 |
33 | return false
34 | }
35 |
--------------------------------------------------------------------------------
/models/styles.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/test-harness/wires/test/should_support_array_of_struct_data_properties.cfm:
--------------------------------------------------------------------------------
1 |
2 | // @startWire
3 | data = [
4 | "title": "CBWIRE Rocks!",
5 | "states": []
6 | ];
7 |
8 | function addState( abr, name ){
9 | data.states.append( { "name" : name, "abr" : abr } );
10 | }
11 |
12 | function onMount( params, event, rc, prc ) {
13 | // Initialize some states
14 | data.states.append( { "name" : "Maryland", "abr" : "MD" } );
15 | data.states.append( { "name" : "Virginia", "abr" : "VA" } );
16 | data.states.append( { "name" : "Florida", "abr" : "FL" } );
17 | data.states.append( { "name" : "Wyoming", "abr" : "WY" } );
18 | }
19 | // @endWire
20 |
21 |
22 |
23 |
24 |
#args.title#
25 |
States
26 |
Number Of States In data.states: #states.len()#
27 |
28 |
29 |
30 | #currentState.abr# : #currentState.name#
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/includes/js/livewire/js/features/supportListeners.js:
--------------------------------------------------------------------------------
1 | import { on as hook } from '@/hooks'
2 |
3 | hook('effect', ({ component, effects }) => {
4 | registerListeners(component, effects.listeners || [])
5 | })
6 |
7 | function registerListeners(component, listeners) {
8 | listeners.forEach(name => {
9 | // Register a global listener...
10 | let handler = (e) => {
11 | if (e.__livewire) e.__livewire.receivedBy.push(component)
12 |
13 | component.$wire.call('__dispatch', name, e.detail || {})
14 | }
15 |
16 | window.addEventListener(name, handler)
17 |
18 | component.addCleanup(() => window.removeEventListener(name, handler))
19 |
20 | // Register a listener for when "to" or "self"
21 | component.el.addEventListener(name, (e) => {
22 | // We don't care about non-Livewire dispatches...
23 | if (! e.__livewire) return
24 |
25 | // We don't care about Livewire bubbling dispatches (only "to" and "self")...
26 | if (e.bubbles) return
27 |
28 | if (e.__livewire) e.__livewire.receivedBy.push(component.id)
29 |
30 | component.$wire.call('__dispatch', name, e.detail || {})
31 | })
32 | })
33 | }
34 |
35 |
36 |
--------------------------------------------------------------------------------
/test-harness/box.json:
--------------------------------------------------------------------------------
1 | {
2 | "name":"Tester",
3 | "version":"0.0.0",
4 | "slug":"tester",
5 | "private":true,
6 | "description":"",
7 | "dependencies":{
8 | "coldbox":"7",
9 | "cbvalidation":"^4.3.0+24",
10 | "cbi18n":"^3.2.0+12",
11 | "cbcsrf":"^3.1.0+16",
12 | "cbsecurity":"^3.5.0+6"
13 | },
14 | "devDependencies":{
15 | "testbox":"6",
16 | "route-visualizer":"^1.4.0+24"
17 | },
18 | "installPaths":{
19 | "coldbox":"coldbox/",
20 | "testbox":"testbox/",
21 | "cbvalidation":"modules/cbvalidation/",
22 | "route-visualizer":"modules/route-visualizer/",
23 | "cbi18n":"modules/cbi18n/",
24 | "cbcsrf":"modules/cbcsrf/",
25 | "cbsecurity":"modules/cbsecurity/"
26 | },
27 | "testbox":{
28 | "runner":"http://localhost:60299/tests/runner.cfm"
29 | },
30 | "scripts":{
31 | "cfpm:install2023":"echo '\".engine/adobe2023/WEB-INF/cfusion/bin/cfpm.sh\" install ${1}' | run",
32 | "cfpm:install2025":"echo '\".engine/adobe2025/WEB-INF/cfusion/bin/cfpm.sh\" install ${1}' | run",
33 | "install:2023":"run-script cfpm:install2023 zip,debugger",
34 | "install:2025":"run-script cfpm:install2025 zip,debugger"
35 | }
36 | }
--------------------------------------------------------------------------------
/test-harness/config/WireBox.cfc:
--------------------------------------------------------------------------------
1 | component extends="coldbox.system.ioc.config.Binder"{
2 |
3 | /**
4 | * Configure WireBox, that's it!
5 | */
6 | function configure(){
7 |
8 | // The WireBox configuration structure DSL
9 | wireBox = {
10 | // Scope registration, automatically register a wirebox injector instance on any CF scope
11 | // By default it registeres itself on application scope
12 | scopeRegistration = {
13 | enabled = true,
14 | scope = "application", // server, cluster, session, application
15 | key = "wireBox"
16 | },
17 |
18 | // DSL Namespace registrations
19 | customDSL = {
20 | // namespace = "mapping name"
21 | },
22 |
23 | // Custom Storage Scopes
24 | customScopes = {
25 | // annotationName = "mapping name"
26 | },
27 |
28 | // Package scan locations
29 | scanLocations = [],
30 |
31 | // Stop Recursions
32 | stopRecursions = [],
33 |
34 | // Parent Injector to assign to the configured injector, this must be an object reference
35 | parentInjector = "",
36 |
37 | // Register all event listeners here, they are created in the specified order
38 | listeners = [
39 | // { class="", name="", properties={} }
40 | ]
41 | };
42 |
43 | // Map Bindings below
44 | }
45 |
46 | }
--------------------------------------------------------------------------------
/includes/js/livewire/js/plugins/navigate/teleport.js:
--------------------------------------------------------------------------------
1 | import Alpine from "alpinejs"
2 |
3 | export function packUpPersistedTeleports(persistedEl) {
4 | // Persisted elements get removed from the DOM and then re-added later. We need to do the same
5 | // with any `x-teleport`ed elements...
6 | Alpine.mutateDom(() => {
7 | persistedEl.querySelectorAll('[data-teleport-template]').forEach(i => i._x_teleport.remove())
8 | })
9 | }
10 |
11 | export function removeAnyLeftOverStaleTeleportTargets(body) {
12 | // We need to remove any left-over teleported elements form the page
13 | // as they are stale and will be re-initialized when Alpine boots up on this page...
14 | Alpine.mutateDom(() => {
15 | body.querySelectorAll('[data-teleport-target]').forEach(i => i.remove())
16 | })
17 | }
18 |
19 | export function unPackPersistedTeleports(persistedEl) {
20 | // Before we put back any persisted elements, we're going to
21 | // find any "x-teleports" and put their targets back on the page...
22 | Alpine.walk(persistedEl, (el, skip) => {
23 | if (! el._x_teleport) return;
24 |
25 | el._x_teleportPutBack()
26 |
27 | skip()
28 | })
29 | }
30 |
31 | export function isTeleportTarget(el) {
32 | return el.hasAttribute('data-teleport-target')
33 | }
34 |
--------------------------------------------------------------------------------
/includes/js/livewire/js/features/supportHotReloading.js:
--------------------------------------------------------------------------------
1 | import { on } from '@/hooks'
2 |
3 | // // Only allow this in "Simple Preview"...
4 | // if (! navigator.userAgent.includes('Electron')) return
5 |
6 | // if (! enabled.includes('hot-reloading')) return
7 |
8 | on('effect', ({ component, effects }) => {
9 | queueMicrotask(() => {
10 | let files = effects.hotReload
11 |
12 | if (! files) return
13 |
14 | if (files) {
15 | files.forEach(file => {
16 | whenFileIsModified(file, () => {
17 | component.$wire.$refresh()
18 | })
19 | })
20 | }
21 | })
22 | })
23 |
24 | let es = new EventSource("/livewire/hot-reload")
25 |
26 | es.addEventListener("message", function(event) {
27 | let data = JSON.parse(event.data)
28 |
29 | if (data.file && listeners[data.file]) {
30 | listeners[data.file].forEach(cb => cb())
31 | }
32 | })
33 |
34 | es.onerror = function(err) {
35 | // console.log("EventSource failed:", err)
36 | }
37 |
38 | es.onopen = function(err) {
39 | // console.log("opened", err)
40 | }
41 |
42 | let listeners = []
43 |
44 | function whenFileIsModified(file, callback) {
45 | if (! listeners[file]) listeners[file] = []
46 |
47 | listeners[file].push(callback)
48 | }
49 |
--------------------------------------------------------------------------------
/test-harness/modules_app/testingmodule/ModuleConfig.cfc:
--------------------------------------------------------------------------------
1 | component {
2 |
3 | // Module Properties
4 | this.title = "testingmodule";
5 | this.author = "";
6 | this.webURL = "";
7 | this.description = "";
8 | this.version = "1.0.0";
9 | // If true, looks for views in the parent first, if not found, then in the module. Else vice-versa
10 | this.viewParentLookup = true;
11 | // If true, looks for layouts in the parent first, if not found, then in module. Else vice-versa
12 | this.layoutParentLookup = true;
13 | // Module Entry Point
14 | this.entryPoint = "testingmodule";
15 | // Inherit Entry Point
16 | this.inheritEntryPoint = false;
17 | // Model Namespace
18 | this.modelNamespace = "testingmodule";
19 | // CF Mapping
20 | this.cfmapping = "testingmodule";
21 | // Auto-map models
22 | this.autoMapModels = true;
23 | // Module Dependencies
24 | this.dependencies = [];
25 |
26 | function configure(){
27 |
28 | // parent settings
29 | parentSettings = {
30 |
31 | };
32 |
33 | settings = {
34 |
35 | };
36 |
37 | layoutSettings = {
38 | defaultLayout = "Main.cfm"
39 | };
40 |
41 | routes = [];
42 |
43 | resources = [];
44 |
45 | interceptorSettings = {
46 | customInterceptionPoints = ""
47 | };
48 |
49 | interceptors = [];
50 |
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/handlers/Main.cfc:
--------------------------------------------------------------------------------
1 | component {
2 |
3 | property name="cbwireController" inject="CBWIREController@cbwire";
4 |
5 | /**
6 | * Primary entry point for cbwire requests.
7 | *
8 | * URI: /cbwire/update
9 | */
10 | function index( event, rc, prc ){
11 | try {
12 | return cbwireController.handleRequest( getHTTPRequestData(), arguments.event );
13 | } catch ( any e ) {
14 | if ( e.message contains "Page expired" ) {
15 | event.noLayout();
16 | event.setView( view="errors/pageExpired", module="cbwire" );
17 | event.setHTTPHeader( statusCode="419", statusText="Page Expired" );
18 | } else {
19 | rethrow;
20 | }
21 | }
22 | }
23 |
24 | /**
25 | * Endpoint for file uploads
26 | *
27 | * URI: /cbwire/upload-file
28 | */
29 | function uploadFile( event, rc, prc ) {
30 | return cbwireController.handleFileUpload( getHTTPRequestData(), event );
31 | }
32 |
33 | /**
34 | * Endpoint for previewing file uploads
35 | *
36 | * URI: /cbwire/preview-file/:uploadUUID
37 | */
38 | function previewFile( event, rc, prc ) {
39 | return cbwireController.handleFilePreview( getHTTPRequestData(), event );
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/test-harness/includes/workshop/github-dark.min.css:
--------------------------------------------------------------------------------
1 | pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
2 | Theme: GitHub Dark
3 | Description: Dark theme as seen on github.com
4 | Author: github.com
5 | Maintainer: @Hirse
6 | Updated: 2021-05-15
7 |
8 | Outdated base version: https://github.com/primer/github-syntax-dark
9 | Current colors taken from GitHub's CSS
10 | */.hljs{color:#c9d1d9;background:#0d1117}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#ff7b72}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#d2a8ff}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:#79c0ff}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#a5d6ff}.hljs-built_in,.hljs-symbol{color:#ffa657}.hljs-code,.hljs-comment,.hljs-formula{color:#8b949e}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:#7ee787}.hljs-subst{color:#c9d1d9}.hljs-section{color:#1f6feb;font-weight:700}.hljs-bullet{color:#f2cc60}.hljs-emphasis{color:#c9d1d9;font-style:italic}.hljs-strong{color:#c9d1d9;font-weight:700}.hljs-addition{color:#aff5b4;background-color:#033a16}.hljs-deletion{color:#ffdcd7;background-color:#67060c}
--------------------------------------------------------------------------------
/test-harness/wires/loops.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -- Select genre --
5 |
6 | #genre#
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
#loop.title#
15 |
16 |
#loop.description#
17 |
Genre: #loop.genre#
18 |
BPM: #loop.bpm#
19 |
20 |
21 |
22 | Play
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/includes/js/livewire/js/features/supportLazyLoading.js:
--------------------------------------------------------------------------------
1 | import { on } from '@/hooks'
2 |
3 | let componentsThatWantToBeBundled = new WeakSet
4 |
5 | let componentsThatAreLazy = new WeakSet
6 |
7 | on('component.init', ({ component }) => {
8 | let memo = component.snapshot.memo
9 |
10 | // We only care about lazy components...
11 | if (memo.lazyLoaded === undefined) return
12 |
13 | componentsThatAreLazy.add(component)
14 |
15 | // The component doesn't want its lazy load to be an isolated request
16 | // then we'll mark it to detect at "pool" time to make sure it gets bundled...
17 | if (memo.lazyIsolated !== undefined && memo.lazyIsolated === false) {
18 | componentsThatWantToBeBundled.add(component)
19 | }
20 | })
21 |
22 | on('commit.pooling', ({ commits }) => {
23 | commits.forEach(commit => {
24 | // We only care about lazy components...
25 | if (! componentsThatAreLazy.has(commit.component)) return
26 |
27 | if (componentsThatWantToBeBundled.has(commit.component)) {
28 | commit.isolate = false
29 |
30 | componentsThatWantToBeBundled.delete(commit.component)
31 | } else {
32 | commit.isolate = true
33 | }
34 |
35 | // Component is no longer lazy after the first full request, so remove it...
36 | componentsThatAreLazy.delete(commit.component)
37 | })
38 | })
39 |
--------------------------------------------------------------------------------
/test-harness/wires/AlpineUpload.cfm:
--------------------------------------------------------------------------------
1 |
2 |
3 | #serializejson( data )#
4 |
Alpine Upload
5 |
6 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
Loading....
22 |
23 |
24 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | // @startWire
34 | data = {
35 | "photo": ""
36 | };
37 |
38 | // @endWire
39 |
--------------------------------------------------------------------------------