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

feat: js style import support #12

Merged
merged 11 commits into from
Dec 3, 2019
Merged

Conversation

lifeart
Copy link
Contributor

@lifeart lifeart commented Feb 21, 2019

MU Support for #10

Octane imports style

import BasicDropdown from 'ember-basic-dropdown/components/basic-dropdown';
import { BasicDropdown as SameDropdown } from 'ember-basic-dropdown/components';
import PrivateComponent from 'src/ui/routes/items/-components/component-name';

--- hbs ---

<BasicDropdown />
<SameDropdown />
<PrivateComponent />

Classic imports style

{{import BasicDropdown from 'ember-basic-dropdown/components/basic-dropdown'}}
{{import SameDropdown from 'ember-basic-dropdown/components'}}
{{import PrivateComponent from 'src/ui/routes/items/-components/component-name'}}

<BasicDropdown />
<SameDropdown />
<PrivateComponent />

@NullVoxPopuli
Copy link

just tested this, and it works! :)

@knownasilya
Copy link
Owner

Any chance for a readme update?

@lifeart
Copy link
Contributor Author

lifeart commented Feb 21, 2019

@knownasilya, yeah, nice catch! I'm planning to add more tests and then write down readme update

@davewasmer
Copy link
Contributor

davewasmer commented Feb 21, 2019

@lifeart thanks for all the work here! Just wanted to give you heads up that we've got a big deadline early next week, so it's likely we won't have a chance to review this until after then. But don't take the silence as lack of interest!

@shanemcgraw
Copy link

Hey there @davewasmer - wondering if this PR is still in play? Would love to try this out in Octane :)

app/helpers/register-absolute-template-import.js Outdated Show resolved Hide resolved
app/helpers/register-absolute-template-import.js Outdated Show resolved Hide resolved
lib/mu-utils.js Outdated Show resolved Hide resolved
lib/mu-utils.js Outdated Show resolved Hide resolved
@knownasilya
Copy link
Owner

@lifeart I thing the last thing holding this up is our hesitance with the MU part, since that's an ended experiment.

index.js Outdated Show resolved Hide resolved
@lifeart
Copy link
Contributor Author

lifeart commented Nov 18, 2019

Using lifeart/ember-language-server#12 it's possible to implement ELS support for this feature, for example:

find text content in template

https://astexplorer.net/#/gist/97bd072e0190bc366b6e78d0801df678/84c54a1f052c2924c29a828773a9657d1dfb8374

parse it using babel parser

https://astexplorer.net/#/gist/4d939c5fe32758eaf10155e2c9140353/cdf596d302dd1e0aba625a41588dccdd7f14181b

resolve component name and return it back

@knownasilya knownasilya changed the title feat: mu support feat: js style import support Dec 3, 2019
@knownasilya knownasilya merged commit b3c3854 into knownasilya:master Dec 3, 2019
@davewasmer
Copy link
Contributor

🎉 This PR is included in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

5 participants