Skip to content
This repository was archived by the owner on Jul 22, 2020. It is now read-only.

Comments

Jest & webpack#150

Merged
prymitive merged 79 commits intomasterfrom
jest
Aug 4, 2017
Merged

Jest & webpack#150
prymitive merged 79 commits intomasterfrom
jest

Conversation

@prymitive
Copy link
Contributor

This PR:

  • rewrites all JS files as CommonJS modules (no real code changes)
  • adds jest tests so we finally have a framework & most basic test coverage for JS files
  • adds webpack so all JS files are vendored and managed via npm (needed since browsers can't load CommonJS modules yet)

Benefits:

  • tests for JS
  • proper asset management for JS/CSS (no more curl cdnjs from a Makefile)
  • webpack allows to transform ES6 modules to ES5 on the fly, so no more issues like "Internal error TypeError Alerts is undefined" #143, all modules should have the same browser compatibility

The ugly side:

  • more tooling around (but also less manual work)
  • slower builds (more to do)
  • slower tests (more to do)

This will tell webpack to add a hash to all bundles filenames, we generate script tags for loading those and inject them as templates. No more forced cache bypassing
we don't use moment locale and prefetch will speed up bundle generation
So we don't need to download everything on every CI run
@prymitive prymitive requested review from jamesog and mattbostock July 30, 2017 00:44
Checks whenever code does what it suppose to, not only if it runs
This will allow to test entire alerts flow - get alerts.json response (via mocks) and render alerts
Copy link

@Tenzer Tenzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

YOLO approval due to PR size.

@prymitive
Copy link
Contributor Author

This is waiting on @terinjokes to finish review

Copy link

@terinjokes terinjokes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got bored partway through this.


go_import_path: github.com/cloudflare/unsee

# install jshint & eslint, it's used for linting js files (needs nodejs)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may consider using Travis Build Stages to run lint tests separately from unit tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider I shall

@prymitive prymitive merged commit 5773ab2 into master Aug 4, 2017
@prymitive prymitive deleted the jest branch August 4, 2017 23:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants