-
Notifications
You must be signed in to change notification settings - Fork 17
[WIP] Remove custom "npm link" behaviour #238
base: master
Are you sure you want to change the base?
Conversation
There is already a procedure for both npm and yarn to read an npm module from disk. It's convenient and reliable. E.g. `yarn run dev:styleguide` maybe works for in the browser. But if I import `@humanconnection/styleguide` in the test, I get non-deterministic behaviour. Let's get rid of `yarn run dev:styleguide`
@roschaefer what is you issue here? Do we still have hot reload with that? I don’t think so, will test it. The npm link may be a solution but also a problem as you always will have to unlink it again which is tedious. |
Your issue might come from the wrong command inside the styleguide. You have to run yarn dev, not yarn build:lib like you did. It’s described in the readme. |
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.
Needs more investigation if that implementation preserves the intended behavior.
@appinteractive it does not support hot reload. I find it perfectly acceptable to run The desire to test the styleguide from within another application shows a dependency issue: Test + Try-out components in the styleguide, don't use another application for it. If you need sources from another folder to test basic functionality of base components, these sources are in the wrong location, they should be in the styleguide folder. |
@appinteractive if I have to run To reproduce:
There is no |
With
|
@roschaefer there is a .travis.yml in the styleguide as the publishing happens through Travis. You may need to also run yarn build once. But I think you don’t get the point here as you do not have to use it in the end. I find it irritating when functionality is ripped out because you can save a couple lines of code. I don’t get the point here. As far as I can see, you do not provide any viable solution or workable alternative here. |
Well, the viable alternative is to move the required source code to If we keep the removed code in this PR this creates a lot of confusion because you might a) see the changes in the browser in development mode but b) don't see a change if you write a test that depends on behaviour of the styleguide. I had that issue and was able to resolve it. But for our contributors it creates complexity and frustration. |
We can encapsulate is hat code inside the plugin and reference it where inside the config. So there will be no confusion. Also does that not effect testing, it’s for getting the result of styleguide changes in a live feedback loop. If it does interfere with testing, I agree to not recommend that route as it’s not intended for anyway but for styling and more rare tasks. But still, I will need that behavior the next weeks while adjusting styling etc. therefor I do not agree with ripping it out. We should point them to the npm link method for casual use as it will be suitable for the most usecases. Would that be in your interest? |
@appinteractive sounds like a plan! I'm OK to keep this code for now. We should write tests in the styleguide repository and find a way to try out the components interactively. This PR can stay opened and we merge it + remove the code eventually. |
@appinteractive by the way I would suggest that you try out |
Sure I will take a closer look definitely! The reason for the code is the live reload as I don’t want to rebuild everything every time. This can’t be solved by npm link as it’s a webpack config. I think a solution or compromise is somewhere in between. |
So I found several issues @roschaefer:
|
@appinteractive |
@appinteractive did some research. The error shows up if you symlink manually, e.g. |
Ahh that’s interesting, thanks. I will encapsulate the hot reload part who’s week. |
There is already a procedure for both npm and yarn to read an npm module
from a local folder. It's convenient and reliable.
E.g.
yarn run dev:styleguide
maybe works for in the browser. But if Iimport
@humanconnection/styleguide
in the test, I getnon-deterministic behaviour.
Let's get rid of
yarn run dev:styleguide
@appinteractive what is the command that you run before you upload to
@humanconnection/styleguide
? If I doyarn run build:lib
, link the npm package inNitro-Web
I get the following error message:The dropdown menu for
Report contribution
is neither visible nor clickable.