vikejs / vike

🔨 Flexible, lean, community-driven, dependable, fast Vite-based frontend framework.
https://vike.dev
MIT License
4.08k stars 343 forks source link

New CLI command `$ vike eject` #1553

Open brillout opened 5 months ago

brillout commented 5 months ago

Description

Make Vike integrations ejectable.

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

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

WIP: https://github.com/vikejs/vike/pull/1798
Prior art: https://github.com/brillout/eject

tbjgolden commented 4 months ago

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

brillout commented 4 months ago

@tbjgolden How so?

tbjgolden commented 4 months ago

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 commented 4 months ago

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

brillout commented 4 months ago

@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 commented 2 months ago

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:

Edit

nitedani commented 2 months ago

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

phonzammi commented 2 months ago

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 commented 3 weeks ago

I worked on this here - https://github.com/vikejs/vike/pull/1798