Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two critical problems with blocks. #5

Open
louiss0 opened this issue May 8, 2023 · 5 comments
Open

Two critical problems with blocks. #5

louiss0 opened this issue May 8, 2023 · 5 comments

Comments

@louiss0
Copy link

louiss0 commented May 8, 2023

When it came to testing this library I have noticed two things.

  1. You can't create a component block within a nested sfc.
  2. You can't use a component that was created by the component block inside of another one.

I don't know if those decisions were intentional or not. but it seems like you did not think of this stuff.

If these two problems are not solved then using JSX would be the superior chioce. I think Number 1 does not need to be solved but No.2 does.

Along with #4 these are the problems with the library so far. I'm personally comfortable with the library as these problems will n

Created text component

Screenshot 2023-05-08-vue-nested-sfc-text-compoenent-133236
ot limit my current projects but they are still problems.

Attempt to use text component inside of the increment button one

Screenshot-vue-nested-sfc-test-increment-button-with-text-2023-05-08 133102

Link to minimal reproducible example

https://github.com/louiss0/vue-nested-sfc-test

@louiss0
Copy link
Author

louiss0 commented May 8, 2023

Oh if you are done with these problems please go to 1.0.0 People will not take this lib seriously if you don't go to 1.0.0 soon. Or they will be suspicious. I know the JS community doesn't take this stuff seriously but please don't make that mistake.

Im rooting for the success of this lib

@hunyan-io
Copy link
Owner

Thanks for the suggestions!

Regarding the first issue, it's due to how compiler-sfc parses blocks following the HTML Standard. Even within scripts you can't have a closing </script> inside a string (e.g. <script> const str = "</script>"; </script>). The same applies to other blocks including the component block, you can't include the literal </component> inside its content, because the content is treated as raw text.

Regarding the second issue, it has to wait until #6 is fixed.

Regarding the images, I'm not sure which issue they're referring to (the reproduction link doesn't have the same example), is this another issue?

@louiss0
Copy link
Author

louiss0 commented May 9, 2023

Regarding the images, I'm not sure which issue they're referring to (the reproduction link doesn't have the same example), is this another issue?

Are you sure you looked at <HelloWorld /> they should be there. I'm reffering to number two.

@louiss0
Copy link
Author

louiss0 commented May 12, 2023

Well then I'm going to have to maybe close this issue when No.2 is solved. This library is ready for prime time now. But I have to say that If No.2 is not solved this library will not grow too much.

@louiss0
Copy link
Author

louiss0 commented Jun 27, 2023

Thanks for the suggestions!

Regarding the first issue, it's due to how compiler-sfc parses blocks following the HTML Standard. Even within scripts you can't have a closing </script> inside a string (e.g. <script> const str = "</script>"; </script>). The same applies to other blocks including the component block, you can't include the literal </component> inside its content, because the content is treated as raw text.

Regarding the second issue, it has to wait until #6 is fixed.

Regarding the images, I'm not sure which issue they're referring to (the reproduction link doesn't have the same example), is this another issue?

I think you forgot to solve the second problem I have found a way to use components that are inside of others but that is not how I want things to be done.

For me to use and SFC inside of another SFC I need to export the component then import it inside of the other one.

I wish there was a way to manipulate blocks so that the components would be auto imported this is what I mean here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants