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

New CLI command $ vike eject #1553

Closed
brillout opened this issue Mar 15, 2024 · 11 comments
Closed

New CLI command $ vike eject #1553

brillout opened this issue Mar 15, 2024 · 11 comments

Comments

@brillout
Copy link
Member

brillout commented Mar 15, 2024

Description

Make Vike integrations ejectable.

For example $ vike eject vike-react-apollo would essentially do two things:

  • Move code from node_modules/vike-react-apollo/ to the user-land pages/. (Or better yet its TypeScript source code.)
  • Remove vike-react-apollo from package.json#dependencies.

Eject is also nice from a marketing perspecitve as it doubles down on the Optional Control USP.

WIP: #1798
Prior art: https://github.com/brillout/eject

@tbjgolden
Copy link

tbjgolden commented Apr 26, 2024

This would be massive in terms of the company project we're considering vike for

@brillout
Copy link
Member Author

@tbjgolden How so?

@tbjgolden
Copy link

Optional control is something we care about - we'd obviously prefer to trust a preset that others also use but if needs must we'd be able to maintain some custom code

Nothing specific in mind, more of a insurance policy that makes it easier to get sign off on it

@brillout
Copy link
Member Author

Yes, that‘s the idea. In the meantime you can manually eject.

@brillout
Copy link
Member Author

brillout commented May 2, 2024

@tbjgolden Also btw. in case that's something your company would be up for, Vike is looking for sponsors. (As a bonus Vike could then, for example, prioritize eject.)

@phonzammi
Copy link
Member

phonzammi commented Jun 25, 2024

Another use case I can think of is when a user may want to eject specific files, like onRenderHtml.ts and onRenderClient.ts, rather than ejecting everything.

For example $ vike eject vike-react onRenderHtml,onRenderClient would essentially perform the following actions:

  • Copy code from node_modules/vike-react/ to the user-land pages/ (or renderer/).
  • Add import of those files to +config.ts. (May not be necessary ?)

Edit

  • Also needs to be added to export default {}.

@nitedani
Copy link
Member

I'm not sure that would work, unless every imported module(in the ejected files) are (re)exported from vike-react.

@phonzammi
Copy link
Member

phonzammi commented Jun 25, 2024

I'm not sure that would work, unless every imported module(in the ejected files) are (re)exported from vike-react.

Yeah, I think you're right. I've updated my comment.

Here is an example vike-react-styled-components-grommet by @lourot

@snake-py
Copy link

I worked on this here - #1798

@brillout brillout mentioned this issue Aug 11, 2024
@snake-py
Copy link

I just wanted to pop in here and let you guys now that development moved into its own repository. We just released a first version.

See docs and repository.

@brillout
Copy link
Member Author

I guess we can mark this as completed. Props to @snake-py 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants