From 36e824626454ecb7869b212d0cb69e92937074ff Mon Sep 17 00:00:00 2001 From: Luke Dawkes Date: Mon, 8 Apr 2019 13:18:48 +0100 Subject: [PATCH 1/7] fix(typescript): replaced invalid `mixed` keyword with `any` (fixes #3041) (#3043) * fix(typescript): Replaced invalid 'mixed' keyword with 'any' * Remove semicolons from index.d.ts --- src/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.d.ts b/src/index.d.ts index de6e0e92998..28f1c10e201 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -25,7 +25,7 @@ declare module 'bootstrap-vue' { | 'light' | 'dark' type SortDirection = 'asc' | 'desc' | 'last' - type FormatterCallback = ((value: mixed, key: string, item: mixed) => any) + type FormatterCallback = ((value: any, key: string, item: any) => any) export interface TableField { label?: string @@ -37,9 +37,9 @@ declare module 'bootstrap-vue' { sortDirection?: SortDirection tdClass?: string | string[] | FormatterCallback thClass?: string | string[] - thStyle?: mixed + thStyle?: any variant?: TableVariant | string - tdAttr?: mixed | ((value: mixed, key: string, item: mixed) => mixed) + tdAttr?: any | ((value: any, key: string, item: any) => any) isRowHeader?: boolean } export interface TableFieldObject { From 92809b36afbf5262c46db71323c7c14162172223 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Mon, 8 Apr 2019 10:45:46 -0300 Subject: [PATCH 2/7] chore(deps): update dependency vue-router to ^3.0.3 (#3045) --- package.json | 2 +- yarn.lock | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index bd885e802f9..ed5eea2cd2c 100644 --- a/package.json +++ b/package.json @@ -129,7 +129,7 @@ "terser": "^3.17.0", "vue": "^2.6.10", "vue-jest": "^3.0.4", - "vue-router": "^3.0.2", + "vue-router": "^3.0.3", "vue-server-renderer": "^2.6.10", "vue-template-compiler": "^2.6.10" }, diff --git a/yarn.lock b/yarn.lock index 0eec3048de7..10a8eab6cf0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11353,6 +11353,11 @@ vue-router@^3.0.2: resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.0.2.tgz#dedc67afe6c4e2bc25682c8b1c2a8c0d7c7e56be" integrity sha512-opKtsxjp9eOcFWdp6xLQPLmRGgfM932Tl56U9chYTnoWqKxQ8M20N7AkdEbM5beUh6wICoFGYugAX9vQjyJLFg== +vue-router@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.0.3.tgz#370ca607475c45a1cfab2d9d2ac846feab1c534c" + integrity sha512-62rB6GjJuyklnLL+yKST469yCYj93SXEn8rpYjxgLwv0aH/Fd6OApD8Hgi9RlraZ1OOwv3jPQvZTtf1GixYW+g== + vue-server-renderer@^2.6.10: version "2.6.10" resolved "https://registry.yarnpkg.com/vue-server-renderer/-/vue-server-renderer-2.6.10.tgz#cb2558842ead360ae2ec1f3719b75564a805b375" From 4e981c2a4174197983477526a78564114e728ad6 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Mon, 8 Apr 2019 21:03:46 +0430 Subject: [PATCH 3/7] fix(build): enable babel option to interop default (fixes #3038) (#3046) fixes #3038 --- babel.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/babel.config.js b/babel.config.js index 5fd6a01bb25..4b86e2e3f18 100644 --- a/babel.config.js +++ b/babel.config.js @@ -10,7 +10,7 @@ module.exports = api => { presets, env: { es: { - plugins: [['@babel/plugin-transform-modules-commonjs', { noInterop: true, loose: true }]] + plugins: [['@babel/plugin-transform-modules-commonjs', { loose: true }]] }, test: { presets: [['@babel/env', { targets: { node: 'current' } }]] From 8022481c302d77aede311c88707fd8742a152eed Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Mon, 8 Apr 2019 23:21:45 +0430 Subject: [PATCH 4/7] feat(nuxt): add `usePretranspiled` option (#3048) --- docs/markdown/intro/README.md | 10 +++++++++- nuxt/index.js | 9 +++++++-- nuxt/plugin.template.js | 8 ++++---- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/docs/markdown/intro/README.md b/docs/markdown/intro/README.md index d9e0fffa634..919ea6aea4a 100644 --- a/docs/markdown/intro/README.md +++ b/docs/markdown/intro/README.md @@ -56,7 +56,7 @@ _after_ Bootstrap SCSS to ensure variables are set up correctly. **Note**: _Requires webpack configuration to load CSS/SCSS files ([official guide](https://webpack.js.org/guides/asset-management/#loading-css))_. -## Nuxt.js plugin module +## Nuxt.js Module [Nuxt.js](https://nuxtjs.org) version {{ nuxtVersion }} (or greater) is recommended. @@ -153,6 +153,14 @@ module.exports = { } ``` +### Using pretranspiled version of BootstrapVue for Nuxt.js + +Nuxt module uses precompiled version of BootstrapVue for faster development builds and source of +BootstrapVue for higher quality production builds. + +You can override this option using `usePretranspiled` option. Setting to `true` uses `es/` instead +of `src/`. By default is enabled for development mode only. + ## Vue CLI 2 BootstrapVue has two Vue CLI templates available: diff --git a/nuxt/index.js b/nuxt/index.js index 735e7233a07..db9fd311f78 100644 --- a/nuxt/index.js +++ b/nuxt/index.js @@ -47,10 +47,15 @@ module.exports = function nuxtBootstrapVue(moduleOptions = {}) { this.options.css.unshift('bootstrap/dist/css/bootstrap.css') } - // Transpile src + // Transpile src/ this.options.build.transpile.push('bootstrap-vue/src') - const templateOptions = {} + // Use es/ or src/ + const usePretranspiled = pickFirst(options.usePretranspiled, this.options.dev) + + const templateOptions = { + dist: usePretranspiled ? 'es' : 'src' + } // TODO: Also add support for individual components & directives for (const type of ['componentPlugins', 'directivePlugins']) { diff --git a/nuxt/plugin.template.js b/nuxt/plugin.template.js index 4b5b4123f51..db2a857fae9 100644 --- a/nuxt/plugin.template.js +++ b/nuxt/plugin.template.js @@ -1,10 +1,10 @@ import Vue from 'vue' <% if (options.componentPlugins.length || options.directivePlugins.length) { %><%= -options.componentPlugins.reduce((acc, p) => (acc += `import ${p[0]} from 'bootstrap-vue/es/components/${p[1]}'\n` ), '') %><%= -options.directivePlugins.reduce((acc, p) => (acc += `import ${p[0]} from 'bootstrap-vue/es/directives/${p[1]}'\n` ), '') %> +options.componentPlugins.reduce((acc, p) => (acc += `import ${p[0]} from 'bootstrap-vue/${options.dist}/components/${p[1]}'\n` ), '') %><%= +options.directivePlugins.reduce((acc, p) => (acc += `import ${p[0]} from 'bootstrap-vue/${options.dist}/directives/${p[1]}'\n` ), '') %> <% if (options.config) { %> -import BVConfigPlugin from 'bootstrap-vue/es/bv-config' +import BVConfigPlugin from 'bootstrap-vue/<%= options.dist %>/bv-config' Vue.use(BVConfigPlugin, <%= JSON.stringify(options.config, undefined, 2) %>) <% } %> @@ -13,7 +13,7 @@ Vue.use(BVConfigPlugin, <%= JSON.stringify(options.config, undefined, 2) %>) options.componentPlugins.reduce((acc, p) => (acc += `Vue.use(${p[0]})\n` ), '') %><%= options.directivePlugins.reduce((acc, p) => (acc += `Vue.use(${p[0]})\n` ), '') %> <% } else { %> -import BootstrapVue from 'bootstrap-vue/es' +import BootstrapVue from 'bootstrap-vue/<%= options.dist %>' Vue.use(BootstrapVue, <%= JSON.stringify(options.config || {}, undefined, 2) %>) <% } %> From 154feea4daef094b96970e5b6926332e2c84b1fc Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Mon, 8 Apr 2019 15:55:39 -0300 Subject: [PATCH 5/7] chore(build): cleanup build files (#3039) --- scripts/build.sh | 2 +- scripts/rollup.config.esm.js | 34 ---------------------------------- scripts/rollup.config.js | 8 ++++---- 3 files changed, 5 insertions(+), 39 deletions(-) delete mode 100644 scripts/rollup.config.esm.js diff --git a/scripts/build.sh b/scripts/build.sh index 1f37445d86c..fe5b4e53775 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -15,7 +15,7 @@ echo 'Done.' echo '' echo 'Build ES modules...' -NODE_ENV=es babel src --out-dir es --ignore 'src/**/*/fixtures,src/**/*.spec.js' +NODE_ENV=es babel src --out-dir es --ignore 'src/**/*.spec.js' echo 'Done.' echo '' diff --git a/scripts/rollup.config.esm.js b/scripts/rollup.config.esm.js deleted file mode 100644 index 8d398854917..00000000000 --- a/scripts/rollup.config.esm.js +++ /dev/null @@ -1,34 +0,0 @@ -import fs from 'fs' -import path from 'path' -import babel from 'rollup-plugin-babel' -import resolve from 'rollup-plugin-node-resolve' -import commonjs from 'rollup-plugin-commonjs' -import css from 'rollup-plugin-css-porter' -import { name, dependencies } from '../package.json' - -const base = path.resolve(__dirname, '..') -const src = path.resolve(base, 'src') -const dist = path.resolve(base, 'dist') - -// Ensure dist directory exists -if (!fs.existsSync(dist)) { - fs.mkdirSync(dist) -} - -export default { - input: path.resolve(src, 'index.js'), - external: Object.keys(dependencies), - plugins: [ - css({ dest: path.resolve(dist, `${name}.css`) }), - resolve({ external: ['vue'] }), - commonjs(), - babel() - ], - output: [ - { - format: 'es', - file: path.resolve(dist, `${name}.esm.js`), - sourcemap: true - } - ] -} diff --git a/scripts/rollup.config.js b/scripts/rollup.config.js index 18d6ae82999..2b79ab515e5 100644 --- a/scripts/rollup.config.js +++ b/scripts/rollup.config.js @@ -14,13 +14,14 @@ const externals = ['vue', ...Object.keys(dependencies)] // Libs in `external` will not be bundled to dist, // since they are expected to be provided later. -// We want to include some of them in the build, so we exclude it here. +// In some cases, wee want to include some of them in the build, so we +// exclude the external here. const externalExcludes = ['popper.js', 'vue-functional-data-merge'] // The base rollup configuration const baseConfig = { input: path.resolve(src, 'index.js'), - external: Object.keys(dependencies), + external: externals, plugins: [resolve({ external: ['vue'] }), commonjs(), babel({ exclude: 'node_modules/**' })] } @@ -57,10 +58,9 @@ export default [ } }, - // ES + // ESM { ...baseConfig, - external: ['vue'], output: { format: 'es', file: path.resolve(dist, `${name}.esm.js`), From 6aab90f4b5d445f2d756424322cbfdc8a6058706 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Mon, 8 Apr 2019 16:32:49 -0300 Subject: [PATCH 6/7] chore: bump version (#3050) --- CHANGELOG.md | 23 +++++++++++++++++++++++ package.json | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c503a3cd42e..55b64704c81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,29 @@ > [standard-version](https://github.com/conventional-changelog/standard-version) for commit > guidelines. + + +## [v2.0.0-rc.18](https://github.com/bootstrap-vue/bootstrap-vue/compare/v2.0.0-rc.17...v2.0.0-rc.18) + +Released 2019-04-08 + +### Bug Fixes v2.0.0-rc.18 + +- **build:** enable babel option to interop default (fixes + [#3038](https://github.com/bootstrap-vue/bootstrap-vue/issues/3038)) + ([#3046](https://github.com/bootstrap-vue/bootstrap-vue/issues/3046)) + ([4e981c2](https://github.com/bootstrap-vue/bootstrap-vue/commit/4e981c2)) +- **typescript:** replaced invalid `mixed` keyword with `any` (fixes + [#3041](https://github.com/bootstrap-vue/bootstrap-vue/issues/3041)) + ([#3043](https://github.com/bootstrap-vue/bootstrap-vue/issues/3043)) + ([36e8246](https://github.com/bootstrap-vue/bootstrap-vue/commit/36e8246)) + +### Features v2.0.0-rc.18 + +- **nuxt:** add `usePretranspiled` option + ([#3048](https://github.com/bootstrap-vue/bootstrap-vue/issues/3048)) + ([8022481](https://github.com/bootstrap-vue/bootstrap-vue/commit/8022481)) + ## [v2.0.0-rc.17](https://github.com/bootstrap-vue/bootstrap-vue/compare/v2.0.0-rc.16...v2.0.0-rc.17) diff --git a/package.json b/package.json index ed5eea2cd2c..3a1b8d3cee0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bootstrap-vue", - "version": "2.0.0-rc.17", + "version": "2.0.0-rc.18", "description": "BootstrapVue provides one of the most comprehensive implementations of Bootstrap 4 components and grid system for Vue.js and with extensive and automated WAI-ARIA accessibility markup.", "main": "dist/bootstrap-vue.common.js", "types": "src/index.d.ts", From ba78e40a3812a531b7fca8e6bfdb8032c5960e3a Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Mon, 8 Apr 2019 16:57:20 -0300 Subject: [PATCH 7/7] chore: update CHANGELOG.md (#3051) --- CHANGELOG.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55b64704c81..2f6d0c633a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,19 +13,19 @@ Released 2019-04-08 ### Bug Fixes v2.0.0-rc.18 - **build:** enable babel option to interop default (fixes - [#3038](https://github.com/bootstrap-vue/bootstrap-vue/issues/3038)) - ([#3046](https://github.com/bootstrap-vue/bootstrap-vue/issues/3046)) - ([4e981c2](https://github.com/bootstrap-vue/bootstrap-vue/commit/4e981c2)) + [#3038](https://github.com/bootstrap-vue/bootstrap-vue/issues/3038)) + ([#3046](https://github.com/bootstrap-vue/bootstrap-vue/issues/3046) + [4e981c2](https://github.com/bootstrap-vue/bootstrap-vue/commit/4e981c2)) - **typescript:** replaced invalid `mixed` keyword with `any` (fixes - [#3041](https://github.com/bootstrap-vue/bootstrap-vue/issues/3041)) - ([#3043](https://github.com/bootstrap-vue/bootstrap-vue/issues/3043)) - ([36e8246](https://github.com/bootstrap-vue/bootstrap-vue/commit/36e8246)) + [#3041](https://github.com/bootstrap-vue/bootstrap-vue/issues/3041)) + ([#3043](https://github.com/bootstrap-vue/bootstrap-vue/issues/3043) + [36e8246](https://github.com/bootstrap-vue/bootstrap-vue/commit/36e8246)) ### Features v2.0.0-rc.18 - **nuxt:** add `usePretranspiled` option - ([#3048](https://github.com/bootstrap-vue/bootstrap-vue/issues/3048)) - ([8022481](https://github.com/bootstrap-vue/bootstrap-vue/commit/8022481)) + ([#3048](https://github.com/bootstrap-vue/bootstrap-vue/issues/3048) + [8022481](https://github.com/bootstrap-vue/bootstrap-vue/commit/8022481))