Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Beeq Vue): remove applyPolyfills() function #1055

Merged
merged 3 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
command: npx nx affected -t e2e --exclude='*,!tag:core' --parallel=3 --base=$NX_BASE --head=$NX_HEAD --ci --code-coverage --runInBand
- run:
name: 📚 Build Storybook
command: npx nx affected -t storybook-build --exclude='*,!tag:core' --parallel=3 --base=$NX_BASE --head=$NX_HEAD
command: npx nx run beeq:storybook-build --output-style=stream-without-prefixes
- run:
name: ⏹️ Stop Nx Cloud Agents
command: npx nx-cloud stop-all-agents
Expand Down
2 changes: 1 addition & 1 deletion packages/beeq-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"module": "dist/esm2015/index.js",
"types": "index.d.ts",
"dependencies": {
"@beeq/core": "^1.1.0",
"@beeq/core": "^1.3.2",
"tslib": "^2.6.2"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/beeq-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"module": "./src/index.js",
"types": "./src/index.d.ts",
"dependencies": {
"@beeq/core": "^1.1.0"
"@beeq/core": "^1.3.2"
},
"peerDependencies": {
"react": ">=18.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/beeq-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"main": "./src/index.js",
"types": "./src/index.d.ts",
"dependencies": {
"@beeq/core": "^1.1.0",
"tslib": "^2.3.0"
"@beeq/core": "^1.3.2",
"tslib": "^2.6.2"
},
"peerDependencies": {
"vue": ">=3.3.0"
Expand Down
34 changes: 16 additions & 18 deletions packages/beeq-vue/src/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
import { Plugin } from 'vue';
import { applyPolyfills, defineCustomElements } from '@beeq/core/dist/loader';
import { defineCustomElements } from '@beeq/core/dist/loader';

export const BeeqVue: Plugin = {
async install() {
applyPolyfills().then(() => {
// @stencil/vue-output-target does not support camelCase event names
// so we are attaching a custom event listener to map camelCase to kebab-case event names
const camelCaseToKebab = (str: string) => {
return str
.split(/(?=[A-Z])/)
.join('-')
.toLowerCase();
};
defineCustomElements(window, {
ael: (el: any, eventName: string, cb: any, opts: any) =>
el.addEventListener(camelCaseToKebab(eventName), cb, opts),
rel: (el: any, eventName: string, cb: any, opts: any) =>
el.removeEventListener(camelCaseToKebab(eventName), cb, opts),
ce: (eventName: string, opts: any) => new CustomEvent(camelCaseToKebab(eventName), opts),
} as any);
});
// @stencil/vue-output-target does not support camelCase event names
// so we are attaching a custom event listener to map camelCase to kebab-case event names
const camelCaseToKebab = (str: string) => {
return str
.split(/(?=[A-Z])/)
.join('-')
.toLowerCase();
};
defineCustomElements(window, {
ael: (el: any, eventName: string, cb: any, opts: any) =>
el.addEventListener(camelCaseToKebab(eventName), cb, opts),
rel: (el: any, eventName: string, cb: any, opts: any) =>
el.removeEventListener(camelCaseToKebab(eventName), cb, opts),
ce: (eventName: string, opts: any) => new CustomEvent(camelCaseToKebab(eventName), opts),
} as any);
},
};