Extract HTML DSL and VDOM into separate packages#27
Merged
kevin-sakemaer merged 4 commits intomainfrom Feb 13, 2026
Merged
Conversation
Split the VDOM system from spark_framework into two standalone packages: - spark_html_dsl: Pure Dart package with VNode types (VNode, Text, RawHtml, Element) and HTML DSL helpers (div, span, h1, button, input, etc.). Zero external dependencies. - spark_vdom: Browser VDOM engine (mount, patch, createNode, mountList) with server/VM stubs. Depends on spark_html_dsl + package:web. Re-exports spark_html_dsl for convenience. spark_framework now depends on both packages and uses re-export shims to preserve all existing import paths. Also removes the unused extensions.dart (SparkEventTargetExtension). Both new packages are fully tested (55 tests total across VM and browser). All 342 existing spark_framework tests continue to pass. https://claude.ai/code/session_016djT9tGK3QkDpcRN7gmerd
- Rename VNode to Node across spark_html_dsl and spark_vdom (the old name was to avoid dart:html conflict which no longer applies) - Remove re-export shim files from spark_framework (dsl.dart, node.dart, elements.dart, vdom.dart, vdom_web.dart, vdom_stub.dart) - Update spark.dart barrel to export directly from spark_html_dsl - Add public barrel exports to spark_vdom (vdom.dart, vdom_web.dart) - Update all spark_framework imports to point directly to new packages - Resolve ambiguous_export by hiding Node from spark_web re-export https://claude.ai/code/session_016djT9tGK3QkDpcRN7gmerd
…rrides The openapi test files create temp projects with a path dependency on spark_framework. Since spark_framework now depends on spark_html_dsl and spark_vdom, those packages also need local path overrides for dart pub get to resolve them. https://claude.ai/code/session_016djT9tGK3QkDpcRN7gmerd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR extracts the HTML DSL and Virtual DOM functionality from the
sparkframework package into two new standalone packages:spark_html_dslandspark_vdom. This improves modularity, allows independent versioning, and enables use of these components outside the full Spark framework.Key Changes
New
spark_html_dslpackage: Contains core node types (Node,Text,RawHtml,Element) and HTML DSL helpers (h(),div(),span(),p(),a(),button(),input(), etc.)packages/spark/lib/src/html/node.dartandelements.dartElement.eventWrapperstatic hook for event wrappingelements_test.dart,html_test.dart, andnode_test.dartNew
spark_vdompackage: Contains the browser-side Virtual DOM enginepackages/spark/lib/src/component/vdom_web.dartmount(),mountList(),patch(), andcreateNode()functionsUpdated
sparkpackage: Now depends onspark_html_dslandspark_vdomas external dependenciespackages/spark/lib/src/html/dsl.dartandextensions.dartspark.dartto re-export from new packagesUpdated workspace: Added new packages to
pubspec.yamlworkspace configurationTest updates: Migrated all HTML DSL and VDOM tests to their respective new packages, with updated imports throughout the
sparkpackage test suiteNotable Implementation Details
foreignObjecthttps://claude.ai/code/session_016djT9tGK3QkDpcRN7gmerd