CLI fixes for hotpatching the playground (#4715)

* add component subcommand

* add dx component add, remove and list commands

* handle rust dependencies

* handle component dependencies

* fetch remote registries

* sort components before listing them

* remove local dependency

* move te component manifest into the dioxus workspace

* add additional instalation instructions the first time the component
module is created

* fix mod name

* fix clippy

* improve docs and move to the main branch of components

* fix typos

* more typos

* undo const-serialize changes

* remove a few unwraps

* Allow adding multiple components at once and add a `--all` flag

* add options to the config for the base path, global asset path and
default registry

* component_path -> component_dir

* component_dir is always relative to the crate root

* fix clippy

* fix hot patching with a base path

* read the hot patch file from stdin instead of a CLI arg to allow for longer inputs

* fix request imports

* wip: code style changes

* rename to "components" instead of "component"

* bump lock

* move to method on request

* read until eof in the case of pretty json

* strip is now copy

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
This commit is contained in:
Evan AlmloffandJonathan Kelley authored and GitHub committed 2025-10-20 17:50:27 -04:00
1 parent 79613f9db9
commit 987e41de16
6 files changed
+1715 -1739

No files matched your search

+3 -20
View File
@@ -290,24 +290,7 @@ impl HotpatchModuleCache {
}
}
/// Create a jump table for the given original and patch files.
pub fn create_jump_table(
patch: &Path,
triple: &Triple,
cache: &HotpatchModuleCache,
) -> Result<JumpTable> {
// Symbols are stored differently based on the platform, so we need to handle them differently.
// - Wasm requires the walrus crate and actually modifies the patch file
// - windows requires the pdb crate and pdb files
// - nix requires the object crate
match triple.operating_system {
OperatingSystem::Windows => create_windows_jump_table(patch, cache),
_ if triple.architecture == Architecture::Wasm32 => create_wasm_jump_table(patch, cache),
_ => create_native_jump_table(patch, triple, cache),
}
}
fn create_windows_jump_table(patch: &Path, cache: &HotpatchModuleCache) -> Result<JumpTable> {
pub fn create_windows_jump_table(patch: &Path, cache: &HotpatchModuleCache) -> Result<JumpTable> {
use pdb::FallibleIterator;
let old_name_to_addr = &cache.symbol_table;
@@ -361,7 +344,7 @@ fn create_windows_jump_table(patch: &Path, cache: &HotpatchModuleCache) -> Resul
///
/// This does not work for WASM since the `object` crate does not support emitting the WASM format,
/// and because WASM requires more logic to handle the wasm-bindgen transformations.
fn create_native_jump_table(
pub fn create_native_jump_table(
patch: &Path,
triple: &Triple,
cache: &HotpatchModuleCache,
@@ -416,7 +399,7 @@ fn create_native_jump_table(
/// to manually satisfy them here, removing their need to be imported.
///
/// <https://github.com/WebAssembly/tool-conventions/blob/main/DynamicLinking.md>
fn create_wasm_jump_table(patch: &Path, cache: &HotpatchModuleCache) -> Result<JumpTable> {
pub fn create_wasm_jump_table(patch: &Path, cache: &HotpatchModuleCache) -> Result<JumpTable> {
let name_to_ifunc_old = &cache.symbol_ifunc_map;
let old = &cache.old_wasm;
let old_symbols =