-
Notifications
You must be signed in to change notification settings - Fork 151
Virtual fix for ember-inspector #2455
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So looking at this PR I figured it looked strange that a virtual file would have a namespace that really exists in a ember-source 🤔 and also one that we expect to make a real file in some future version of ember-source
I know I kept saying "Virtual file" when we talked about this but with the fact that it's something that could change with different Ember versions and exists in a real namespace I think we should add this to the ember-source compat adapter
I'm pretty sure the replaceFile()
function that I created should be able to create new files 🤔 https://github.com/embroider-build/embroider/blob/main/packages/compat/src/compat-adapters/ember-source.ts#L320C5-L320C16
7fea563
to
0d6967f
Compare
7a7b232
to
d916978
Compare
…eta and canary as versions
…n bring support to ember-source >= 6.1
d916978
to
43f44d7
Compare
hi, I saw that this work started 👍 |
@patricklx yes that was at the bottom of the barrel file which is now deprecated, likely won't be included if you're using vite and will be removed in Ember 7 👍 so we can't rely on that for our architecture |
Here is also a similar implementation directly in ember.js. |
Fixes #2484
Context
As part of the Ember Initiative, @mansona and I are trying to get ember-inspector to work for Vite apps. Two draft PRs have been opened in
ember.js
andember-inspector
as proof of concept of a new protocol that would allow the inspector to communicate with the Ember Vite app on the page.Changes in
ember.js
will require going through an RFC process though, and meanwhile, Vite users are stuck with a non-functional inspector.Changes
This PR proposes a temporary solution to have ember-inspector work for Vite apps:
ember.js
: aglobalThis.emberInspectorLoader.load()
that returns everything the inspector needs to know to show information about the page.@ember/enumerable/mutable
didn't exist yet, andEnumerableMutable
must be imported from another place.How to test
app-template
onhttp://localhost:4200/
mansona/ember-inspector
and switch to vite-support branchember-inspector
's README aboutpnpm serve:bookmarklet
to run the local inspector againsthttp://localhost:4200/