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

Discard <head> elements position #79

Closed
dhuf opened this issue Sep 24, 2019 · 2 comments
Closed

Discard <head> elements position #79

dhuf opened this issue Sep 24, 2019 · 2 comments

Comments

@dhuf
Copy link
Contributor

dhuf commented Sep 24, 2019

After a CMS Upgrade the position of the elements is not the same in tag.
Some opengraph entries moved for example.

@cleaver
Copy link
Contributor

cleaver commented May 22, 2020

At the core, Sitediff relies on the Diffy gem, which in-turn relies on the native diff utility. This means it would take a fundamentally different approach to how we do diffs. I'll post a couple of ideas later for the record.

There's so much going on in the that I just ignore it. We deal with aggregated CSS and JS, so that's going to be different every time. Most CMSs will have cachebusting strategies for assets as well.

To run the diff on a subset of the markup:

before:
  url: http://before.example.com
  selector: 'body'

after:
  url: http://after.example.com
  selector: 'body'

The selector could reference a

or other element if you want to be even more specific.

@cleaver
Copy link
Contributor

cleaver commented May 22, 2020

A couple of ideas for the record, then I'll close this.

  1. Parse the DOM into an abstract syntax tree and do the comparison on that. This would mean using a completely different diff strategy. Big change.

  2. Pipe the HTML through a formatter or pretty-printer before running the diff.

These don't even address some of the issues we've been facing when doing major version CMS upgrades. The DOM can have major structural changes.

I'll close this for now, but if you have any further issues or questions, please feel free to reopen.

@cleaver cleaver closed this as completed May 22, 2020
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

No branches or pull requests

2 participants