diff --git a/README.md b/README.md index 41911950e..8c626ce8f 100644 --- a/README.md +++ b/README.md @@ -105,12 +105,19 @@ This requires a stateful helper by globally available to your app. Helpers are t stateless, so this would go against most guidance on helpers. +## Debugging and working with Resources + +_More information contained in the `docs` folder_. + +High-fidelity sourcemaps are provided in the original typescript. +However, you must be using embroider to take advantage of them. + + ## Related addons List of addons that use and wrap `ember-resources` to provide more specific functionality: - [ember-data-resources](https://github.com/NullVoxPopuli/ember-data-resources) - resources for reactive data fetching with ember-data -- [ember-array-map-resource](https://github.com/NullVoxPopuli/ember-array-map-resource) - provides a useArrayMap function which returns a resource that reactively maps data per-element, so that when the overall collection is dirtied, only the changed/new/removed elements affect the mapped collection - [ember-use-sound](https://github.com/chrismllr/ember-use-sound) - a resource for interacting with audio files ## Contributing diff --git a/ember-resources/config/rollup.config.js b/ember-resources/config/rollup.config.js index 67806b167..94e257723 100644 --- a/ember-resources/config/rollup.config.js +++ b/ember-resources/config/rollup.config.js @@ -3,6 +3,7 @@ import ts from 'rollup-plugin-ts'; import { Addon } from '@embroider/addon-dev/rollup'; import { defineConfig } from 'rollup'; import { summary } from '@nullvoxpopuli/rollup-bundle-summary'; +import { terser } from "rollup-plugin-terser"; const addon = new Addon({ srcDir: 'src', @@ -68,8 +69,14 @@ export default defineConfig({ // to leave alone and keep in the published output. // addon.keepAssets(['**/*.css']), + // Start with a clean output directory before building addon.clean(), + // Minify! + // This encourages addon devs to worry less about bundle size + // of this library when evaluating. + terser(), + // // output stats to the CLI during build summary(), ], diff --git a/ember-resources/package.json b/ember-resources/package.json index 48e053d44..9f552650d 100644 --- a/ember-resources/package.json +++ b/ember-resources/package.json @@ -109,6 +109,7 @@ "eslint-plugin-simple-import-sort": "^7.0.0", "npm-run-all": "4.1.5", "rollup": "2.70.1", + "rollup-plugin-terser": "^7.0.2", "rollup-plugin-ts": "^2.0.5", "semantic-release": "^19.0.2", "tslib": "^2.3.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3d48bc91c..158f38eee 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -91,6 +91,7 @@ importers: eslint-plugin-simple-import-sort: ^7.0.0 npm-run-all: 4.1.5 rollup: 2.70.1 + rollup-plugin-terser: ^7.0.2 rollup-plugin-ts: ^2.0.5 semantic-release: ^19.0.2 tslib: ^2.3.1 @@ -132,6 +133,7 @@ importers: eslint-plugin-simple-import-sort: 7.0.0_eslint@7.32.0 npm-run-all: 4.1.5 rollup: 2.70.1 + rollup-plugin-terser: 7.0.2_rollup@2.70.1 rollup-plugin-ts: 2.0.5_342c92a793a50d536fa938bf4ab8f880 semantic-release: 19.0.2 tslib: 2.3.1 @@ -12379,6 +12381,15 @@ packages: engines: {node: '>= 0.6.0'} dev: true + /jest-worker/26.6.2: + resolution: {integrity: sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==} + engines: {node: '>= 10.13.0'} + dependencies: + '@types/node': 17.0.21 + merge-stream: 2.0.0 + supports-color: 7.2.0 + dev: true + /jest-worker/27.5.1: resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} engines: {node: '>= 10.13.0'} @@ -15064,6 +15075,18 @@ packages: del: 5.1.0 dev: true + /rollup-plugin-terser/7.0.2_rollup@2.70.1: + resolution: {integrity: sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==} + peerDependencies: + rollup: ^2.0.0 + dependencies: + '@babel/code-frame': 7.16.7 + jest-worker: 26.6.2 + rollup: 2.70.1 + serialize-javascript: 4.0.0 + terser: 5.11.0 + dev: true + /rollup-plugin-ts/2.0.5_342c92a793a50d536fa938bf4ab8f880: resolution: {integrity: sha512-yLfu46XsheAEDs+OxCMnHszble9pYwGYDML82lpMw3x/65kgwd9UQSkPX0HZGk+6L+MN8hFgqeh+SPmv+uOz1w==} engines: {node: '>=10.0.0', npm: '>=7.0.0', pnpm: '>=3.2.0', yarn: '>=1.13'}