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

[Cleanup] Remove all traces of hbs #146

Merged
merged 1 commit into from
Oct 3, 2023

Conversation

NullVoxPopuli
Copy link
Collaborator

@NullVoxPopuli NullVoxPopuli commented Mar 30, 2023

Background and motivation:

ember-template-imports was originally intended to be an experiment for all (and more!) possibilities outlined in emberjs/rfcs#779 (and explored through this blog series: https://v5.chriskrycho.com/journal/ember-template-imports/ ).

Of those possibilities, ember-template-imports implemented 2:

So, since RFC 779 chose <template>, we no longer need hbs``, which this PR removes.


To help simplify the work of #143, we want to remove as much of the old stuff as possible before we extract the preprocessor and the babel plugin to their own locations.

This is most def a breaking change.
Though, there is no rush on cutting a release, and we could even wait until the extraction outlined in #143 is complete.


This PR is just removal, to minimize the diff.
There are some obvious refactors / de-type unioning that can happen afterwards.

@NullVoxPopuli NullVoxPopuli changed the title Remove all traces of hbs [Cleanup] Remove all traces of hbs Mar 30, 2023
@NullVoxPopuli NullVoxPopuli marked this pull request as ready for review March 30, 2023 23:44
Copy link
Member

@mansona mansona left a comment

Choose a reason for hiding this comment

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

We discussed this in the embroider meeting and we generally agree that this is a good thing to merge.

While it would make the linked "splitting" issue easier to implement we don't need to have this PR merged before we're going to start that work 👍 It would just be nice to have the newly split lib not need to support something that is "the old way to do something" 😂

src/babel-plugin.js Show resolved Hide resolved
src/parse-templates.ts Show resolved Hide resolved

return preprocessEmbeddedTemplates(string, config).output;
if (relativePath.match(/\.(gjs|gts)$/)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

When will this condition ever not match?

Copy link
Collaborator Author

@NullVoxPopuli NullVoxPopuli Apr 5, 2023

Choose a reason for hiding this comment

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

I specifically did 0 refactoring so the pr would be more digestible.

Changing existing logic would be out of scope for this, and require more testing as well.

Copy link
Collaborator Author

@NullVoxPopuli NullVoxPopuli Apr 5, 2023

Choose a reason for hiding this comment

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

Can clean up in quick follow up PR

Copy link
Collaborator

Choose a reason for hiding this comment

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

This conditional is directly tied to the line you changed above, turning {js,gjs,ts,gts} into just {gjs,gts}, so this isn't so much "refactoring" as "keeping the code consistent with the other changes you made". If you're planning on doing another pass in a separate PR, though, then I'm not going to lose sleep over it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

tied to the line you changed above

that is a good point!

then I'm not going to lose sleep over it.

thanks, yeah, it's just folks across OSS review so infrequently, I don't want to to overwhelm anyone with a bunch of changes, even if they are all needed.

Update snapshots since data has been removed

Commit lockfile changes due to package.json change

Fix case where <template> could be within a template string (found in REPL)

Add failing test for situation brought up on limber.glimdown.com

Add fix for reported issue on limber.glimdown.com

Fix comment in babel-plugin.js
@NullVoxPopuli NullVoxPopuli merged commit 49045c3 into ember-cli:master Oct 3, 2023
16 checks passed
@NullVoxPopuli NullVoxPopuli deleted the remove-hbs-literals branch October 3, 2023 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants