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

Initial pass at templates for each LWC. #49

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

dbreese
Copy link
Collaborator

@dbreese dbreese commented Nov 7, 2023

For team discussion.

This is what I was thinking for "template files". Basically just placeholders in the file for the following variables we would need to programmatically substitute when generating the files. There's tons of possibilities, but this seems the simplest that I can think of.

VIEW TEMPLATE:
TEMPLATE_IMPORTS - actual imports from the @salesforce/schema namespace.
TEMPLATE_FIELDS - comma separated name of imported fields, ie NAME_FIELD, ACCOUNT_FIELD, etc
TEMPLATE_VIEW_LWC_LABEL - label for the view lwc
TEMPLATE_OBJECT_API_NAME

EDIT TEMPLATE:
TEMPLATE_LIGHTNING_INPUT_EDIT_FIELDS_HTML

TEMPLATE_OBJECT_API_NAME
TEMPLATE_VARIABLES
nameField = NAME_FIELD;
TEMPLATE_EDIT_LWC_LABEL - label for the edit lwc

CREATE TEMPLATE:
TEMPLATE_LIGHTNING_INPUT_CREATE_FIELDS_HTML

TEMPLATE_VARIABLE_ASSIGNMENTS
name_field = "";
TEMPLATE_CREATE_LWC_LABEL - label for the create lwc

Thoughts?

@khawkins @sfdctaka @maliroteh-sf

@dbreese dbreese requested a review from a team as a code owner November 7, 2023 00:09
Copy link
Collaborator

@sfdctaka sfdctaka left a comment

Choose a reason for hiding this comment

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

LGTM!

@dbreese dbreese changed the title @W-14442115 - Initial pass at templates for each LWC. Initial pass at templates for each LWC. Nov 7, 2023
Copy link
Collaborator

@khawkins khawkins left a comment

Choose a reason for hiding this comment

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

This seems like a fine approach to me. 👍

@dbreese dbreese merged commit c81967d into salesforce:main Nov 8, 2023
9 checks passed
@dbreese dbreese deleted the lwc_template_files branch November 8, 2023 15:03
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.

None yet

3 participants