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

[New Framework] Ember #350

Closed
sandstrom opened this issue Jun 9, 2021 · 17 comments
Closed

[New Framework] Ember #350

sandstrom opened this issue Jun 9, 2021 · 17 comments

Comments

@sandstrom
Copy link

Any plans on adding support for Ember?

https://emberjs.com/

@matthewp
Copy link
Contributor

matthewp commented Jun 9, 2021

Ember support would be pretty simple. I think we're still discussing which frameworks (if any) should be included by default. But creating a renderer is already possible and documented here: https://github.com/snowpackjs/astro/blob/main/docs/renderers.md

Any chance you'd be interested in working on one?

@rajasegar
Copy link

I am interested in working on ember-renderer, will give it a shot.

@rajasegar
Copy link

When we are taking about Ember support, I assume we are talking about supporting Glimmer components for Astro. Because Ember is a full-fledged framework built on top of Glimmer.js. So the underlying component library is Glimmer. Under that assumption I tried to build a renderer for Glimmer here. But met with some errors while trying to load Glimmer components.
Demo project: https://github.com/rajasegar/astro-demo-glimmer
Renderer Project: https://github.com/rajasegar/astro-renderer-glimmer

(node:31670) UnhandledPromiseRejectionWarning: Error: Module "undefined" has no exported member "unwrapTemplate". Did you mean to use "import unwrapTemplate from 'undefined'" instead?
    at Object.install (/Users/rajasegarchandran/www/astro-demo/node_modules/snowpack/lib/index.js:94754:23)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at Object.installPackages (/Users/rajasegarchandran/www/astro-demo/node_modules/snowpack/lib/index.js:122772:25)
    at /Users/rajasegarchandran/www/astro-demo/node_modules/snowpack/lib/index.js:123350:39
    at PackageSourceLocal.buildPackageImport (/Users/rajasegarchandran/www/astro-demo/node_modules/snowpack/lib/index.js:123262:30)
    at PackageSourceLocal.prepare (/Users/rajasegarchandran/www/astro-demo/node_modules/snowpack/lib/index.js:123038:13)
    at startServer (/Users/rajasegarchandran/www/astro-demo/node_modules/snowpack/lib/index.js:182438:9)
    at createSnowpack (file:///Users/rajasegarchandran/www/astro-demo/node_modules/astro/src/runtime.ts:425:14)
    at createRuntime (file:///Users/rajasegarchandran/www/astro-demo/node_modules/astro/src/runtime.ts:449:7)
    at dev (file:///Users/rajasegarchandran/www/astro-demo/node_modules/astro/src/dev.ts:27:19)

@sandstrom
Copy link
Author

I'm not expert on this, but my understanding is that Glimmer and Ember are separate libraries, where Ember (the framework) is using Glimmer Components (rendering and component logic) internally. That said, I think Ember is the only [real] user of Glimmer, and they are fairly tightly coupled.

@matthewp
Copy link
Contributor

Sorry you ran into this @rajasegar. I'm going to test your repo out and see if I can figure out what is going on.

@matthewp
Copy link
Contributor

I'm still investigating, this is a better error message though:

'unwrapTemplate' is not exported by node_modules/@glimmer/opcode-compiler/dist/modules/es2017/index.js, imported by node_modules/@glimmer/runtime/dist/modules/es2017/lib/compiled/opcodes/component.js

@matthewp
Copy link
Contributor

I think this might be a version mismatch. This is what is in my tree for @glimmer/opcode-compiler:

@astrojs/[email protected] /Users/matthew/dev/astro-demo-glimmer
├─┬ @glimmer/[email protected]
│ └── @glimmer/[email protected]  deduped
├── @glimmer/[email protected]
└─┬ [email protected]
  ├─┬ @glimmer/[email protected]
  │ └── @glimmer/[email protected]
  └─┬ @glimmer/[email protected]
    └─┬ @glimmer/[email protected]
      └── @glimmer/[email protected]

@matthewp
Copy link
Contributor

@rajasegar Yeah I think you want to either upgrade @glimmer/ssr to 2.0.0-beta.16 or downgrade your version of @glimmer/core.

@FredKSchott FredKSchott changed the title Ember Support [New Framework] Ember Jun 13, 2021
@rajasegar
Copy link

After updating the dependencies to the latest version I am getting the following error when I visit the page in the browser

> @astrojs/[email protected] start /home/boot/Public/www/astro-demo-glimmer
> astro dev

[13:41:09] [snowpack] + astro/dist/internal/[email protected]
[13:41:09] [snowpack] + astro/components/[email protected]
[13:41:10] [snowpack] └── @astrojs/[email protected]
[13:41:10] [snowpack] └── [email protected]
[13:41:11] [snowpack] + astro/[email protected]
[13:41:12] [snowpack] └── @astrojs/[email protected] (dedupe)
[13:41:12] [snowpack] └── [email protected] (dedupe)
[13:41:12] [snowpack] Ready!
[13:41:12] [snowpack] watching for file changes... 
[13:41:15] [snowpack] Ready!
[dev server] Server started in 9744ms.
[dev server] Local: http://127.0.0.1:3000/
[13:41:16] [snowpack] watching for file changes... 
[access] /
[13:41:20] [snowpack] + astro/dist/internal/[email protected]
[13:41:26] [snowpack] Build Result Error: There was a problem with a file build result.
[executing astro] Error: Module "undefined" has no exported member "EMPTY_STRING_ARRAY". Did you mean to use "import EMPTY_STRING_ARRAY from 'undefined'" instead?
    at Object.install (/home/boot/Public/www/astro-demo-glimmer/node_modules/snowpack/lib/index.js:94754:23)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at Object.installPackages (/home/boot/Public/www/astro-demo-glimmer/node_modules/snowpack/lib/index.js:122772:25)
    at /home/boot/Public/www/astro-demo-glimmer/node_modules/snowpack/lib/index.js:123350:39
    at PackageSourceLocal.buildPackageImport (/home/boot/Public/www/astro-demo-glimmer/node_modules/snowpack/lib/index.js:123262:30)
    at PackageSourceLocal.resolvePackageImport (/home/boot/Public/www/astro-demo-glimmer/node_modules/snowpack/lib/index.js:123474:9)
    at resolveImport (/home/boot/Public/www/astro-demo-glimmer/node_modules/snowpack/lib/index.js:163302:32)
    at /home/boot/Public/www/astro-demo-glimmer/node_modules/snowpack/lib/index.js:163325:41
    at /home/boot/Public/www/astro-demo-glimmer/node_modules/snowpack/lib/index.js:114688:31
    at async Promise.all (index 2)
    at transformEsmImports (/home/boot/Public/www/astro-demo-glimmer/node_modules/snowpack/lib/index.js:114680:5)
    at FileBuilder.resolveImports (/home/boot/Public/www/astro-demo-glimmer/node_modules/snowpack/lib/index.js:163324:24)
    at Object.loadUrl (/home/boot/Public/www/astro-demo-glimmer/node_modules/snowpack/lib/index.js:182825:39)
    at load (/home/boot/Public/www/astro-demo-glimmer/node_modules/snowpack/lib/index.js:182415:28)
    at load (file:///home/boot/Public/www/astro-demo-glimmer/node_modules/astro/src/runtime.ts:91:17)
    at Server.<anonymous> (file:///home/boot/Public/www/astro-demo-glimmer/node_modules/astro/src/dev.ts:33:20)
[access] /500
[13:41:26] [snowpack] + astro/dist/internal/[email protected]
[13:41:30] [snowpack] Build Result Error: There was a problem with a file build result

Screenshot from 2021-06-18 12-36-12

@FredKSchott
Copy link
Member

0.12.10 is an old version still.

@matthewp
Copy link
Contributor

@rajasegar I wonder how this is going? Anything else we can do to help?

@rajasegar
Copy link

@matthewp I didn't have a chance to work on it for some time, as Fred mentioned I need to update the astro version and check. Will let you folks know if I am stuck with anything. I am going to tinker around with it this weekend.

@matthewp
Copy link
Contributor

Thanks @rajasegar, going to close as this is a 3rd party renderer, but happy to keep talking about it in this issue.

@spuxx1701
Copy link

Do we happen to have any news on this topic? I'd love to be able to use glimmer components in Astro. :)

@matthewp
Copy link
Contributor

matthewp commented Dec 2, 2022

@spuxx1701 I'm not aware of anyone having built a Glimmer renderer but the Discord is a good place to check.

@esbanarango
Copy link

👀

@vstefanovic97
Copy link

Probably we need to wait for this to land, and some other stuff, after that I assume it should be viable to support ember with astro
emberjs/ember.js#20781

It's mentioned here:
https://yehudakatz.com/2024/10/28/polaris-what-im-working-on

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

No branches or pull requests

7 participants