-
-
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
use esm for requiring default and deprecated features #18218
Conversation
See emberjs/data#6231 (comment) for the motivation.
ts.ScriptTarget.ES2017, | ||
/*setParentNodes */ true | ||
const { default: features } = requireEsm( | ||
'../packages/@ember/canary-features/default-features.js' |
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 could not use @ember/canary-features/default-features.js
for the path. Would this be because ember.js' internal package structure differs from ember data?
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 the local require (e.g. starting with ../packages/
) is totally correct here.
@@ -1,35 +1,12 @@ | |||
'use strict'; | |||
|
|||
const fs = require('fs'); | |||
const ts = require('./typescript'); |
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 see the deprecated features also relies upon this module; I can remove it and merge the deprecated features functionality with this new approach once I sort how the typescript particulars below.
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.
Ya, sounds good to me.
Thanks for working on this @efx! |
ts.ScriptTarget.ES2017, | ||
/*setParentNodes */ true | ||
const { default: features } = requireEsm( | ||
'../packages/@ember/canary-features/default-features.js' |
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 the local require (e.g. starting with ../packages/
) is totally correct here.
Co-Authored-By: Robert Jackson <[email protected]>
Co-Authored-By: Robert Jackson <[email protected]>
Add newly deprecated feature from #18214
Currently some linting failures
And some legit errors in the test run, e.g.:
|
Hmm, I thought my reexport was working but clearly it does not. Not sure about the exact syntax to export those const declarations from the |
*I know not typescript* This makes it work but now there are 2 copies of these flags in `index.js` and `index.ts`. I am pushing up to avoid blocking and we can consider a follow up PR or any intervening TS guidance to solve the duplication.
Closing this as I've run out of steam. I might come back to it once I actually learn TS. May need to spike and try |
See emberjs/data#6231 (comment) for
the motivation.
yarn test
blows up locally, which might be related to not properly typing the import ofdefault-features.js
or not correctly exporting it in@ember/canary-features
.@rwjblue if you have free moments to give me pointers / review here that would be great.