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

Diff of 0.85.x #1491

Closed
wants to merge 192 commits into from
Closed

Diff of 0.85.x #1491

wants to merge 192 commits into from

Conversation

chancancode
Copy link
Contributor

No description provided.

NullVoxPopuli and others added 30 commits March 27, 2023 18:21
Try upgrading ember-cli-browserstack
Highlights:

- updated `typescript` to `5.0.4`.
- updated eslint and associated packages to the latest version
- updated prettier and associated packages
- updated babel and associated packages
- updated to pnpm and pnpm workspaces

The biggest consequence of this commit is that packages should
*reliably* have dependencies on the packages they depend on.

This required moving a handful of interfaces to `@glimmer/interfaces`:

- The `Reference` type and associated types
- The `Tag` type and associated types
- All of the `SimpleDOM` types, to avoid duplication problems

Where a symbol is part of an interface, `@glimmer/interface` declares
the symbol. The concrete implementation assigns its symbol to the symbol
type exported by `@glimmer/interface`.

This commit also refactors away from `const enum` in a few key places.
Const enums were refactored into normal unions, and the members of a
const enum were refactored into type literal types.
The syntax package has remnants of a multipart ASTv2 process that never
came to fruition.

This commit removes those remnants.
This is an initial implementation of an improved API for compiling a
template with lexical scope.

Instead of passing a list of locals to the precompileTemplate function,
you can pass a function that takes a variable name and returns a boolean
to indicate whether the variable is in scope.

Importantly, this fixes an inconsistency with how HTML tags and keywords
behave when they refer to a Handlebars local variable vs. when they
refer to a JavaScript lexical variable.

```jsx
const component = <template><div>{{yield}}</div></template>;

<template>
  <component />
</template>
```

After this change, the `<component>` invocation correctly refers to the
surrounding scope variable, even though `component` is a keyword.

This makes it consistent with:

```jsx
const variable = <template><div>{{yield}}</div></template>;

<template>
{{#let variable as |component|}}
  <component />
{{/let}}
</template>
```

These semantics are an important future-proofing measure: they allow us
to add additional keywords in the future, since local variables (either
lexical JavaScript variables of Handlebars variables) will win over the
newly defined keywords.

If we allowed keywords to win over lexical JavaScript variables, every
new keyword would be a breaking change. The semantics we used for
`as |div|` and `as |component|` were carefully designed to avoid this
problem, and this change helps us implement the same behavior for
lexical JavaScript variables.
- exactOptionalPropertyTypes
- noPropertyAccessFromIndexSignature
- noImplicitOverride

This commit also cleans up deprecated lints, migrates older lints to
`n/` and sets up the import lint plugins needed for a good importing
experience.

There's a lot of changes in this commit, but most of it is minor tweaks
to deal with stylistic issues raised by lints.

The biggest substantive changes were required by
`exactOptionalPropertyTypes` and `noPropertyAccessFromIndexSignature`.
Both of these strict settings revealed many places where our code didn't
clearly handle missing values and nulls, and this commit adds the
necessary checks.

Some common patterns:

- Migrate C-style for loops to for/of loops, which eliminates nulls
- Pervasive use of the (already existing) `PresentArray` pattern and its
  utilities. Added `getFirst` and `getLast` utilities, as well as some
  variations on the present array checks.
- Used `?` to propagate undefined in testing situations where undefined
  would fail equality checks anyway.
Co-authored-by: Yehuda Katz <wycats@gmail.com>
This PR was originally intended to reactivate the performance tests. My plan was to run the tests through Vite, which revealed more inconsistencies with our module setup.

This PR continues #1426 by tightening up the lints, adding a number of lints to catch problems that were stopping the built modules from working in the vite setup in the performance suite. All of the lints now run on all packages (previously, the non-published packages had significantly weaker lints), and both the published and non-published packages now share an in-repo linting plugin to keep things consistent.

It also tightens up and solidifies the infrastructure that built the packages and .d.ts files.

There's still a bit more to do to finalize the exports setup that will be driven by finishing up the performance suite work.

Since these changes are standalone improvements, I'm going to land this with the perf suite still disabled.
…tion-and-also-move-to-wyvox

GH Actions: Move to wyvox and off branch
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.3.5 to 4.3.9.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.3.9/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
NullVoxPopuli and others added 28 commits November 2, 2023 11:59
…field-for-ember

Add back package.json#module so the ember build can have fewer changes
Revert "fix capture render tree fails when errors in args"
…publish

Compile away local debug for publish
The expectation is that `createPrimitiveRef` is to be used with primitives only.

If that causes type errors, then either:

* The calling side is using this inappropriately and it will cause them problems
* The calling side is missing some assertions to ensure it actually is a primitive
* The assumptions/expectations for this PR is wrong, in which case, please revert

Co-authored-by: Godfrey Chan <godfreykfc@gmail.com>
* Copy bin folder from #1462

* Sync from remote

* update lockfile

* Do not typecheck vm-babel-plugins, because doing so provides no value
… prettier to ci / local tooling (#1500)

* Run prettier with lint:fix

* Update lockfile

* Remove dotenv from lint:files, this busts the turbo cache and makes the linting job slow

* Disable a lint on one additional file

* Don't bust the cache for turbo based on if is logging warnings or not (NODE_OPTIONS)

* Addition of lint:fix for ci was accidentally running when lint was running, doubling up on lint tasks
* Krausest benchmark needs a lint config to properly configure sourceType

* Try to figure out why vm-babel-plugins doesn't appear to be linting correctly

* Get the build working

* Additional ignores

* Fix lints for vm-babel-plugins

* reduceLock

* lint:fix
* Upgrade lint dependencies

* Prettier update means gotta run fix

* How was this missed
Co-authored-by: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
It seems we don't need to have extra class SingleNodeBounds for 2 cases
The purpose of this is to restore a working setup where we can link
all glimmer-vm to ember.js without publishing.

Previously this was just a script that `yarn link` on both sides.

It seems like we tried to use `yalc` at some point.

Neither of those other solutions fully works with the constraints:

* supports pnpm
* supports pnpm workspace
* supports `publishConfig`
* resolve internal dependencies (like `@glimmer/encoder`) when
  linked

This script makes it work with all of the above.

Usage:

1. pnpm install, develop, make changes, etc
2. pnpm build
3. pnpm link:all
4. pnpm link:glimmer-vm from ember.js
5. validate, iterate, re-run pnpm build/pnpm link:all as needed
6. pnpm unlink from ember.js
7. pnpm unlink:all here

See also emberjs/ember.js#20590
@chancancode chancancode deleted the master branch December 11, 2023 20:50
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.

7 participants