Skip to content

Conversation

@rax-it
Copy link
Contributor

@rax-it rax-it commented Jun 20, 2024

What does this PR do?

Adds config variables to customize lwc-dev-server

  • port
  • workspace

To be merged after #52

What issues does this PR fix or reference?

const ldpServerUrl = PreviewUtils.generateWebSocketUrlForLocalDevServer(platform, '8081');
const ldpServerUrl = PreviewUtils.generateWebSocketUrlForLocalDevServer(
platform,
`${await LwcDevServerUtils.getLocalDevServerPort()}`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maliroteh-sf not sure why the port is consumed as a string?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have this fixed locally so please ignore for now until my next PR.

/**
* The port number of the local dev server.
*/
LOCAL_DEV_SERVER_PORT = 'local-dev-server-port',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can /bike-shed on the name since this variable is public

@rax-it rax-it marked this pull request as ready for review June 21, 2024 17:18
@rax-it rax-it requested a review from a team as a code owner June 21, 2024 17:18
@rax-it rax-it requested a review from ravijayaramappa June 21, 2024 19:10
Copy link
Contributor

@maliroteh-sf maliroteh-sf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some nits & comments but other than that LGTM

const ldpServerUrl = PreviewUtils.generateWebSocketUrlForLocalDevServer(platform, '8081');
const ldpServerUrl = PreviewUtils.generateWebSocketUrlForLocalDevServer(
platform,
`${await LwcDevServerUtils.getLocalDevServerPort()}`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have this fixed locally so please ignore for now until my next PR.

export const LOCAL_DEV_SERVER_DEFAULT_PORT = 8081;
export const LOCAL_DEV_SERVER_DEFAULT_WORKSPACE = Workspace.SfCli;

export class LwcDevServerUtils {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, I plan on consolidating lwcDevServerUtils.ts and identityUtils.ts into configUtils.ts since the code in both of these are around fetching or writing different config values. But as far as this PR is concerned, we can leave this unchanged.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I realized that we are wasting at least next tick since we are loading the same config twice.

@rax-it rax-it merged commit 7a069ce into main Jun 24, 2024
@rax-it rax-it deleted the custom-configure branch June 24, 2024 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants