-
-
Notifications
You must be signed in to change notification settings - Fork 333
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
move components to pods structure #1070
Comments
Components moved to pod structure in PR #1071 |
Thanks! Can you chance import paths to import layout from './template'; ? |
Sorry, I forgot about that part. Do you want a relative path of the main components (like paper-dialog) or for all the components? |
I was thinking for all components. |
I tried it but half of the tests fail |
hmm, they shouldn't fail. What error do they throw? |
My bad, I forgot removing |
I had an error on the instructions that I edited. I had
But it should be
To be clear, component.js and template.hbs must be placed on the same folder, next to each other. |
Yes, I realized it after removing the component folder. Now all the template and component files are together in their respective folders. All the tests are ok. |
At the moment, all of our components are at the root level. The idea here is to move all components to use a pods like structure inside the addon folder. Also, ideally moving related components to the same folder.
Here is an example of this migration:
1. Move the files to the appropriate locations:
would become
2. update the re-export paths on app.
For example, paper
app/components/paper-dialog.js
now contains:but it should be updated to match the new component file location
The files at
app/components/*.js
shouldn't be nested in any directory. They should just be updated to point to the new correct internal component path.3. update the template import path.
Right now,
addon/components/paper-dialog.js
contains this import:however, now our template is right next to the component file! So it should just be updated to:
Bonus
ember-paper has an optional feature that allows the user to opt-out of including certain components. This helps to reduze the size of the final build.
All of the logic is in the
index.js
file. Since the components have moved around, this code needs to be updated. This might be a bit harder and not particularly easy for a beginner, so feel free to PR without this change! Someone will take care of that later.The text was updated successfully, but these errors were encountered: