Skip to content

build: example list outputting quoted components #13955

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

Merged
merged 1 commit into from
Nov 10, 2018

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Nov 3, 2018

In c64503e the logic that outputs the list of components was reworked to use JSON.stringify. As a result, the data that is generated has the component inside quotes, rather than a reference to the component class itself. This breaks the demo app. The following changes add some extra logic to remove the quotes around the component.

@crisbeto crisbeto added pr: merge safe target: patch This PR is targeted for the next patch release labels Nov 3, 2018
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Nov 3, 2018
Copy link
Member

@devversion devversion left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks. Still way more clean than how it was initially

@jelbourn
Copy link
Member

jelbourn commented Nov 6, 2018

I saw and merged Joey's change for this first- do you still want to get this in?

@crisbeto
Copy link
Member Author

crisbeto commented Nov 6, 2018

I’m not super attached to it, but it should be a bit more sustainable than constructing the JSON ourselves.

@jelbourn
Copy link
Member

jelbourn commented Nov 6, 2018

I'll take a look if you want to rebase

In c64503e the logic that outputs the list of components was reworked to use `JSON.stringify`. As a result, the data that is generated has the `component` inside quotes, rather than a reference to the component class itself. This breaks the demo app. The following changes add some extra logic to remove the quotes around the `component`.
@crisbeto crisbeto force-pushed the example-component-quotes branch from 8e7fa1a to e72ebe9 Compare November 6, 2018 23:57
@crisbeto
Copy link
Member Author

crisbeto commented Nov 6, 2018

Rebased @jelbourn.

Copy link
Member

@josephperrott josephperrott left a comment

Choose a reason for hiding this comment

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

Overall LGTM, just the one question/comment.

.replace('${exampleList}', `[${exampleList}]`);
.replace('${exampleComponents}', JSON.stringify(exampleComponents))
.replace('${exampleList}', `[${exampleList}]`)
.replace(new RegExp(`"${quotePlaceholder}|${quotePlaceholder}"`, 'g'), '');
Copy link
Member

Choose a reason for hiding this comment

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

The only part I am not sure I am understanding is the or in regex here?

why are we looking for ◬|◬ instead of just since we are global matching

Copy link
Member

Choose a reason for hiding this comment

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

@crisbeto add merge ready once your ready.

Copy link
Member Author

@crisbeto crisbeto Nov 7, 2018

Choose a reason for hiding this comment

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

Note the quotes inside it. It looks for "◬|◬" (e.g. "◬something◬").

@josephperrott josephperrott removed the action: merge The PR is ready for merge by the caretaker label Nov 7, 2018
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Nov 7, 2018
@vivian-hu-zz vivian-hu-zz merged commit 06fb408 into angular:master Nov 10, 2018
vivian-hu-zz pushed a commit that referenced this pull request Nov 12, 2018
In c64503e the logic that outputs the list of components was reworked to use `JSON.stringify`. As a result, the data that is generated has the `component` inside quotes, rather than a reference to the component class itself. This breaks the demo app. The following changes add some extra logic to remove the quotes around the `component`.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants