-
Notifications
You must be signed in to change notification settings - Fork 402
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
feat(compiler): migrate referential integrity into lwc-compiler #109
Conversation
packages/lwc-compiler/tsconfig.json
Outdated
"module": "es2015", | ||
"sourceMap": true, | ||
// TODO: turn back to true when there are no more js files in the package | ||
// "declaration": true, |
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.
Comments are not valid JSON. One way to do this would be to add a //
entry instead:
{
"sourceMap": true,
"//": "TODO: turn back to true when there are no more js files in the package"
"declaration": true,
}
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.
Ahah. I didn't know this trick, it's awesome!
That being said tsc use json5 to parse the configuration, adding comments is fine.
packages/lwc-compiler/tsconfig.json
Outdated
|
||
// Enhance Strictness | ||
"strict": true, | ||
"suppressImplicitAnyIndexErrors": true |
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.
Add noUnusedLocals
rule (https://www.typescriptlang.org/docs/handbook/compiler-options.html)
packages/lwc-compiler/package.json
Outdated
@@ -7,16 +7,19 @@ | |||
"license": "ISC", | |||
"scripts": { | |||
"clean": "rimraf dist/", | |||
"build": "babel src/ --out-dir dist/commonjs", | |||
"build:umd": "webpack --progress", |
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.
We will probably need to keep the build:umd
for now until we update the delivery mechanism of the compiler into Aura.
@@ -0,0 +1,342 @@ | |||
import { getReferences } from '../../references/css'; |
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.
Collocate the test file closer to the actual implementation in packages/lwc-compiler/src/references/__tests__/css.spec.ts
@@ -0,0 +1,78 @@ | |||
import { getReferences } from '../../references/html'; |
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.
Same comment than for the css.spec.ts
@@ -0,0 +1,115 @@ | |||
import { getReferences } from '../../references/javascript'; |
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.
Same comment than for the css.spec.ts
import { LwcBundle } from '../lwc-bundle'; | ||
|
||
export function getBundleReferences(bundle: LwcBundle): Reference[] { | ||
console.log("BUNDLE", bundle); |
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.
Remove console.log
packages/lwc-compiler/package.json
Outdated
"cssnano": "^3.10.0", | ||
"lwc-template-compiler": "0.17.15", | ||
"parse5": "^3.0.3", |
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.
Could you make sure the versions of the packages align with the other packages?
For example ts-jest
is not in sync with the other package, and it causes new entries to be added in the yarn.lock
packages/lwc-engine/package.json
Outdated
@@ -24,7 +24,7 @@ | |||
"rollup-plugin-replace": "^2.0.0", | |||
"rollup-plugin-typescript": "^0.8.1", | |||
"rollup-plugin-uglify": "3.0.0", | |||
"ts-jest": "^21.0.1", | |||
"ts-jest": "^22.0.4", |
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.
This PR should not update the version of ts-jest
in the other packages. We should update that in another PR, there are several packages that need to be updated along with ts-jest
(eg. @types/jest
, jest
).
Let's keep the PR scoped to lwc-compiler
, and set the ts-jest
to ^21.0.1
to be consistent with the other packages.
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.
Using 21.2.4 as discovered during the debugging with @pmdartus
packages/lwc-compiler/package.json
Outdated
"build:umd": "webpack --progress", | ||
"test": "jest --coverage --maxWorkers=2" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.24.0", | ||
"babel-jest": "^22.2.2", |
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.
Remove babel-jest
Benchmark comparisonBase commit:
|
Benchmark comparisonBase commit:
|
]; | ||
} | ||
|
||
function sfdcReferencesVisitor(references: Reference[], filename: string) { |
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.
why do we have sfdc references in this pkg?
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 thought this was going to be generic enough that can be used by sfdc and others.
@@ -0,0 +1,11 @@ | |||
export declare type ReferenceType = 'resourceUrl' | 'label' | 'apexClass' | 'apexMethod' | 'sobjectClass' | 'sobjectField' | '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.
why does the compiler care about apex or resources or sobjects?
This is temporal as we move things around. We need to update you with the
latest discussions around the platform compiler
…On Thu, Feb 15, 2018 at 9:08 PM Caridy Patiño ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In packages/lwc-compiler/src/references/types.ts
<#109 (comment)>:
> @@ -0,0 +1,11 @@
+export declare type ReferenceType = 'resourceUrl' | 'label' | 'apexClass' | 'apexMethod' | 'sobjectClass' | 'sobjectField' | 'component';
why does the compiler care about apex or resources or sobjects?
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#109 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABH0qI3yLfZOzUe9qUg5ptz3PeNfxFBNks5tVQ02gaJpZM4SGHQB>
.
|
Details
Migrate referential integrity report from lwc-platform compiler into salesforce/lwc compiler.
Fixed the following work item, which is part of the LWC Deploy/Retrieve Epic
Does this PR introduce a breaking change?