Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Blocked on browser support for
<template>
compilation.Mainly (sortof?),
we need to remove commonjs packages because Vite isn't as friendly with them.
otherwise, we run in to errors in vite, like: "
ambiguous indirect import
", which, if you control the source code, you can work around viaimport * as cjsBlergh from 'its-2023-comeon'
.So, I can understand now why maybe @ef4 wanted embroider cross-compiling to cjs and esm -- esm just makes things easier. I should finish that PR 😅
I ran in to the cjs compatibility issue when I was trying to use my old copy of
ember-template-imports
, which usesso, ideally, I'd just not use those,
there are two paths to browser-support for
<template>
compilation atm:<template>
way easier in lint tools and stuffUncaught SyntaxError: ambiguous indirect export: Preprocessor
as well :( so.. this is oof. maybe there is a vite config to change somethere?UPDATE: solved by fixing the package.json (
.
import specifier were in the wrong order)babel-plugin-ember-template-compilation
,proposal-decorators
(legacy), andproposal-class-properties
-- once all 3 of those are available in SWC, maybe there can be a small WASM-version of the full compilation process, and I can ditch babel (which is currently overall closer to 5MB)Note that these errors are the same:
The requested module does not provide an export named
ambiguous indirect import
On the vite cjs problem, I've found this information:
There are a ton of issue reports with this error: https://github.com/vitejs/vite/issues?q=is%3Aissue+The+requested+module+does+not+provide+an+export+named+is%3Aclosed
Looks like, for the issues that have resolutions, the solution is different for each.
I remember reading that one of the solutions was to hoist dependencies -- which is super dirty -- I instead changed
babel-plugin-ember-template-compilation
to a peerDep of ember-repl, but the problem persists.but after doing this, I moved
babel-plugin-ember-template-compilation
back tooptimizeDeps.include
, and I made progress -- now it seems decorators aren't getting transpiled. hmmlol, this is my own error, and means it's getting called incorrectly
Though, there is a third argument -- but it's undefined -- I guess I wasn't expecting the descriptor to ever be undefined 🤔