-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add symlink yarn command and document linking #110
Conversation
Successfully deployed demo at https://picasso.toptal.net/fx-27-document-npm-link |
Tip for checklist on github :)
|
README.md
Outdated
To unlink picasso follow these steps: | ||
|
||
1. In terminal navigate to picasso project directory | ||
2. Create link with `yarn symlink:off` |
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.
Maybe Unlink with...
?
-edit: Also wondering - what happens if you don't unlink Picasso
itself? Is there any harm to that? Maybe it doesn't matter if it stays linked?
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 can, I can extend docs and say unlinking in picasso directory is optional.
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.
I would maybe even remove it if it doesn't really change anything (just to have simpler instructions). I assume the only problem would be if you had a couple of picasso folders on your machine?
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.
I would leave it because it explains whole cycle.But I divided instructions into two groups so it will be clearer.
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.
Minor comments, but if current steps are working I think this is good to be merged
README.md
Outdated
5. Create link with `yarn symlink` (creates picasso and react link) | ||
6. In terminal navigate to your project directory | ||
7. Link picasso with `yarn link @toptal/picasso` | ||
8. Link react with `yarn link react` |
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.
I'm not sure we should link react
, I tried linking with testbed
and it worked with simply linking @toptal/picasso
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.
Hooks require one instance of React, while other React feature also they don't throw explicit error.
facebook/react#14257 (comment)
There is alternative approach with webpack resolve.alias but if you use CRA2 that is not an option. I would wait and see how users will use it. This is not optimal but it's robust linking solution.
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.
I believe initial users will be us anyways, so lets leave it all here, we can add that it MAY BE optional, but in case we get stuck, we wouldn't have to look for an answer. We can always clean up in the future
README.md
Outdated
2. Create link with `yarn symlink:off` | ||
3. In terminal navigate to your project directory | ||
4. Unlink picasso with `yarn unlink @toptal/picasso` | ||
5. Unlink react with `yarn unlink react` |
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.
same here
Successfully deployed demo at https://picasso.toptal.net/fx-27-document-npm-link |
@vedrani I've added |
Successfully deployed demo at https://picasso.toptal.net/fx-27-document-npm-link |
e459aca
to
7052073
Compare
Successfully deployed demo at https://picasso.toptal.net/fx-27-document-npm-link |
7052073
to
c50368e
Compare
Successfully deployed demo at https://picasso.toptal.net/fx-27-document-npm-link |
1 similar comment
Successfully deployed demo at https://picasso.toptal.net/fx-27-document-npm-link |
FX-27
Description
Linking with yarn
link
is pretty straightforward. Problem is what and where to link.I wrote tutorial on how to link picasso with project that uses picasso as dependency.
Also extracted
symlink
as separate command/script.MAIN PROBLEM: React can work only with one instance and when you link picasso you have 2 instances in testbed. One solution is to add resolve alias in webpack of
testbed
project, but if you are using CRA2 it's not an option. Alternative is when you are doing linking ofpicasso
you linkreact
also. We can discuss is that final solution or we need to solve it differently.facebook/react#14257 (comment)
facebook/react#13991 (comment)
Also review
testbed
https://github.com/toptal/picasso-testbed/pull/1
How to test
Read
readme
section on deployed picasso to test linking. I'm working in VM so after unlinking when I runyarn install
intestbed
andpicasso
nothing happens. So I need to deletenode_modules
and doyarn install
to achieve initial state before linking.Review
CHANGELOG.md
README.md