-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Bring @glimmer/component into ember repo #20751
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/* eslint-env node */ | ||
'use strict'; | ||
|
||
const { addonV1Shim } = require('@embroider/addon-shim'); | ||
module.exports = addonV1Shim(__dirname); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"name": "@glimmer/component", | ||
"version": "2.0.0", | ||
"description": "Glimmer component library", | ||
"exports": { | ||
".": "./dist/index.js" | ||
}, | ||
"keywords": [ | ||
"ember-addon" | ||
], | ||
"license": "MIT", | ||
"contributors": [ | ||
"Dan Gebhardt <[email protected]>", | ||
"Robert Jackson <[email protected]>", | ||
"Tom Dale <[email protected]>" | ||
], | ||
"repository": "https://github.com/emberjs/ember.js", | ||
"scripts": {}, | ||
"dependencies": { | ||
"@embroider/addon-shim": "^1.8.9", | ||
"@glimmer/env": "^0.1.7" | ||
}, | ||
"devDependencies": { | ||
"typescript": "5.1" | ||
}, | ||
"engines": { | ||
"node": ">= 18" | ||
}, | ||
"typesVersions": { | ||
"*": { | ||
"*": [ | ||
"dist/*" | ||
] | ||
} | ||
}, | ||
"ember-addon": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since glimmer/component doesn't depend on any embery things, does it need to be an addon at all? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought that too, but it imports from |
||
"type": "addon", | ||
"version": 2, | ||
"main": "addon-main.cjs" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { DEBUG } from '@glimmer/env'; | ||
import type { Arguments, ComponentManager, ComponentCapabilities } from '@glimmer/interfaces'; | ||
import { type default as BaseComponent, ARGS_SET } from './component'; | ||
|
||
export interface Constructor<T> { | ||
new (owner: unknown, args: Record<string, unknown>): T; | ||
} | ||
|
||
export default abstract class BaseComponentManager<GlimmerComponent extends BaseComponent> | ||
implements ComponentManager<GlimmerComponent> | ||
{ | ||
abstract capabilities: ComponentCapabilities; | ||
|
||
private owner: unknown; | ||
|
||
constructor(owner: unknown) { | ||
this.owner = owner; | ||
} | ||
|
||
createComponent( | ||
ComponentClass: Constructor<GlimmerComponent>, | ||
args: Arguments | ||
): GlimmerComponent { | ||
if (DEBUG) { | ||
ARGS_SET.set(args.named, true); | ||
} | ||
|
||
return new ComponentClass(this.owner, args.named); | ||
} | ||
|
||
getContext(component: GlimmerComponent): GlimmerComponent { | ||
return component; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I verified that all the other package.jsons were also private.
Surprised this wasn't caught before -- but also not surprised -- because we're not using release-plan (or anything to enforce package.json consistency)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think for now, we could very well set up release plan for just
@glimmer/component
if we wanted.