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

Feature Request: Better Monorepo Support #1877

Open
petermikitsh opened this issue Sep 20, 2019 · 11 comments
Open

Feature Request: Better Monorepo Support #1877

petermikitsh opened this issue Sep 20, 2019 · 11 comments
Labels
Feature: Want this? Upvote it! This PR or Issue may be a great consideration for a future idea.

Comments

@petermikitsh
Copy link
Contributor

petermikitsh commented Sep 20, 2019

Stencil version:

 @stencil/core@latest

I'm submitting a:

[ ] bug report
[x] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/

Current behavior:

Example Repo: https://github.com/petermikitsh/stencil-monorepo

When trying to develop 2 Stencil Component projects as subpackages in a lerna setup, some issues arise.

Project setup: Assume two component libraries, project-a and project-b.

  • project-a defines a Stencil component, a-button, that is used inside of project-b.
  • Both projects were generated with the npm init stencil command).

Limitations encountered:

  • When I edit the a-button component, project-b won’t pick up the changes. Have to kill and restart the server.
  • Inside of project-b, I don’t get the typings from project-as stencil components. Solved: petermikitsh/stencil-monorepo@359dc57

Expected behavior:

Seamless support for monorepos. I should be able to develop multiple component libraries side-by-side with typescript types and hot reloading.

Steps to reproduce:

  • Clone example repo
  • npm i && npm start
  • Try performing operations like editing the a-button component, and observe that project B can't detect the changes.
@bitflower
Copy link
Contributor

This is my solution to the "reload on change" requirement:
https://gist.github.com/bitflower/613c19b612ffaf3f3195b12b33316034

It's not pretty or fast but it works for now. I guess it's not enough if you do quick iterations in the consumed project.

@bitflower
Copy link
Contributor

This repo demonstrates additionally how to include a "Util / Commons" kinda package consumed by both Stencil component packages.

https://github.com/bitflower/stencil-lerna

@LeeBurton
Copy link

I’m seeing an increase in people using monorepos for complex projects with Lerna, and this is something that I think needs addressing sooner rather than later, to solve it in a clean way :-)

@razvangeangu
Copy link

This is my solution to reload on change using parallel and alias for a util library inside stencil using lerna.

https://github.com/razvangeangu/stencil-ds-plugins-demo

@bitflower
Copy link
Contributor

Dup of #2648

Guys, let's consolidate and get this happen. Recently Adam started adding changes to support this. It still doesn't work but I think we are close.

Which "main" ticket should be keep to not spam the issues list?

CC @splitinfinities

@bitflower
Copy link
Contributor

@razvangeangu Can you point to the file using parallel? I found the alias.

@splitinfinities
Copy link
Contributor

Hey there, thank you for the patience getting back to you. The new team is getting started and we're working through the backlog now.

I'd like to understand the current state of the art within the community working with a Monorepo. If you have any tips, tricks, concerns, or questions, please comment what you are bumping into and how/if you hack around it.

@cymptom
Copy link

cymptom commented Nov 4, 2021

@splitinfinities I don't have any tips and tricks unfortunately, but just wanted to highlight that this is an issue for us, in exactly the way described. Our more complex components depend on library packages that are defined adjacent to our Stencil package in our monorepo. When those library packages are rebuilt, Stencil's dev server does appear to rebuild and refresh, but the changes aren't actually incorporated. To incorporate them, you need to either stop and restart the dev server, or manually kick off a Stencil dev build and refresh the browser.

This has led to much confusion as we've started bringing other developers on to our project. The fact that Stencil does rebuild and refresh the dev server misleads our developers into expecting to find their changes in the browser, and this results in a lot of unnecessary wheel-spinning and misdirected troubleshooting, as you might imagine. I've made efforts to communicate the necessary order of operations for this workflow, but it makes for a tedious process that even I get tripped up on, despite knowing exactly what needs to happen.

@rwaskiewicz rwaskiewicz added Resolution: Needs Investigation This PR or Issue should be investigated from the Stencil team and removed Feature: Dependencies labels Mar 25, 2022
@bitflower
Copy link
Contributor

bitflower commented May 10, 2022

lerna is now maintained by nx lerna/lerna#3121

@sawden
Copy link

sawden commented Jun 9, 2023

I'm using Stencil in combination with Turborepo and encountering the same issue when it comes to importing from other workspaces. Stencil still doesn't seem to recognize when a change has been made in an imported package.

In my research, I found the following issues that describe this problem: #1379, #2648, #2587, #1496.
Are there any updates or progress regarding Stencil's support for monorepos?

I understand that open source projects like this are a huge effort and that priorities must be balanced. I'm wondering if there are plans to work on this monorepo support issues, or if there are other topics that are currently taking precedence?

Thank you in advance for any updates or advice.

@rwaskiewicz rwaskiewicz added Feature: Want this? Upvote it! This PR or Issue may be a great consideration for a future idea. and removed Resolution: Needs Investigation This PR or Issue should be investigated from the Stencil team labels Sep 7, 2023
@bitflower
Copy link
Contributor

How do I update @rwaskiewicz ? I added a thumbs up to the OP.

Any news reg. this issue/feature ? Does Stencil 4 still have the same issues then v2 (which I'm still on)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Want this? Upvote it! This PR or Issue may be a great consideration for a future idea.
Projects
None yet
Development

No branches or pull requests

8 participants