-
Notifications
You must be signed in to change notification settings - Fork 0
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
Update Parcel to a stable release #399
Comments
Reduce the steps in running restful-react by generating the OpenAPI doc and running the converter as part of the build separately. As a result, the script doesn't have to be built by Parcel. This change also ensures that the file is built and shared with the host correctly when running the development environment. Refs #399
Usage of the ORM currently has a lot of circular dependencies (where two entities depend on each other). The JS changes in Parcel seem to fail when building: |
parcel-bundler/parcel#6694 might help. |
Seems like parcel-bundler/parcel#7053 has fixed one of the main problems (variables declared in the wrong order). It almost compiles now, but there's one enum that becomes misnamed (extracting it into its own module gets around the problem). parcel-bundler/parcel#7057 might be the fix for this (I'm not sure what the PR does, but the test case involves enums.). |
Parcel 2.0.0 has now been released, but the app still doesn't build. |
The generated data fixtures in the dev environment aren't helpful as they're not realistic. But worse, there are quite a few problems in this area: - It fails to run roughly half the time. - The forked dependency is blocking npm updates. - The ORM overall is blocking Parcel updates. Rather than trying to resolve all the issues, this change removes the fixture generation entirely. As a result, the codebase is a fraction simpler. Refs #399, #406, #421
I've tried no end of combinations, but I can't just get it to work, and there's so many tools using magic I can't understand what's going on properly. When using |
Trying to resolve the order issue in parcel-bundler/parcel#6676 (comment). |
I've managed to reproduce the Parcel problem and open a PR: parcel-bundler/parcel#7293. |
In order to move this forward, we should remove the decorators and use #398 (comment) needs to be addressed though, as there is some code reliant on the use of decorators. |
Rather than misusing a private decorator-specific API, this change uses the ORM's metadata storage instead. A slight issue here is that accessing the entity manager from a repository is technically not a public API, but the code doing so isn't (yet) TypeScript and needs a lot of work anyway. Refs #398, #399
I'm currently struggling to get |
This didn't work, the types seemingly allow for both a I also looked at using types rather than classes, which works but you have to declare types everywhere (since you're just referring to them by a string). Feels like the most pragmatic approach now is to stop Parcel from mangling the names. |
Rather than (inconsistently) using Parcel options in switches, this change places them in the target itself. As a result, they are now consistently applied. Refs #399
Decorators are an experimental feature in TypeScript, which is known to have issues. Changes in Parcel means that it can no longer build the app, so their use is blocking updating Parcel to a stable release. This change removes the ORM decorators in favour of defining entities programmatically. I'm hoping that the tests and migration-creating script are enough to have caught any mistakes, but given that areas of the app remain untested, it's hard to be sure. Also, this change has to disable Parcel's scope hoisting, as it renames the entity classes. The rename wasn't a problem when using decorators as the generated code saw the class name left unchanged. Now, however, the ORM breaks if they are changed. Refs #399, parcel-bundler/parcel#7293 (comment), microsoft/TypeScript#27519
Now that decorators are no longer used, we can use Parcel's built-in mechanism for compiling TypeScript. Parcel uses SWC (https://swc.rs/) rather than tsc. Refs #399, e66f0d8
hey gordon shumway :D. (nice avatar) i saw your issues at parcel to use parcel v2. I am using typeorm with sqlite in an electron app. I got it working by:
import type { person } from '../entities/person'
@Entity({ name: 'family' })
export class Family {
@PrimaryGeneratedColumn()
id: number
// One family holds multiple patients
@OneToMany('Person', 'family', { eager: true })
patients: Person[]
@CreateDateColumn()
createdAt: Date
@UpdateDateColumn()
updatedAt: Date
} PS: in the beta i needed to set a specific entity name, because parcels scopeHosting transformed the name of the class. |
Parcel has had its first release candidate released; this includes changes such as changing the JavaScript compiler (actually in beta 3).
After an initial test, the project as-in doesn't build.
The text was updated successfully, but these errors were encountered: