-
Notifications
You must be signed in to change notification settings - Fork 23
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
Update svelte config to compile web components and svelte components #234
Changes from all commits
6f0c583
0e577ea
8beb397
bd1cb6d
e857f64
73a55e6
645384b
88b885d
3c952b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default function setShadowStyle(host: any, styleContent: string): void { | ||
const style = document.createElement("style"); | ||
style.innerHTML = styleContent; | ||
host.shadowRoot.appendChild(style); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would probably be helpful to leave a comment or link to the comment that suggested this workaround. It seems like in order to retain the functionality of svelte components, we have to lose the scoped component styles feature. Since this change seems to be more permanent (I don't see interest from svelte team to fix this in the near future) it'd be nice to hear thoughts from the rest of the team. Essentially, I think this means:
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
import config, { svelteConfig } from "../../rollup.common.config"; | ||
import svelte from "rollup-plugin-svelte"; | ||
import config, { | ||
svelteWebComponentsConfig, | ||
svelteComponentsConfig, | ||
} from "../../rollup.common.config"; | ||
|
||
config.plugins.unshift( | ||
svelte({ | ||
...svelteConfig, | ||
}), | ||
); | ||
config.plugins.unshift(svelteWebComponentsConfig, svelteComponentsConfig); | ||
|
||
export default { ...config, input: "src/main.ts" }; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
getEventDispatcher, | ||
} from "@commons/methods/component"; | ||
import type { EventPosition } from "./methods/position"; | ||
import NError from "@commons/components/NError.svelte"; | ||
import { populatePositionMap, updateEventPosition } from "./methods/position"; | ||
import { getDynamicEndTime, getDynamicStartTime } from "./methods/time"; | ||
import type { AgendaProperties } from "@commons/types/Nylas"; | ||
|
@@ -1313,7 +1314,7 @@ | |
} | ||
</style> | ||
|
||
<nylas-error {id} /> | ||
<NError {id} /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Imported |
||
|
||
{#if themeUrl} | ||
<link rel="stylesheet" href={themeUrl} /> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import "@commons/define-component-patch"; | ||
import Agenda from "./Agenda.svelte"; | ||
import agenda from "./agenda.svelte"; | ||
|
||
export default Agenda; | ||
export default agenda; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import config, { svelteConfig } from "../../rollup.common.config"; | ||
import svelte from "rollup-plugin-svelte"; | ||
import config, { | ||
svelteWebComponentsConfig, | ||
svelteComponentsConfig, | ||
} from "../../rollup.common.config"; | ||
import svelteSVG from "rollup-plugin-svelte-svg"; | ||
|
||
config.plugins.unshift(svelteSVG()); | ||
|
||
config.plugins.unshift( | ||
svelte({ | ||
...svelteConfig, | ||
}), | ||
svelteSVG(), | ||
svelteWebComponentsConfig, | ||
svelteComponentsConfig, | ||
); | ||
|
||
export default { ...config, input: "src/main.ts" }; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import "@commons/define-component-patch"; | ||
import availability from "./Availability.svelte"; | ||
import availability from "./availability.svelte"; | ||
|
||
export default availability; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import config, { svelteConfig } from "../../rollup.common.config"; | ||
import svelte from "rollup-plugin-svelte"; | ||
import config, { | ||
svelteWebComponentsConfig, | ||
svelteComponentsConfig, | ||
} from "../../rollup.common.config"; | ||
import svelteSVG from "rollup-plugin-svelte-svg"; | ||
import json from "@rollup/plugin-json"; | ||
|
||
config.plugins.unshift(svelteSVG()); | ||
|
||
config.plugins.unshift( | ||
svelte({ | ||
...svelteConfig, | ||
}), | ||
json(), | ||
svelteSVG(), | ||
svelteWebComponentsConfig, | ||
svelteComponentsConfig, | ||
); | ||
config.plugins.unshift(json()); | ||
|
||
export default { ...config, input: "src/main.ts" }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if this is the right change to have made here