Skip to content

Coffee hack for label #493

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

Closed
wants to merge 5 commits into from
Closed

Conversation

gcxfd
Copy link

@gcxfd gcxfd commented Mar 25, 2022

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR relates to an outstanding issue, so please reference it in your PR, or create an explanatory one for discussion. In many cases features are absent for a reason.
  • This message body should clearly illustrate what problems it solves. If there are related issues, remember to reference them.
  • Ideally, include a test that fails without this PR but passes with it. PRs will only be merged once they pass CI. (Remember to npm run lint!)

Tests

  • Run the tests with npm test or yarn test

@gcxfd gcxfd force-pushed the coffee_hack_for_label branch from cbaac50 to dcd5d2f Compare March 25, 2022 11:04
@gcxfd gcxfd force-pushed the coffee_hack_for_label branch from dcd5d2f to 877d966 Compare March 25, 2022 11:39
@gcxfd
Copy link
Author

gcxfd commented Mar 25, 2022

it work , i release a preview in @rmw/svelte-preprocess

yarn add  -D @rmw/svelte-preprocess @rmw/coffee-label-patch

but test can't pass , says can't found module , but I don't know how fix , typescript is too hard to use

demo video
https://www.loom.com/share/a45ffe7eeecb4115ad335b7db21f9b04?from_recorder=1&focus_title=1

@mrkishi
Copy link
Member

mrkishi commented Mar 26, 2022

It's awesome that you figured out how to get that syntax to work!

Unfortunately svelte-preprocess can't use a patched Coffeescript compiler, at least not by default, as that would be quite surprising for users and would require on-going maintenance to make sure nothing breaks as the compiler changes.

I'm sure people looking to use reactive statements would use your patch, though.

@gcxfd
Copy link
Author

gcxfd commented Mar 26, 2022

image

@mrkishi
I modified the code so that the :label syntax is enabled only when the label:true argument is passed. So we don't break compile.

    svelte(
      preprocess: [
        sveltePreprocess(
          coffeescript: {
            label:true
            sourceMap: true
          }
          stylus: true
          pug: true
        )
      ]
    )

@kaisermann kaisermann closed this Dec 10, 2022
@kaisermann
Copy link
Member

Thanks for the contribution and the idea! However, as @mrkishi said,

Unfortunately svelte-preprocess can't use a patched Coffeescript compiler, at least not by default, as that would be quite surprising for users and would require on-going maintenance to make sure nothing breaks as the compiler changes.

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

Successfully merging this pull request may close these issues.

3 participants