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

v1.3.0 #145

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

v1.3.0 #145

wants to merge 8 commits into from

Conversation

matthew-ia
Copy link
Owner

@matthew-ia matthew-ia commented Mar 22, 2024

Add Custom Event Dispatch on Cayo Init (fixes #144)

Adds a new Custom Event that can be listened for named cayo:init. For example:

document.addEventListener('cayo:init', (e) => {
  console.log('Cayo init: ', e);
});

BREAKING CHANGE: Add support for additional element attributes to be passed to Cayo elements (fixes #142).

The new prop attributes expects an object and destructures the object as element attributes on the Cayo element (the target element for the Cayo Component/island app)

Warning

Because this introduces a new prop, the attributes prop is now a reserved prop name. Previously, you could have used "attributes" as the name of a prop you were intending to pass to the resulting Cayo.

Usage example:

<script>
  import { Cayo } from 'cayo';
  const attr = {
    class: 'some',
    style: 'color: red;',
    ['data-custom']: 'other',
  }
</script>

<Cayo 
  src="Some.cayo.svelte" 
  attributes={attr}
/>

Output:

<div data-cayo-id="Some_13uba0-iwu98r" class="some" style="color: red;" data-custom="other">
  <!-- Rendered content... -->
</div>

Doctype in a template file now actually works as expected (fixes #147)

The last fix regarding this, #120, actually seems to have broken support for it even though it fixed the other issue of the Doctype always being added in the output.

@matthew-ia matthew-ia added enhancement New feature or updates to an existing feature feature and removed enhancement New feature or updates to an existing feature feature labels Mar 22, 2024
@matthew-ia matthew-ia self-assigned this Mar 23, 2024
@matthew-ia matthew-ia changed the title Add Custom Event Dispatch on Cayo Init v1.2.3 Mar 23, 2024
@matthew-ia matthew-ia changed the title v1.2.3 v1.3.0 Mar 23, 2024
@matthew-ia
Copy link
Owner Author

There's a bug where Cayo Components' CSS isn't being generated. This only seems to occur in the barebones test Cayo repo I'm using, and DOES NOT occur in kit wired up to use the WIP Cayo v1.3.0 code. Super weird, but I want to figure out why it is so I can document it / change a default config option, if that's what it is. I might need to blow up the package-lock files as well to see if it's some old dependency that's letting it work.

One other difference between kit's instance of cayo and barebones is that in barebones it throws an error regarding Rollup when the server starts (but this could be related to how kit adds a log before it starts, so it may be obscuring it by default or something).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant