-
Notifications
You must be signed in to change notification settings - Fork 788
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(compiler): source maps #2892
Conversation
…t-custom-elements, dist, esm, esm-es5 and cjs. Added option to StencilConfig type options.
Added type for merge-source-map node module. Made tsConfig get sourceMap settings from Stencil config.
To anyone interested, I built out a temporary package of all my recent PRs (and may add some other user's PRs in future too) - just until Stencil becomes more active. This includes: You can test it out with little disruption by just swapping out any reference to
becomes
I will keep this package in-sync with @stencil/core master up until the relevant PRs get accepted or rejected. |
thnx @johnjenkins for the code and the package. For anyone interested, using this branch i was able to get Vscode chrome debugger (https://github.com/microsoft/vscode-chrome-debug/blob/master/README.md), which needs sourcemaps, working with a stenciljs project i was working on. I had to put some time into getting everything right but its working now. For anyone interested this is my launch.json config which works with a project dir structuring where "src" contains your original code and "www" contains the build files from stencil:
|
@johnjenkins i ran into an issue with the typescript optional chaining / nullish operator. I i use you stencil package i get a runtime error on this line |
hi @sandergroenensimbuka - nope, no idea, but thanks for letting me know. edit can recreate, will fix |
I've found the problem and it's related to the one 3rd party lib I'm using for the |
@sandergroenensimbuka Whilst waiting for an official fix, I've pushed my own for now :) (I think!) |
Thnx! its working now with your 0.0.3 version |
@johnjenkins would be interested to talk if you're ever looking for a job. Tbh Ionic should be trying to hire you. |
@johnjenkins My name is Nick and I'm the director of engineering at Ionic. Been digging through some of you PRs and would be interested in chatting with you if you're up for it! You can email me at [email protected] if you're up for it! |
Give this guy a new job and merge the PR pls! It's kinda horrible to debug code without sourcemaps |
I would love for this to work! |
@AartdenBraber thanks so much for being a guinea pig! edit - seems to be a typescript issue microsoft/TypeScript#35374 |
@johnjenkins yeah I could, would that help? Also, I'm getting a TS error that I shouldn't be using 'class' in my jsx, but rather 'className'. I didn't get that before though |
it would really help :)
? |
Yes both syntaxes, and tsconfig is |
thanks again, If you can create the repo, I'll see what's up :D |
Could be some trouble linking as well, I'm not sure. I have invited you to my private repo 👍 |
@AartdenBraber you’re a true gentleman and scholar - Thank you! |
I'm awaiting more info from AartdenBraber, but whilst I wait, I've pushed a new build
This stops components that are not using I'll fix the issue with template literals and |
Oh buddy. Here we go. Review incoming! 🥁 Thanks for the patience! |
@splitinfinities thanks so much! Your PR looks all good - after some cursory checks, have merged. |
Good news: I'm not getting any errors in my big project! This means a deal, because my team and I have been exploring the limitations of Stencil for quite some time now. I'm sure we didn't cover all possibilities, but we did cover a lot. And even better news, John's implementation works perfectly. I can't tell you how psyched I was when I set a breakpoint and it actually froze the page on execution haha. I missed that a lot. ❤ I'm hoping it doesn't take too long to merge this, but for all Windows users: I simply copied John's implementation to |
- upgrade prettier to v2.3.2 - lock version to prevent breaking changes in minor versions - add prettier.dry-run package.json script - add pipeline action to evaluate format status - add prettierignore file for faster runs STENCIL-8: Add Prettier to Stencil
See #3005 |
Closing as this is now being integrated by the stencil core team - thanks everyone! |
Hello!
This PR seeks to add source-maps to most stencil output - a feature that is long requested here, here, here, here, here and proposed here
The changes simply seek to join the source-map dots (and therefore track the changes back to the original source) from the first typescript transforms and transpilation, through the rollup bundling and finally into and out of the optimisation.
I've addressed and tested most output targets: dist-lazy (cjs / esm / es5 varieties), dist-collection, dist-custom-elements and dist-custom-elements-bundle.
To keep things simple, there are no soureMap options - just a boolean.
Now setting
sourceMap: true
withinstencil.config.ts
will override typescript configuration options (sourceMap and inlineSources) and generate source maps (external .js.map files with inlined sources) for all above outputs mentioned.Let me know if I've missed something or can improve anything.
Many thanks!
fixes #1744
fixes #1650
fixes #219
fixes #1255
Pull request checklist
Please check if your PR fulfills the following requirements:
npm run build
) was run locallyPull request type
Please check the type of change your PR introduces:
What is the current behavior?
There are no source maps
What is the new behavior?
As described above.
Does this introduce a breaking change?
Manual Testing
npm build
andnpm link
from the root of the repo directory (on this branch)npm init stencil
sourceMap: true
option to stencil.configconsole.log('hello')
to my-component.ts