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

Issue with Deno bundle #3751

Closed
fakoua opened this issue Jan 22, 2020 · 1 comment · Fixed by #3965
Closed

Issue with Deno bundle #3751

fakoua opened this issue Jan 22, 2020 · 1 comment · Fixed by #3965

Comments

@fakoua
Copy link

fakoua commented Jan 22, 2020

Consider the follow code:

//Cl1.ts
export const fn1 = function() {
    console.log("this is fn1");
}

export abstract class Cl1 {
    static fn2() {
        console.log("Cl1.fn2")
    }
}

Without bundle, fn1 and Cl1 are exported, however when I use the bundle cli or Deno.bundle, I can't access the Cl1 anymore:

import { Cl1, fn1} from "./Cl1_bundle.ts" //Cl1 gives error.

Please advice.
Thanks

@kitsonk
Copy link
Contributor

kitsonk commented Jan 22, 2020

Likely, the AST node of an abstract class does not look like an exportable node (because abstract is a type only concept, so we incorrectly expect no runtime emit), and we need to adjust the export detection criteria.

kitsonk added a commit to kitsonk/deno that referenced this issue Feb 11, 2020
Moves to using a minimal System loader for bundles generated by Deno.
TypeScript in 3.8 will be able to output TLA for modules, and the loader
is written to take advantage of that as soon as we update Deno to TS
3.8.

System also allows us to support `import.meta` and provide more ESM
aligned assignment of exports, as well as there is better handling of
circular imports.

The loader is also very terse versus to try to save overhead.

Also, fixed an issue where abstract classes were not being rexported.

Fixes denoland#2553
Fixes denoland#3559
Fixes denoland#3751
Fixes denoland#3825
Refs denoland#3301
kitsonk added a commit to kitsonk/deno that referenced this issue Feb 11, 2020
Moves to using a minimal System loader for bundles generated by Deno.
TypeScript in 3.8 will be able to output TLA for modules, and the loader
is written to take advantage of that as soon as we update Deno to TS
3.8.

System also allows us to support `import.meta` and provide more ESM
aligned assignment of exports, as well as there is better handling of
circular imports.

The loader is also very terse versus to try to save overhead.

Also, fixed an issue where abstract classes were not being rexported.

Fixes denoland#2553
Fixes denoland#3559
Fixes denoland#3751
Fixes denoland#3825
Refs denoland#3301
@ry ry closed this as completed in #3965 Feb 12, 2020
ry pushed a commit that referenced this issue Feb 12, 2020
Moves to using a minimal System loader for bundles generated by Deno.
TypeScript in 3.8 will be able to output TLA for modules, and the loader
is written to take advantage of that as soon as we update Deno to TS
3.8.

System also allows us to support `import.meta` and provide more ESM
aligned assignment of exports, as well as there is better handling of
circular imports.

The loader is also very terse versus to try to save overhead.

Also, fixed an issue where abstract classes were not being re-exported.

Fixes #2553
Fixes #3559
Fixes #3751
Fixes #3825
Refs #3301
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 a pull request may close this issue.

2 participants