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

[WIP] feat(cli): bundling using swc #7669

Closed
wants to merge 3 commits into from
Closed

Conversation

kitsonk
Copy link
Contributor

@kitsonk kitsonk commented Sep 25, 2020

This is very much still a WIP, but I have it working.

I adapted @kdy1's #7461 into the refactor of the module graph... I need to DRY up the code a bit, as well as provide type checking variant, as well are re-organise the code in the main.rs that shouldn't really be there. It does demonstrate how incongruent we handle stuff though, and all of this needs a really good scrub.

Raising it now for review and discussion.

@kitsonk kitsonk mentioned this pull request Sep 25, 2020
13 tasks
@kdy1
Copy link

kdy1 commented Sep 25, 2020

I'm sorry but what should I do?
Maybe rebase?

@kitsonk
Copy link
Contributor Author

kitsonk commented Sep 25, 2020

@kdy1 nothing specifically at the moment other than thoughts and feedback... I need to add you as a co-author, and I will add you as a collaborator to my branch, but we were talking about it and because we were refactoring the whole of the compiler/module_graph/etc. it was easier for me to take your other PR and incorporate it.

Obviously the bugs you were working on in swc are invaluable too... I am going to try to get more tests in, so we have more examples to validate things. I think we should really try to get it integrated and just try to fix whatever bugs we find.

@kdy1
Copy link

kdy1 commented Oct 3, 2020

Is stack overflow still reproducible?

@kdy1
Copy link

kdy1 commented Oct 3, 2020

@kitsonk I confused passes. You have to apply swc_ecma_transforms::proposals::export to use export * as foo from './foo';.

Sorry for misleading. (I thought it is handled by typescrpit::strip, but it was not)

Also, stack overflow of example2.ts will be fixed by swc-project/swc#1127

@kitsonk
Copy link
Contributor Author

kitsonk commented Oct 5, 2020

This has improved a lot (thanks @kdy1)... Still a couple challenges left:

  • deno bundle --no-check https://deno.land/x/oak@v6.2.0/examples/server.ts does not emit a valid bundle. I isolated the issue to swc_bundler: dropped nodes on transient renamed exports swc-project/swc#1138
  • Once I manually fix the valid invalid emit, when I do deno run --allow-net bundle.js the executes without syntax errors, but the behaviour isn't as expected. I haven't narrowed it down yet because it could be that I didn't catch all the locations where that the issue above is impacting the code.

@kitsonk kitsonk mentioned this pull request Oct 5, 2020
@kitsonk
Copy link
Contributor Author

kitsonk commented Oct 18, 2020

Going to reland this under a different PR.

@kitsonk kitsonk closed this Oct 18, 2020
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

Successfully merging this pull request may close these issues.

None yet

3 participants