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

progress towards getting ember s working again #375

Merged
merged 54 commits into from Feb 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
432dffe
Upgrades oofta
NullVoxPopuli Nov 26, 2021
f1ffa79
OMG it works
NullVoxPopuli Dec 12, 2021
50c6d31
It works?
NullVoxPopuli Dec 12, 2021
c92e0b8
Lints'n'stuff
NullVoxPopuli Dec 12, 2021
ac5484e
Template compiler appears to be a no-op now?
NullVoxPopuli Dec 12, 2021
f214095
eh, remark-hbs
NullVoxPopuli Dec 12, 2021
2f9e4b0
ember-template-lint
NullVoxPopuli Dec 16, 2021
60d140b
gts is working
NullVoxPopuli Dec 16, 2021
448f759
So close
NullVoxPopuli Dec 16, 2021
2e7fe2e
Progress -- now I just need to figure what happened to the hbs extrac…
NullVoxPopuli Dec 16, 2021
61c8901
Upgrade more deps
NullVoxPopuli Dec 17, 2021
9105cd9
Blocked on macro condition fixes
NullVoxPopuli Dec 17, 2021
e151b3e
Well, now monaco is acting up
NullVoxPopuli Dec 18, 2021
a748759
I did it
NullVoxPopuli Dec 18, 2021
1f19642
fix icon loading for monaco
NullVoxPopuli Dec 18, 2021
0780237
To get around dependencySatisfies issues, I have to downgrade to stab…
NullVoxPopuli Dec 18, 2021
60e02bc
Don't run patches on release of ember-source
NullVoxPopuli Dec 18, 2021
561618e
Waiting on https://github.com/emberjs/ember.js/pull/19878
NullVoxPopuli Dec 18, 2021
4866101
gts conversion
NullVoxPopuli Dec 18, 2021
c52ddb5
Fix some imports
NullVoxPopuli Dec 18, 2021
3f36937
Fix the embroider/util issue?
NullVoxPopuli Dec 18, 2021
297b10f
Fix modifier currying
NullVoxPopuli Dec 18, 2021
a77c57f
Covert most things to gts
NullVoxPopuli Dec 18, 2021
b298fcf
Upgrade embroider
NullVoxPopuli Dec 21, 2021
d20f295
Use ember canary directly'
NullVoxPopuli Jan 7, 2022
88aa927
Everytime codemirror updates, the lockfile needs re-rolled hmmm
NullVoxPopuli Jan 7, 2022
08d6a28
problem persists with embroider's dependencySatisfies
NullVoxPopuli Jan 7, 2022
c0f97c7
Remove function-modifiers file in favor of the new polyfill
NullVoxPopuli Jan 9, 2022
974da53
Success?
NullVoxPopuli Jan 9, 2022
25d43bb
Force latest embroider
NullVoxPopuli Jan 10, 2022
d01d2d4
Force latest embroider
NullVoxPopuli Jan 10, 2022
7efbc07
colors, boo
NullVoxPopuli Jan 13, 2022
8f65250
Upgrade more stuff
NullVoxPopuli Jan 13, 2022
769951f
Upgrade stuff, try ef4 patch
NullVoxPopuli Jan 13, 2022
fd91c67
update render modifiers
NullVoxPopuli Jan 14, 2022
0b45097
More updates
NullVoxPopuli Jan 16, 2022
855046e
Progress
NullVoxPopuli Jan 16, 2022
95078fe
Fix shadowdom styles
NullVoxPopuli Jan 16, 2022
09a7d75
Upgrade deps
NullVoxPopuli Jan 20, 2022
7982d01
Add turborepo
NullVoxPopuli Dec 23, 2021
2627e68
Merge branch 'turbo-experiment' into upgrade-stuff-2
NullVoxPopuli Jan 20, 2022
8eed192
Delete dist folder
NullVoxPopuli Jan 20, 2022
abbaa2e
bump ember-source
NullVoxPopuli Jan 20, 2022
b18db14
upgrade fontawesome
NullVoxPopuli Jan 20, 2022
c9b271f
Upgrade Turbo configs
NullVoxPopuli Jan 30, 2022
5acc528
Wipe lockfile, add macros to resolutions
NullVoxPopuli Feb 8, 2022
777d156
Monorepos...
NullVoxPopuli Feb 8, 2022
2e5932b
Downgrade
NullVoxPopuli Feb 8, 2022
8fa8b36
Upgrade deps
NullVoxPopuli Feb 13, 2022
13fc33e
Update resolutions
NullVoxPopuli Feb 13, 2022
5ce488e
Update ember-auto-import resolutions
NullVoxPopuli Feb 13, 2022
8c9c56f
Fix some styles
NullVoxPopuli Feb 13, 2022
eae8870
Fix tests
NullVoxPopuli Feb 14, 2022
d5614cd
Update codemirror
NullVoxPopuli Feb 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -3,6 +3,7 @@
# compiled output
dist/
/tmp/
/out/

# dependencies
/bower_components/
Expand All @@ -14,6 +15,7 @@ package-lock.json
.env*
.pnp*
.eslintcache
.turbo
npm-debug.log*
yarn-error.log

15 changes: 15 additions & 0 deletions frontend/app/components/external-link.gts
@@ -0,0 +1,15 @@
import FaIcon from '@fortawesome/ember-fontawesome/components/fa-icon';

<template>
<a
target="_blank"
rel="noreferrer noopener"
href="#"
class="flex gap-2 items-baseline focus:ring-4 focus:outline-none focus-visible:outline-none rounded-sm"
...attributes
>
<span>{{yield}}</span>

