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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add staticModifiers option #1021

Merged
merged 1 commit into from Dec 6, 2021

Conversation

Windvis
Copy link
Collaborator

@Windvis Windvis commented Nov 15, 2021

still need to add tests and actually test if it works 馃槵 I added some tests. Let me know if I missed something 馃檹.

Closes #603

@Windvis Windvis force-pushed the feature/staticModifiers-option branch from 455cc03 to ee65257 Compare November 17, 2021 14:44
@Windvis Windvis marked this pull request as ready for review November 17, 2021 14:45
if (node.path.type !== 'PathExpression') {
return;
}
if (node.path.this === true) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

we need same for node.path.data === true ({{@foobar}})

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, didn't know about that!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added! I also forgot about "contextual" modifiers so I added that as well.

Copy link
Collaborator

@lifeart lifeart Nov 17, 2021

Choose a reason for hiding this comment

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

@Windvis could we cover "modifier" helper usage?

like

{{#let (modifier "foo-bar" arg param=1) as |my-modifier|}}
   <div {{my-modifier}} ></div>
{{/let}}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@lifeart There is a separate issue for that already: #1018

I think it's better to split that up in a dedicated PR (which can also add support for the helper helper)?

@Windvis Windvis force-pushed the feature/staticModifiers-option branch 2 times, most recently from 0f95933 to f4c41d1 Compare November 17, 2021 16:30
@Windvis
Copy link
Collaborator Author

Windvis commented Nov 18, 2021

CI seems to fail due to #1024 which should be fixed by #1027 I rebased on master since #1027 was merged.

This option makes it possible to tree-shake unused modifiers and is the modifier equivalent of staticHelpers and staticComponents.
@Windvis Windvis force-pushed the feature/staticModifiers-option branch from f4c41d1 to b159f89 Compare December 5, 2021 21:44
@ef4 ef4 merged commit 18bae90 into embroider-build:master Dec 6, 2021
@Windvis Windvis deleted the feature/staticModifiers-option branch December 6, 2021 19:18
@rwjblue rwjblue added the enhancement New feature or request label Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add staticModifiers flag (to support shaking unused modifiers and route splitting)
4 participants