Skip to content

Commit

Permalink
Merge pull request #192 from paperclip-ui/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
crcn authored Dec 24, 2023
2 parents 47f9d57 + 2d7b1b8 commit be46888
Show file tree
Hide file tree
Showing 21 changed files with 137 additions and 136 deletions.
10 changes: 5 additions & 5 deletions integrations/vscode/package-lock.json

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

8 changes: 4 additions & 4 deletions integrations/vscode/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vscode-paperclip",
"displayName": "Paperclip",
"version": "20.3.7",
"version": "20.3.8",
"publisher": "crcn",
"preview": true,
"private": true,
Expand Down Expand Up @@ -99,9 +99,9 @@
},
"dependencies": {
"@improbable-eng/grpc-web-node-http-transport": "^0.15.0",
"@paperclip-ui/common": "^20.3.7",
"@paperclip-ui/proto": "^20.3.7",
"@paperclip-ui/releases": "^20.3.7",
"@paperclip-ui/common": "^20.3.8",
"@paperclip-ui/proto": "^20.3.8",
"@paperclip-ui/releases": "^20.3.8",
"color": "^4.2.3",
"execa": "^5.1.1",
"get-port": "^3.2.0",
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"useNx": true,
"npmClient": "yarn",
"version": "20.3.7"
"version": "20.3.8"
}
4 changes: 2 additions & 2 deletions libs/compiler-react/src/code_compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,8 @@ fn compile_element(element: &ast::Element, info: &Info, context: &mut Context) {

context.add_buffer("React.createElement(");

if info.is_component_render_node {
context.add_buffer("props.is || ");
if let Some(name) = &element.name {
context.add_buffer(format!("{}.{}.as || ", context.ctx_name, name).as_str());
}

context.add_buffer(format!("{}, ", tag_name).as_str());
Expand Down
7 changes: 4 additions & 3 deletions libs/compiler-react/src/definition_compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ fn compile_component(component: &ast::Component, context: &mut Context) {
context.start_block();

// Not yet
// context.add_buffer("\"is\"?: React.ComponentType<any>,\n");
context.add_buffer("\"ref\"?: any,\n");

for (name, prop) in &component_inference.properties {
Expand Down Expand Up @@ -165,7 +164,9 @@ fn compile_inference(inference: &infer_types::Type, context: &mut Context) {
component.name.clone()
};

context.add_buffer(format!("React.ComponentProps<typeof {}>", ref_name).as_str());
context.add_buffer(
format!("{{ as?: any }} & React.ComponentProps<typeof {}>", ref_name).as_str(),
);
} else {
let el: ast::Element =
GetExpr::get_expr(&el.id, &context.dependency.get_document())
Expand All @@ -182,7 +183,7 @@ fn compile_inference(inference: &infer_types::Type, context: &mut Context) {
.as_str(),
);
} else {
context.add_buffer("React.HTMLAttributes<any>");
context.add_buffer("{ as?: any } & React.HTMLAttributes<any>");
}
}
}
Expand Down
Loading

0 comments on commit be46888

Please sign in to comment.