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

Code generation creates identifiers starting with invalid characters #1763

Open
MightyAlex200 opened this issue Aug 26, 2018 · 5 comments
Open

Comments

@MightyAlex200
Copy link

Certain generated variable names start with the username of the account that published the package they're in. If that username begins with an invalid character (i.e. a number), the code generates errors and does not run.
I discovered this while trying to use https://package.elm-lang.org/packages/1602/elm-feather/latest/

From what I can tell this is a problem introduced with the changes in 0.19, because I was using this same package in 0.18 without problems.

This error can be reproduced simply by compiling an Elm program using 1602/elm-feather, but I have a compilable example you can see here: https://github.com/MightyAlex200/Comet/tree/ui-elm-19
Just run make in ui/, then open index.html

Related to #1377 and #710

@1602
Copy link

1602 commented Aug 26, 2018

Example of generated code:

var 1602$json_schema$Json$Schema$Builder$SchemaBuilder = function (a) {
	return {$: 'SchemaBuilder', a: a};
};

(when using 1602/json-schema package)

JDemler added a commit to CurrySoftware/compiler that referenced this issue Sep 1, 2018
@1602
Copy link

1602 commented Sep 14, 2018

Is there a plan to patch this bug within 0.19.x?

People keep asking me what to do if they want to use some of my elm libraries, I'd appreciate some insight here.

@harrysarson
Copy link

As a workaround you could run a find and replace on the generated Javascript.

@evancz
Copy link
Member

evancz commented Sep 14, 2018

Doing a new release of binaries is quite expensive. It takes maybe a three days to get everything set up, and then I need to have a testing phase for the community to see if it works on a bunch of different platforms. Then the folks who manage other install paths like npm, homebrew, and aur need to get things working.

All together, this is a pretty big cost across quite a lot of people, so I would like to get a decent number of fixes together before putting something out.

I don't know what the best path is in your scenario.

@1602
Copy link

1602 commented Sep 16, 2018

Yup, it makes sense to batch bug-fixes and release them all at once, given costs associated with the compiler release.

Speaking of my projects, I think it would be okay to rename.

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

No branches or pull requests

4 participants