y-lohse / inkjs

A javascript port of inkle's ink scripting language.
http://www.inklestudios.com/ink/
MIT License
489 stars 100 forks source link

Compiler export is missing on the newest version #1064

Open blurymind opened 3 weeks ago

blurymind commented 3 weeks ago

In version 2.2.0 you can do this import { Story, Compiler } from 'inkjs'; Compiler is defined

On the latest version only Story is exported, Compiler is undefined.

All of your documentation points to this being a valid way to import it

smwhr commented 3 weeks ago

In 2.2.4 it should now be

import { Story, Compiler } from 'inkjs/full';

if you need the Compiler. The documentation will be updated shortly. Some things are being polished.

blurymind commented 3 weeks ago

interesting.. why was the Compiler moved to this /full subpath? Is this something to do with reducing deploy size?

smwhr commented 3 weeks ago

It has always been inside a special built package/file named inkjs-full.js which was the main entrypoint of the package (because no one put much thought in this at the time).

Which means that when building a game where you needed only the runtime, you had to embark the full compiler (which roughly double the size).

As for inky's webexport and such. They've always used ink.js, the "runtime-only" code.

smwhr commented 3 weeks ago

Btw, it's just a virtual subpath, it points to the same ol' ink-full.js (now an .mjs file)

blurymind commented 3 weeks ago

I see, but it does make the api a bit un-intuitive with this extra gotcha. Thats ok though, if it saves a few kb :)

Thanks for clarifying this. I guess just updating the docs would be sufficient to close this ticket