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

Demos failing on SyntaxError in haunted.js from unpkg #404

Open
superchris opened this issue Jun 2, 2022 · 6 comments
Open

Demos failing on SyntaxError in haunted.js from unpkg #404

superchris opened this issue Jun 2, 2022 · 6 comments

Comments

@superchris
Copy link

Attempting to run demo which does this:

import {
  html,
  component,
  useState,
} from "https://unpkg.com/haunted/haunted.js";

Browser console:

Uncaught SyntaxError: Unexpected token ':' (at haunted.js:21:67)
@geocine
Copy link

geocine commented Aug 25, 2022

Were you able to find a workaround?

@micahjon
Copy link
Contributor

micahjon commented Sep 7, 2022

The syntax error is in the haunted.js file that is bundled with the 5.0.0 release on npm, which in turn is distributed by unpkg, CDNJS, etc.

Looks like @matthewp has been working on automating/upgrading the testing and release pipeline, so I'm guessing it's related to that. I also noticed that a bunch of compiled js and d.ts files for the npm release were committed by a bot to the top level repo, which is probably also unintentional, but hopefully easy to reverse.

@bennypowers might also be able to fix this. I'm a bit out of my depth here unfortunately.

@bennypowers
Copy link
Collaborator

Unfortunately my best suggestion will be to redo the docs build altogether. I think there are two good options:

  1. Redo it with 11ty, replacing the rocket-specific plugins
  2. Redo it with rocket, which was rewritten to remove 11ty, rewriting the rocket plugins

either way, the plugins need to be removed or rewritten.

I've got some plans to port my rocket plugins to 11ty, but no timeline

@geocine
Copy link

geocine commented Sep 8, 2022

I had some luck using deno's cdn

https://esm.sh/haunted

@micahjon
Copy link
Contributor

Unfortunately my best suggestion will be to redo the docs build altogether. I think there are two good options:

  1. Redo it with 11ty, replacing the rocket-specific plugins
  2. Redo it with rocket, which was rewritten to remove 11ty, rewriting the rocket plugins

either way, the plugins need to be removed or rewritten.

I've got some plans to port my rocket plugins to 11ty, but no timeline

Thanks @bennypowers. I spent the morning playing around with both options and I'm currently leaning towards option 1 (just use 11ty) as Rocket appears to be evolving much more quickly and is much less widely used. As a sidenote, it's unfortunate that the name "Rocket" is already used by the Rust web framework as it makes searching difficult.

I took at stab at rewriting the docs in 11ty and soon realized that the layout files are not committed to this repo. Where is layout-home defined? Is it built-in to an old version of Rocket? I couldn't find it in the Rocket repo either.

Appreciate your help with this. Hopefully it's something I can knock out in the coming week or so.

@bennypowers
Copy link
Collaborator

yeah it's likely an old-rocket thing

In old-rocket, a 'preset' was a bundle of eleventy plugin + templates + includes + data which could be then used throughout the app. AFAICT 11ty never provided an 'official' way to do this.

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

No branches or pull requests

4 participants