Giter Site home page Giter Site logo

v2 Idea Collection about gimbal HOT 8 OPEN

mitchellsimoens avatar mitchellsimoens commented on June 11, 2024
v2 Idea Collection

from gimbal.

Comments (8)

mitchellsimoens avatar mitchellsimoens commented on June 11, 2024

v1 uses a static server to host the build of the application. This is a great option till you get into more complex scenarios. Client project I'm on right now has some calls to the server made at the start of an application but these will fail because there is no server. I need a way for my CI process to startup the backend and frontend and gimbal be able to run audits against a URL I pass to gimbal.

In the same vein, it'd be great if the browser audits could be run on any remote web site. Not saying this is how it should work but running gimbal --url github.com should run browser audits against github.com. There are some audits that wouldn't run like the size and source map explorer since they are run against local files and that's fine.

from gimbal.

mitchellsimoens avatar mitchellsimoens commented on June 11, 2024

I love the config file but as things have changed, the format of the config file is weird and should be looked at.

For example, the builtin audits, to set thresholds you put them in the configs object but then you can set which audits you want in the separate audits array. This is an example:

audits:
  - size

configs:
  size:
    thresholds:
      foo.js: 1 KB

This isn't necessarily bad but when we added plugins, you set the threshold for that plugin within that plugin object like so:

audits:
  - axe

plugins:
  - plugin: '@modus/gimbal-plugin-axe'
    thresholds:
      bypass: serious

Once again, this isn't bad but it made me think, should we do the same thing we are doing in the plugins object in the audits array (or make audits an object):

audits:
  axe:
    thresholds:
      bypass: serious
  size:
    thresholds:
      foo.js: 1 KB

plugins can still have objects since they may have options (and the ones we supply do) but thresholds seem to go better in the audits and it's one place for them.

from gimbal.

mitchellsimoens avatar mitchellsimoens commented on June 11, 2024

We need to replace commander with something else like minimist since commander doesn't support async command actions. Plus we were executing other things outside of commander so it'd be great to just handle everything ourselves and with something more suited to be a cli option parser like minimist. Commander seems to overweight for our use now.

Need to also think that plugins can create their own command and options that we need to manage also.

from gimbal.

mitchellsimoens avatar mitchellsimoens commented on June 11, 2024

Should move to a manager for CI/VCS so that plugins could add their own in. It's fine to have Gimbal support the popular ones but there are some out there that we either don't have the time to add or don't know about and should let anyone add their own support in.

from gimbal.

mitchellsimoens avatar mitchellsimoens commented on June 11, 2024

We can programmatically call gimbal since it's just JavaScript in the end. It'd be great to allow gimbal to be executed from test runners, have each call cache their results and at the end reconcile all these results to give a final report. Most of this is already worked out including the reconciliation but caching results and running gimbal using a URL or a puppeteer page instance needs to be thought of.

This would get us around any auth issues since the tests themselves would handle that, we'd just run on a page provided by the test runner.

from gimbal.

mitchellsimoens avatar mitchellsimoens commented on June 11, 2024

Thresholds can be a pain. Need to come up with something that can fail a gimbal run but not be as big of a hassle as thresholds can be.

Maybe have ranges:

  • good = 0-5KB
  • warning = 5KB-20KB
  • error = 20KB+

Having a warning range could alert something is growing but not fail the build.

from gimbal.

mitchellsimoens avatar mitchellsimoens commented on June 11, 2024

The build directory defaults to build which is great and easy to override but by default, let's have an array of common build directories and first one that actually exists is used... unless provided. So in code:

const possibleBuildDirs = ['build', 'dist'];
let buildDir = options.buildDir;

if (!buildDir) {
  buildDir = possibleBuildDirs.find(dir => fs.existSync(path.resolve(cwd, dir)));
}

This may make default running on different projects a bit more friendly (one less thing maybe).

from gimbal.

mitchellsimoens avatar mitchellsimoens commented on June 11, 2024

There was a bus concept in v1 so that the plugins installed locally can get same instances of things that gimbal (that may not be installed locally, could be globally) uses. Maybe instead, we have a full class instance that gets passed to the plugin to handle more.

from gimbal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.