fable-compiler / repl-legacy

http://fable.io/repl
MIT License
14 stars 10 forks source link

Use exportDefault #13

Closed MangelMaxime closed 6 years ago

MangelMaxime commented 6 years ago

@alfonsogarciacaro If you build this version of the REPL you will see my problem with the ExportDefault not working.

If you can help me fix it inside this PR would be awesome :)

alfonsogarciacaro commented 6 years ago

Hmm, not sure what's happening. There was a problem with the module names in the Editor project but that didn't fix that. I also tried changing the name exports in case it caused a conflict with Webpack but that wasn't the solution either. Finally I just solved by adding directly a project reference :/

MangelMaxime commented 6 years ago

Yes this is really strange because, when I tried to access editor in the global scope in the browser. I didn't saw the editor.defaults or editor.exports like if webpack or fable was erasing this variable.

But I was able to see editor.create, editor.parseEditor, etc. as Fable export by default everything. I don't really understand neither. Should we use the project reference so ? Only, problem is it's will probably make webpack bundling slower (more files to bundle etc.).

alfonsogarciacaro commented 6 years ago

I don't know either, I'll try to investigate later. Anyway, yes, for this case a project reference (or maybe just a single project) should be enough. There are not many more files than a medium size Fable app. I think I made the structure like this at the beginning because I was thinking in making the editor a component that could be embedded in any other web, but we can deal with that later :+1:

MangelMaxime commented 6 years ago

I am closing this PR because, the change have already been included in the new repl