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

[4.x] Dump visibility toggling, search, etc. #959

Merged
merged 1 commit into from
Oct 6, 2020
Merged

[4.x] Dump visibility toggling, search, etc. #959

merged 1 commit into from
Oct 6, 2020

Conversation

jasonvarga
Copy link
Contributor

This PR hooks up the var dumper JS so that the toggles and search work.

Implements #636

The most valuable part of this IMO is that if you dump an object, your page isn't full of completely expanded objects. (Try dumping app() a couple of times 😅 ) It's more consistent with what you'd see if you weren't using Telescope.

hNUVQ0

Since Vue can't execute JS that's sent from the server and injected through v-html, I've had to basically copy paste the var dumper JS.

There's only a handful of modifications:

  • Instead of Sfdump = window.Sfdump || (function (doc) {, I'm putting the function into a this.sfDump property on the Vue instance.
  • The quotes here have been replaced by JS template strings so it could compile.
  • Added a let before SearchState here to get around a ReferenceError: assignment to undeclared variable SearchState error.
  • Added let node; above this loop to get around a assignment to undeclared variable node error.
  • Instead of string replacing dynamic $options here, I've just hardcoded in the defaults.

@jasonvarga jasonvarga marked this pull request as ready for review October 5, 2020 23:32
@jasonvarga
Copy link
Contributor Author

It would be nice if StyleCI could ignore that sfdump file so we can keep it as close to the original as possible. I'll try to figure that out.

@driesvints driesvints changed the title Dump visibility toggling, search, etc. [4.x] Dump visibility toggling, search, etc. Oct 6, 2020
@taylorotwell taylorotwell merged commit cd6b43c into laravel:4.x Oct 6, 2020
@jasonvarga
Copy link
Contributor Author

Or not. Thanks!

@jasonvarga jasonvarga deleted the dump-js branch October 6, 2020 14:39
@driesvints
Copy link
Member

@jasonvarga think it's best that we keep all code style consistent.

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

Successfully merging this pull request may close these issues.

3 participants