★ wanayoo — archive 1999 https://github.com/ember-cli/ember-cli-htmlbars/pull/558Nouvelle recherche | Portail wanayoo
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

Place colocated templates after the default export #558

Open
wants to merge 2 commits into
base: master
from

Conversation

@beddueimpossibile
Copy link

@beddueimpossibile beddueimpossibile commented May 19, 2020

I noticed that the source maps for component js files have a line number offset and so breakpoints and watches in VSCode doesn’t work properly. Only debugging from Chrome is possible.

After short investigation I found out that it is due to the template colocation feature. It prepends the template to the component class and so the resulting line numbers doesn't match the ones of the original js file.

I thought about appending the template to the component class instead of prepending it, in order to have the colocation feature not braking map files.

It seems working, the tests are updated and passing. I am already testing it on my local machine on production projects and I can easily switch back to the current version, so in the next days I will have detailed feedback. I decided to send a pull request in advance to have also your idea about this.

Copy link
Member

@rwjblue rwjblue commented May 19, 2020 — with Octobox

I certainly don't mind the ordering change, but I wonder if we should be doing something more intelligent WRT sourcemaps all together. Perhaps even including an inline sourcemap for the modifcation that we are doing here. 🤔

@beddueimpossibile
Copy link
Author

@beddueimpossibile beddueimpossibile commented May 19, 2020

Yes I agree with you, I improvised actually. Unfortunately I am not mastering those tools so I tried to solve it the way I know.

Beddu Impossibile
@beddueimpossibile
Copy link
Author

@beddueimpossibile beddueimpossibile commented May 20, 2020

An other possible solution, as you pointed out, is to generate the map file relative to the original js source file instead of the processed one. Unfortunately I could not figure out how.

I tried to look for it yesterday. For a "layman" like I am it's all but trivial to move inside the ember projects and I could not find out the right spot and/or the right tool. So I decided to implement this fix which is not that invasive and does the trick, with some negligible(?) overhead.

I would be glad to help, just need someone to point me at the right target since unfortunately my job is pressing me in those days and I don't have enough time to study the projects. For sure I am available for testing other solutions on field since I am working on ember projects on daily basis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.