Skip to content

Conversation

@bevzzz
Copy link
Contributor

@bevzzz bevzzz commented Jun 6, 2024

Aliased imports, e.g. import { foo2 as foo } from './foo.js' are not allowed in CommonJS.

I ran into this problem because in my provider 2 different modules imported dirname, so in the final bundle the second import was aliased as dirname2, which breaks compilation.

Test plan

  • Added a test case to esmToCommonJS.test.ts
  • Tested locally (replaced the problematic import statement in bundle.js)

bevzzz added a commit to bevzzz/openctx that referenced this pull request Jun 6, 2024
Putting it all together!

`profider-pprof` can now annotate Go source files with information about
the CPU time the functions/methods defined in it take.
This requires `go` to be installed (standalone `pprof` will be supported
too) and a report generated.

Some remarks:
- Bungling to --format=cjs until this fix
sourcegraph#131 is merged
- _log.ts file is a temporary fixture for local development
- Lots of TODOs to handle
@sqs sqs force-pushed the fix/cjs-aliased-imports branch from bccf44f to 60c2ebe Compare June 6, 2024 23:39
@sqs sqs enabled auto-merge (squash) June 6, 2024 23:39
@sqs
Copy link
Member

sqs commented Jun 6, 2024

Thank you!

@sqs sqs merged commit 8d6a612 into sourcegraph:main Jun 7, 2024
@bevzzz bevzzz deleted the fix/cjs-aliased-imports branch June 7, 2024 08:54
bevzzz added a commit to bevzzz/openctx that referenced this pull request Jun 7, 2024
Putting it all together!

`profider-pprof` can now annotate Go source files with information about
the CPU time the functions/methods defined in it take.
This requires `go` to be installed (standalone `pprof` will be supported
too) and a report generated.

Some remarks:
- Bungling to --format=cjs until this fix
sourcegraph#131 is merged
- _log.ts file is a temporary fixture for local development
- Lots of TODOs to handle
@bevzzz bevzzz mentioned this pull request Jun 7, 2024
4 tasks
bevzzz added a commit to bevzzz/openctx that referenced this pull request Jun 11, 2024
Putting it all together!

`profider-pprof` can now annotate Go source files with information about
the CPU time the functions/methods defined in it take.
This requires `go` to be installed (standalone `pprof` will be supported
too) and a report generated.

Some remarks:
- Bungling to --format=cjs until this fix
sourcegraph#131 is merged
- _log.ts file is a temporary fixture for local development
- Lots of TODOs to handle
bevzzz added a commit to bevzzz/openctx that referenced this pull request Jun 13, 2024
Putting it all together!

`profider-pprof` can now annotate Go source files with information about
the CPU time the functions/methods defined in it take.
This requires `go` to be installed (standalone `pprof` will be supported
too) and a report generated.

Some remarks:
- Bungling to --format=cjs until this fix
sourcegraph#131 is merged
- _log.ts file is a temporary fixture for local development
- Lots of TODOs to handle
bevzzz added a commit to bevzzz/openctx that referenced this pull request Jun 13, 2024
Putting it all together!

`profider-pprof` can now annotate Go source files with information about
the CPU time the functions/methods defined in it take.
This requires `go` to be installed (standalone `pprof` will be supported
too) and a report generated.

Some remarks:
- Bungling to --format=cjs until this fix
sourcegraph#131 is merged
- _log.ts file is a temporary fixture for local development
- Lots of TODOs to handle
bevzzz added a commit to bevzzz/openctx that referenced this pull request Dec 12, 2024
Putting it all together!

`profider-pprof` can now annotate Go source files with information about
the CPU time the functions/methods defined in it take.
This requires `go` to be installed (standalone `pprof` will be supported
too) and a report generated.

Some remarks:
- Bungling to --format=cjs until this fix
sourcegraph#131 is merged
- _log.ts file is a temporary fixture for local development
- Lots of TODOs to handle
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.

3 participants