benmerckx / genes

Generates split ES6 modules and Typescript definitions from Haxe modules.
44 stars 8 forks source link

Merge "field access" imports #7

Closed kevinresol closed 4 years ago

kevinresol commented 4 years ago

Something like this

@:jsRequire('semantic-ui-react', 'Dropdown.Header')

produces:

import {Dropdown.Header, Dropdown.Menu, Dropdown} from "semantic-ui-react"

and that causes syntax error.

In fact a single import {Dropdown} from ... suffices.

kevinresol commented 4 years ago

Now it generates import Dropdown from "semantic-ui-react", missing curly braces?

kevinresol commented 4 years ago

I got my 1.7MB js (bundled 6MB) web app running after manually patching for this one. And apparently everything is working!

benmerckx commented 4 years ago

Magical! :) I imagine you're going this route to eventually get tree shaking going? I still have to look into the requirements to mark haxe classes as "shakeable".

kevinresol commented 4 years ago

Yeah tree shaking and split bundle :) Thanks for the amazing work and prompt responses!