-
Notifications
You must be signed in to change notification settings - Fork 50
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
feat: enable placing islands anywhere #176
Conversation
I was thinking of making it based on @liltechnomancer 's code, but there has been a big difference. So, I can't add @liltechnomancer as a co-author, but your comment was helpful! |
Hi @usualoma ! Could you review this one? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. I think it is a good change!
I made one comment, please check it out.
src/client/client.ts
Outdated
...import.meta.glob('/app/routes/**/_[a-zA-Z0-9[-]+.island.(tsx|ts)'), | ||
...import.meta.glob('/app/islands/**/[a-zA-Z0-9-]+.(tsx|ts)'), | ||
...import.meta.glob('/app/**/_[a-zA-Z0-9-]+.island.(tsx|ts)'), | ||
...import.meta.glob('/app/**/$[a-zA-Z0-9-]+.(tsx|ts)'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has nothing to do with this PR change, In matchIslandComponentId()
, only .tsx
matches (.ts does not), so I think only
.tsx` should be used here as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right! It should be only .tsx
and it's not a problem if it does not support .ts
.
Thanks @usualoma ! I've fixed it. I'll merge this right now. |
With this PR, we can put island components anywhere instead of under
/app/routes
or/app/islands
. For example, the components placed like the following will be treated as islands./app/components/$counter.tsx
/app/components/_counter.island.tsx
In addition, I've added the following changes:
^/islands
or specify the path if passing the option.Fixes #159