<FaIcon @icon="external-link-alt" />
</a>
</template>
11 changes: 0 additions & 11 deletions frontend/app/components/external-link.hbs

This file was deleted.

17 changes: 17 additions & 0 deletions frontend/app/components/limber/building.gts
@@ -0,0 +1,17 @@
import service from 'limber/helpers/service';

<template>
{{#let (service 'editor') as |editor|}}
{{#if editor.isCompiling}}
<div class="
absolute top-0 inset-x-0
bg-opacity-95 p-10 bg-gray-100 shadow
text-black text-2xl font-bold z-20
flex gap-4 items-center"
>
<div class="loader animate-spin h-6 w-6"></div>
<span>Building...</span>
</div>
{{/if}}
{{/let}}
</template>
14 changes: 0 additions & 14 deletions frontend/app/components/limber/building.hbs

This file was deleted.

@@ -1,14 +1,15 @@
import Component from '@glimmer/component';
import { setComponentTemplate } from '@ember/component';
import { on } from '@ember/modifier';
import { action } from '@ember/object';
import { hbs } from 'ember-cli-htmlbars';

import { toBlob, toPng } from 'html-to-image';

import Menu from './menu';

/**
* This component is injected via the markdown rendering
*/
class CopyMenu extends Component {
export default class CopyMenu extends Component {
@action
copyAsText(event: Event) {
let code = getSnippetElement(event);
Expand All @@ -22,11 +23,9 @@ class CopyMenu extends Component {

await withExtraStyles(code, () => toClipboard(code));
}
}

export default setComponentTemplate(
hbs`
<Limber::Menu class="absolute top-3 right-4 z-10" data-test-copy-menu>
<template>
<Menu class="absolute top-3 right-4 z-10" data-test-copy-menu>
<:trigger>
📋
</:trigger>
Expand All @@ -39,10 +38,10 @@ export default setComponentTemplate(
Copy as image
</Item>
</:options>
</Limber::Menu>
`,
CopyMenu
);
</Menu>
</template>
}


/*************************************************
*
Expand Down
50 changes: 50 additions & 0 deletions frontend/app/components/limber/demo-select.gts
@@ -0,0 +1,50 @@
import Component from '@glimmer/component';
import { action } from '@ember/object';
import { on } from '@ember/modifier';
import { fn } from '@ember/helper';
import { inject as service } from '@ember/service';
import { waitFor } from '@ember/test-waiters';

import FaIcon from '@fortawesome/ember-fontawesome/components/fa-icon';

import { getFromLabel, NAMES } from 'limber/snippets';
import Menu from './menu';

import type EditorService from 'limber/services/editor';

export default class DemoSelect extends Component {
@service declare editor: EditorService;

demos = NAMES;

@action
@waitFor
async select(demoName: string) {
let demo = await getFromLabel(demoName);

this.editor.updateDemo(demo);
}

<template>
<Menu data-test-demo-select ...attributes>
<:trigger as |menu|>
<span class="grid grid-flow-col gap-2 items-center">
Select demo
{{#if menu.isOpen}}
<FaIcon @icon="angle-up" class="min-w-3" />
{{else}}
<FaIcon @icon="angle-right" class="min-w-3" />
{{/if}}
</span>
</:trigger>

<:options as |Item|>
{{#each this.demos as |demoName|}}
<Item {{on 'click' (fn this.select demoName)}} data-test-demo>
{{demoName}}
</Item>
{{/each}}
</:options>
</Menu>
</template>
}
20 changes: 0 additions & 20 deletions frontend/app/components/limber/demo-select.hbs

This file was deleted.

22 changes: 0 additions & 22 deletions frontend/app/components/limber/demo-select.ts

This file was deleted.

79 changes: 79 additions & 0 deletions frontend/app/components/limber/editor-controls/index.gts
@@ -0,0 +1,79 @@
import { fn } from '@ember/helper';
import { on } from '@ember/modifier'

import FaIcon from '@fortawesome/ember-fontawesome/components/fa-icon';

import State from './state';

import type { InterpreterFrom } from 'xstate';

type Send = InterpreterFrom<typeof State>['send'];

const container = (element: Element, send: Send) => {
send('CONTAINER_FOUND', { container: element as HTMLElement });

return () => send('CONTAINER_REMOVED');
};

const Button = <template>
<button
type='button'
class="
block select-none py-2 px-3 text-white text-xs
hover:bg-[#9b2918]
focus:ring-4 ring-inset focus:outline-none"
...attributes
>
{{yield}}
</button>
</template>;

const Controls = <template>
{{#if @needsControls}}
<div
class='
absolute top-0 right-0 z-[1] flex lg:grid
{{if @isMinimized
'bg-ember-black h-full content-start'
}}
'
>
<Button
title={{if @isMaximized 'Back to split view' 'Maximize Editor'}}
{{on 'click' (fn @send 'MAXIMIZE')}}
>
{{#if @isMaximized}}
<FaIcon @icon='columns' />
{{else}}
<FaIcon @icon="window-maximize" @prefix='far' />
{{/if}}
</Button>
<Button
title={{if @isMinimized 'Back to split view' 'Minimize Editor'}}
{{on 'click' (fn @send 'MINIMIZE')}}
>
{{#if @isMinimized}}
<FaIcon @icon='columns' />
{{else}}
<FaIcon @icon='window-minimize' @prefix='far' />
{{/if}}
</Button>
</div>
{{/if}}
</template>;

<template>
<State as |state send|>
{{yield
(component
Controls
isMinimized=(state.matches 'hasContainer.minimized')
isMaximized=(state.matches 'hasContainer.maximized')
needsControls=state.context.container
send=send
)
(modifier container send)
}}
</State>
</template>