Closed wincent closed 4 years ago
Oh I'm surprised that our lockfile is bigger than Portal 😱. But looking at it quickly it seems that we have a lot of outdated dependencies concentrated in the @clay/css
package, alias it doesn't work with Node 12, so maybe we need to update the dependencies or modify the build stack to modernize, we would probably be able to decrease this graph of dependencies but I'm not sure how expensive it would be.
Thanks for opening this @wincent, this is a great issue to investigate on a rainy day. I would suspect that the clayui.com
and @clayui/css
package are two main culprits. I'll look into this in the next few weeks.
To me @clayui/css
test site is important, maybe I can keep a local copy for development then we can be done with this issue.
Hey @pat270! If the test site is important, it's important for everyone :)
At the same time, it's also important for everyone that the project is light, easy to build and contribute, so we need to find ways to bridge both worlds.
@bryceosterhaus, since we're already using Gatsby to generate the new site... why don't we just migrate the test site to Gatsby? That might help reduce dependencies while keeping a tool like the test site in a more orderly fashion... Additionally, coming up with a nicer organization in the test site could lead to better synergies and allow us to, for example, import samples directly from there rather than having to rewrite them in the clayui.com
project... wdt? 🤔
@jbalsas When you say test site, are you referring to storybook?
No, @pat270’s test site... the thing is not clayui.com nor storybook
ah gotcha. i didnt realize that was in the repo. @pat270 how do you typically run it?
@bryceosterhaus packages/clay-css/
then gulp serve
Okay so I spent some time trying to get a POC for moving the clay-css test site to gatsby so that we can remove a bunch of dependencies. I tried to preserve the structure of our content as much as possible, meaning we needed to configure gatsby to dynamically create pages based on html files with frontmatter.
Overall, the goal was to utilize gatsby since it was an existing dependency for clayui.com, and then we could remove a large portion of our devDependencies that are focused on supporting the test site.
I was able to get the site running and dynamically generate the pages we had previously, but I ran into issues with how it was transforming the html. One big area of concern was that I was unable to get our <code>
examples to properly render with html content escaped inside. I was utilizing gatsby-transformer-rehype
to handle this, but just couldn't quite get it to the place I wanted. I was also using html-frontmatter to preprocess the html and get the frontmatter information.
I'm not sure if anyone has any other ideas or if this is even worth the time pursuing any more.
Here is a demo of the site with gatsby. I'm sure a handful of interactions are broken, I haven't added the js back in yet. Ths focus was on dynamically generating pages. Here is the code
So overall question: is it worth spending more time migrating to gatsby? Or do we just let it be and put up with additional dependencies since its working fine as is.
So overall question: is it worth spending more time migrating to gatsby? Or do we just let it be and put up with additional dependencies since its working fine as is.
The answer to that probably depends on whether you have more important things to do, but I don't actually know all the things you have on your plate right now so I don't have much to add here. 😬
So overall question: is it worth spending more time migrating to gatsby? Or do we just let it be and put up with additional dependencies since its working fine as is.
I honestly think we should kill that. Ideally, we'd find better development workflows than having to check demos on a huge "test" site. It's also often used as a deep-web documentation which really bothers me, and feels like another reason we should get rid of that and focus on our site.
My feeling is that the effort of migrating it AS IS is too big. I'd suggest approaching this from a different angle and make a full assessment of the situation
Based on the answers to those questions, we can plan and prioritize accordingly.
Please don't kill it before we get all the information it holds https://github.com/liferay/clay/issues/2734 (🤔 the sentence seems to come from a mafia movie 😆)
I agree we shouldn't port the test site as is. I think we can develop using clayui.com with the current content as long as we fix these issues:
1) Right now we use node_modules/@clayui/css
files for clayui.com, which isn't very useful during development. If I want to use clayui.com to test changes in @clayui/css
I need to update package.json
to point to my local @clayui/css
, update clay css
, and restart the server everytime I want to view an update.
2) Need to be able to switch between base theme and atlas theme.
@eduardoallegrini It should be ok to kill it right now. It doesn't take me too long to upload archives to my github pages. The information will still be available on the deep-web documentation :laughing: mentioned by @jbalsas.
@pat270 what I'll do is try and get clayui.com in a usable spot for your development and also keep your old site around for now. Once we are able to provide the same value on clayui.com, we can then kill the test site.
Once I address your two points, just try to make an effort to use clayui.com, and then any time you find yourself going back to the test site, just ping me and we can create and issue and I'll work on a solution so that clayui.com is viable for you.
Thant work?
@bryceosterhaus sounds good. Thinking about it more, even having only 1) working would suffice.
Just planting this one as a seed for discussion and thought, although it may not lead to any action. The question:
The Clay dependency graph is very large.
The
yarn.lock
has 23k lines.yarn audit
reports:(Note that it is obviously some double-counting there due to some kind of Yarn bug; there are 80k files in the
node_modules
directory and it must be counting the same packages repeatedly.)Running
yarn outdated
108 outdated dependencies:Full output in this gist
Screenshot showing the output in all of its glorious red/yellow:
Obviously, all of these dependencies bring some value, otherwise we wouldn't have added them. Most — but not all — of them are
devDependencies
. But I wanted to bring up the size of the graph because these dependencies are not free:Just to put things in perspective, liferay-portal itself "only" has an 18k-line lockfile (about 82% of the size of Clay's).
As I said above, I don't know if any specific action needs to or will be taken as the result of this ticket, but I just wanted to raise awareness about the cost-benefit trade-off involved in maintaining this dependency graph. We might want to check to see if there are any non-essential dependencies, or dependencies that aren't pulling their weight. Or we might merely keep this discussion in mind the next time a PR proposes to add another dependency to the graph.
Sighed, your grumpy, dependency-allergic curmudgeon, @wincent.