Граф коммитов

39 Коммитов

Автор SHA1 Сообщение Дата
Daniel LaLiberte 0ec2ef42e8
Move all *-css.js files to new client-src/css dir. (#2999)
* Move all -css.js files to new client-src/css dir.

* Fix gulp for js, and resume clean task without 'static/css'
2023-05-10 13:34:35 -04:00
Daniel LaLiberte 116a7f4d48
Stop using scss compiler, and use css files directly. (#2998)
* Stop using scss compiler, and use css files directly.

* Deleting unused static/css files.

* Update developer docs.
2023-05-10 12:24:24 -04:00
James C Scott III 4a2f9f6a75
Manual changes to support using openapi [3/5] (#2771)
* Manual changes to support using openapi

.devcontainer/Dockerfile
- Install java in devcontainer

.devcontainer/devcontainer.json
- Make devcontainer automatically install VSCode OpenAPI plugin mentioned in #2769
- Make devcontainer automatically install VSCode plugin for Lit

client-src/elements/chromedash-app.js
- Use the generated client in the frontend.
- Leverage lit-labs/context to provide the client.
  - Docs about context and use-cases: https://lit.dev/docs/data/context/

client-src/elements/chromedash-app_test.js
- Add tests for the changes in client-src/elements/chromedash-app.js

client-src/contexts/openapi-context.js
- Declare a context for the openapi client.

framework/basehandlers.py
- add do_put function. previously, all other HTTP verbs had a `do_<verb>` version except PUT.
- Add put function that uses defensive_jsonify. This enables XSSI for PUT requests.
  - This needed change is safe to do because the only route using PUT is the admin/blink page which I am migrating into the SPA.

gulpfile.babel.js
- Fix usage of rollupBabel. Previously, @rollup/plugin-node-resolve's default export was named rollupBabel. Which is the wrong package. Fixed to use @rollup/plugin-babel
- Using the correct parameters to rollupBabel from https://www.npmjs.com/package/@rollup/plugin-babel
- Add client-src/contexts/*.js to lint and watch targets
- Add custom onwarn for rollup that comes from using the generated frontend code. Check comment for explanation

package.json
- Add lit-labs/context. Needed for changes in client-src/contexts/openapi-context.js
- Tell NPM to use the generated javascript changes via the `workspaces` key.
  - Instead of adding as a dependency like [I initially did here](ccd5c8e71b (diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R101)), rather keep the "dependencies" only for ones pulled from npm remotely.
  - workspaces are meant more for packages that comes from the filesystem
  - Docs: https://docs.npmjs.com/cli/v9/using-npm/workspaces?v=true

requirements.txt
- Tell pip to install the python package.

package-lock.json
- Generated changes from adding context and workspaces.

* revert accidental Werkzeug upgrade

* fix devcontainer

* Remove context & failed attempt at global

changes:
- Remove the context
- Move the openapi client to js-src
- modify gulp task to:
  - ignore the test file
  - add the openapi-client to the rollup task instead of the js task since it is a es6 module (because it has an import / require statement)
- Attempt to construct the object in the spa template. It failed to work at load time. More details below:

When trying to call my exported class at page load like the regular client, I get a not defined error.
There are thoughts about this:
- https://stackoverflow.com/a/75026222
- https://stackoverflow.com/a/53630402
- https://stackoverflow.com/a/69888825

This commit serves as an attempt to try it out

Turns out, script type "module" is automatically set to defer and cannot be disabled.

* add new rollup for cjs for openapi client

* add more tests

* fix middleware
2023-03-24 17:46:28 -04:00
James C Scott III d942cb0ccf
Node v18. Upgrade frontend dependencies and resolve vulns (#2380)
* Migrate from node 12 to node 18

* update all packages from npm outdated

* next round of updates

* fix most vulnerabilities

* remaining vulnerabilites

* remove unused dependencies
2022-10-25 10:12:23 -04:00
James C Scott III dd652c9cdb
Move source for generated frontend to client-src (#2351) 2022-10-17 17:01:12 -04:00
Daniel Smith 277bd208f9
turn off mangle names (#2049) 2022-07-20 09:42:20 -07:00
Daniel LaLiberte 6f044764f9
Add shoelace and gulp-concat. Replace process-overview dialog with shoelace dialog (#1842)
* Remove python2 scripts. Add `npm stop`.

* Add py2 scripts back in.

* Add dialog before drafting email

* Fix computation of prerequests.

* Fix broken "Edit fields" button by removing it.

* Move the item_stage_map setup to willUpdate.

* Add shoelace, and gulp-concat.  Replace dialog in process-overview with shoelace dialog.
2022-04-18 14:57:57 -04:00
Jason Robbins 53a92edd2b
Remove service worker (#936)
* Remove service worker

* Remove remaining CSS related to a2hs button

Co-authored-by: Jason Robbins <jrobbins@chromium.org>
2020-07-29 14:33:27 -07:00
Yangguang a448e6f9bf Using rollup for components (#679)
* Import lit-virtualizer

* misc

* Add rollup and add it to gulp task

* Update gulp

* Downgrade paper-toggle-button to input checkbox

* Include all css to lit-elements

* Add rollup minify. Remove unused packages.

* Fix code review feedback

* Fixes based on code review.

* Remove two unnecessary .call(this, ...)

* Bind _onFeatureToggled (used inside lit-virtualizer) in the constructor

* Add lit-analyzer

* Update lit-analyzer script
2019-11-11 14:32:32 -08:00
Yangguang Li 48dba824e1 Separte lint and lint-fix 2019-07-01 15:11:08 -07:00
Yangguang Li 07fd72e47a Update lint fix 2019-07-01 14:28:54 -07:00
Yangguang Li 3f3c580707 Add fix lint 2019-06-27 13:52:25 -07:00
Yangguang Li 51fa25ac8a Finish samples 2019-06-24 15:23:23 -07:00
Yangguang Li 3fd617fe66 Update the gulp watch and remote a wrapper element 2019-06-19 13:39:39 -07:00
Yangguang Li 830872e4ff Add gulp watch 2019-05-22 11:51:38 -07:00
Yangguang Li 7196301568 WIP 2019-05-22 11:13:09 -07:00
Yangguang Li 242d0e428b WIP - finished first run of migration. 2019-04-24 13:24:40 -07:00
Eric Bidelman 23e78af1ca Modernize deps. Gulp4 2018-06-04 14:56:45 -07:00
Eric Bidelman 64d59d012e Add to homescreen 2018-01-25 22:30:58 +11:00
Eric Bidelman 3033fdcefb Service worker: cache new features_v2.json endpoint 2017-12-07 15:56:24 -08:00
Eric Bidelman 9e3505b51a Use sw-toolbox "fastest" for all endpoints to combate liefi (#423) 2016-10-11 13:24:32 -07:00
Eric Bidelman 720e963bd0 Trim down what is precached. Also inline resources on other pages 2016-08-11 11:09:13 -07:00
Eric Bidelman db3e5f66a8 Preload, babel support, metrics/user timing lib 2016-08-05 17:59:09 -07:00
Jason Chase e40cc67c92 Merge branch 'master' into service-worker 2016-07-25 21:54:52 -04:00
Jason Chase e5516f7a5c Add more vulcanized files to sw precache 2016-07-22 17:12:15 -04:00
Jason Chase a96f5e37ef Merge branch 'master' into service-worker 2016-07-22 16:48:46 -04:00
Jason Chase e239fb098c Update service worker caching
* Vulcanized imports are now pre-cached (except for the admin pages)

* Runtime caching for features, samples, and metrics pages

* Runtime caching for the data to support the above pages
2016-07-22 16:27:37 -04:00
Eric Bidelman 7b6e26b2a2 Vulcanize minifies js out. Remove script task for now 2016-07-22 12:04:50 -07:00
Eric Bidelman daffc6810f Remove paper-dialog usage. CSS is smaller 2016-07-21 22:11:42 -07:00
Jason Chase c8ff83ba26 Remove unused elements.html
* This file collects all the imports into one file, but is not used anywhere
2016-07-21 19:05:56 -04:00
Eric Bidelman d9c4c5c503 Minimize vulcanize html/css/js output and lazy load ui components 2016-07-21 14:28:41 -07:00
Jason Chase d858fc6d8d Tweaks to runtime caching 2016-07-21 00:07:58 -04:00
Jason Chase 33f263dd97 Allow features page to work offline
* Add runtime caching of various assets and data to be provided by service worker
2016-07-20 17:42:34 -04:00
Jason Chase bf8550daea Add Gulp task to generate service worker
* Use sw-precache to generate a service worker script to cache static resources

* Generated/included scripts are put into a `dist` directory, ignored by source control
2016-07-20 17:41:23 -04:00
Eric Bidelman 9a11afebce Merge pull request #355 from GoogleChrome/css
Slim css
2016-07-20 14:30:52 -07:00
Eric Bidelman f4c13a098e Remove css/ on gulp clean 2016-07-20 14:04:00 -07:00
Eric Bidelman 0f59a8d8f6 Remove vendor prefixes now that theyre handled by autoprefixer 2016-07-20 14:00:17 -07:00
Eric Bidelman 5ddb065937 Use gulp eslint (#354) 2016-07-20 13:56:27 -07:00
Jason Chase 07f5c5b687 Use Gulp for build instead of Grunt (#349)
* Add initial support for Gulp

* Implement clean task to match Grunt behaviour

* Copy from Gulp implementation in Web Starter Kit 0.6.4

* Implement sass task using Gulp

* Implement vulcanize task using Gulp

* Implement Gulp task to minify scripts

* Simplify the Gulp vulcanize task

* Implement Gulp default task to match Grunt behaviour

* Change to use Gulp for build/post install

* Cleanup obsolete Grunt tasks and config

* Grunt is still used for serve task (for now)

* Remove unused Gulp tasks

* Clean up tasks that are not needed, which were copied from
  the Web Starter Kit
* Leaving the service worker tasks, as expect those to be used

* Address comments

* Address more comments

* Enable autoprefixer for CSS

* Remove unused tasks
2016-07-20 12:49:10 -07:00