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

[Feature Request]: Add support for Figwheel configuration {:target :bundle} #676

Closed
Mocha-- opened this issue Jun 26, 2020 · 7 comments
Closed

Comments

@Mocha--
Copy link

Mocha-- commented Jun 26, 2020

Hi,

Cljs and Figwheel recently released a new feature with configuration {:target :bundle}, which can generate intermediate code by Clojure Compiler that can be further processed by other frontend tools such as Webpack and Parcel.

However, when I tried to Jack-in a project with the new {:target :bundle} configuration, Calva reports a Spec Failed error. I guess at the moment Calva does not recognize this new configuration.

Please incorporate this new configuration.

Thanks,
Screen Shot 2020-06-26 at 12 19 38 pm

@bpringe
Copy link
Member

bpringe commented Jun 26, 2020

Thanks for reporting. I'm not sure this error is caused by Calva. It looks like this feature is only available in ClojureScript version 1.10.741 and higher, and not related directly to figwheel. Are you using this version or higher of ClojureScript?

Also make sure your figwheel is at a high enough version, though I don't see anything in fighwheel's docs related to this feature. I see this but it looks unrelated.

@Mocha--
Copy link
Author

Mocha-- commented Jun 29, 2020

My Clojurescript version is 1.10.773, which supports :target :bundle feature.

Please check out this link https://figwheel.org/docs/npm.html.

Furthermore, please add support for :auto-bundle https://figwheel.org/config-options#auto-bundle

@bpringe
Copy link
Member

bpringe commented Jun 29, 2020

I see. I don't think Calva itself is using spec to verify that, so it does seem that either Figwheel or, more likely, ClojureScript, is throwing that error. I know you said you're using a high enough version of ClojureScript, but I'm wondering if maybe Calva is injecting a different version, or doing something else which could cause this.

Going to ping @PEZ here, as he may have more insight.

@Mocha--
Copy link
Author

Mocha-- commented Jun 30, 2020

I think the reason is found out. The figwheel version is hardcoded in Calva. https://github.com/BetterThanTomorrow/calva/blob/v2.0.106/src/nrepl/project-types.ts#L156

If this version could be updated to the latest, which is 0.2.9 at the moment, the problem should be solved.

@PEZ
Copy link
Collaborator

PEZ commented Jun 30, 2020

Gah. We shouldn't be injecting Figwheel Main at all. I thought I had removed that.

I'm sorry for the inconvenience. Thanks for reporting and investigating it some for us!

To unblock yourself you can either:

  • copy the command line used at jack in, kill the jack-in, and start the repo yourself with a fixed version of it, and then use connect instead
  • fork the Calva repo, remove that injection, and run Calva in dev mode as described here: How to Hack on Calva

The latter has the advantage that you can then send us a PR. 😄

@bpringe
Copy link
Member

bpringe commented Dec 24, 2020

@PEZ Is this fixed? I wasn't familiar with this code before, and the link above seems to not work any more, but I don't see anywhere that we're hard-coding figwheel main in the current code base.

@PEZ
Copy link
Collaborator

PEZ commented Dec 24, 2020

Yes, this is fixed. Calva does not inject Figwheel and won't interfere with which version the user has configured in the project.

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

3 participants