-
Notifications
You must be signed in to change notification settings - Fork 935
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
Added support for non root (home) deployment of bit-server #4923 #4958
base: master
Are you sure you want to change the base?
Conversation
very nice! need to
|
Removed unrelated file. |
const wsUrl = `${isInsecure ? 'ws:' : 'wss:'}//${location.host}/subscriptions`; | ||
const wsUrl = `${isInsecure ? 'ws:' : 'wss:'}//${location.host}/bit-dev/subscriptions`; | ||
|
||
const client = this.graphqlUI.createClient('/graphql', { state, subscriptionUri: wsUrl }); | ||
const client = this.graphqlUI.createClient('/bit-dev/graphql', { state, subscriptionUri: wsUrl }); |
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.
need to pass basename from graphql/ui aspect
const defaultServerUrl = `/api/${component.id.toString()}/~aspect/preview/`; | ||
const defaultServerUrl = `/bit-dev/api/${component.id.toString()}/~aspect/preview/`; |
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.
need to pass basename (from where..?) as prop.
Where to get the basename prop though?
maybe we can it from react-router context?
worse case we can set a global react-context from the UI aspect, something like:
const { basename, apiPath } = useContext(???);
const defaultServerUrl = `${apiPath}/${component.id.toString()}/~aspect/preview/`;
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.
I'm thinking of adding basename to our internal routing system, as part of the changes I'm going to do to @teambit/base-ui.routing.routing-provider
anyways.
It would be more elegant.
Then again, I'm not sure it will work here, because explicitUrl
could have it's own url.
routing = Routing.url, | ||
children, | ||
location, | ||
basename = '/bit-dev/', |
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.
default should be undefined (if possible), or /
otherwise.
the "bit-dev" should come from the UI aspect
// Changing to relative path which should work in all cases | ||
publicPath: process.env.ASSET_PATH || './', |
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.
ooh this looks interesting, how does it work
forwarded publicPath to graphql aspect and react-router aspect. |
Thanks @KutnerUri for interim update. Will checkout latest and test. Can you share the steps how can I test when I have just scope.json ? |
GraphqlPreview.provider = ([previewPreview]: [PreviewPreview]) => { | ||
const graphqlPreview = new GraphqlPreview(); | ||
|
||
previewPreview.registerRenderContext(() => graphqlPreview.getConfig()); |
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.
forward gql config to preview
@@ -57,6 +60,19 @@ export class GraphqlUI { | |||
return client; | |||
} | |||
|
|||
getConfig = (): GqlConfig => { |
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.
dynamic gql endpoints, based on configuration
Fixes Issue
#4923
How to test
/
of the domainbit-local
npm run reproduce:issue
/bit-dev/
route and test the server with & without pushing components.Proposed Changes