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

refactor(deno): remove deno from codebase #3067

Merged
merged 12 commits into from
Sep 28, 2021
Merged

Conversation

rwaskiewicz
Copy link
Contributor

@rwaskiewicz rwaskiewicz commented Sep 16, 2021

To Folks Who Would Like Deno to be Supported

Please 👍 the summary of the RFC located here. Or leave a comment explaining your use case for Deno (but please do not leave a comment with just '👍')

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Build (npm run build) was run locally and any changes were pushed
  • Unit tests (npm test) were run locally and passed
  • E2E Tests (npm run test.karma.prod) were run locally and passed
  • Prettier (npm run prettier) was run locally and passed

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

We have a good amount of code for Deno, which we sunset recently. It doesn't actually function today.

GitHub Issue Number: N/A

What is the new behavior?

Same as it does today 😆 This just rips Deno out of the Stencil repo

Does this introduce a breaking change?

  • Yes
  • No - we've talked about this as a team. Given the fact it does not work today, we do not consider this removal to be a breaking change

Testing

In addition to CI based tests:

  • Built a tarball with this version of Stencil locally, and was able to use it successfully in a new app spun up with npm init stencil
  • Smoke tested the output of the test/browser-compiler

Other information

@rwaskiewicz rwaskiewicz changed the title Rwaskiewicz/rm deno refactor(deno): remove deno from codebase Sep 16, 2021
typeof global !== 'undefined' &&
typeof require === 'function' &&
!!global.process &&
typeof __filename === 'string' &&
(!(global as any as Window).origin || typeof (global as any as Window).origin !== 'string');

export const OS_PLATFORM = IS_NODE_ENV ? process.platform : IS_DENO_ENV ? Deno.build.os : '';
Copy link
Contributor Author

@rwaskiewicz rwaskiewicz Sep 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deno.build.os could return the string "windows" which is why we can safely remove the check for it in the line below (in fact, the compiler yells at us because "windows" is not a valid process.plaform value)

I don't believe "windows" was ever a valid process.platform value, and couldn't find definitive proof of it having existing in https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node

@@ -2,7 +2,7 @@ import { OS_PLATFORM } from '../environment';

export const EOL = '\n';

export const platform = () => (OS_PLATFORM === 'windows' ? 'win32' : OS_PLATFORM);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're able to do this as a result of this comment's context

@rwaskiewicz rwaskiewicz marked this pull request as ready for review September 16, 2021 19:40
@rwaskiewicz rwaskiewicz requested a review from a team September 16, 2021 19:40
@bartlomieju
Copy link

Hi @rwaskiewicz! I'm one of Deno maintainers. I was just about to open a PR updating vendored Deno dependencies (namely deno.land/[email protected] to deno.land/[email protected]) and found this PR.

I was very impressed how you solved Deno compatiblity using sys pattern and I wanted to use the same pattern in other projects to provide Deno compatibility. FYI we've significantly improved our Node compatibility layer since you started using it.

I'm very curious to hear your thoughts about the subject and problems that you faced, and to know if there's anything we could do to help out with those problems.

@rwaskiewicz
Copy link
Contributor Author

Hey @bartlomieju!

Thanks! Although I can’t take credit for the sys abstraction, it’s a certainly a handy one 🙂

With regards to Deno support in Stencil, we found that our Deno support (which had been marked as experimental by a previous maintainer) wasn’t being actively used. We polled our community, and weren’t able to surface any active users of Stencil + Deno. Additionally, when we tried to understand the current state of the functionality, we realized that it had broken some time ago, and hadn’t been noticed.

The new team behind Stencil is relatively small, and is still getting ramped up on all of its inner workings. While we’d like to support as much as possible, we realized we have to be judicious about the functionality that we support. Due to the lack of usage, we felt that refurbishing Deno support was not going to serve the needs of our community.

With all of that being said, if there is community desire to bring Deno support back, we’re absolutely up for it. That sys abstraction makes adding runtimes rather easy, Also, if you’re interested to hear more/talk further, I’m happy to do so!

@rwaskiewicz rwaskiewicz merged commit 037b228 into master Sep 28, 2021
@rwaskiewicz rwaskiewicz deleted the rwaskiewicz/rm-deno branch September 28, 2021 14:12
@bartlomieju
Copy link

@rwaskiewicz thanks for the response!

With regards to Deno support in Stencil, we found that our Deno support (which had been marked as experimental by a previous maintainer) wasn’t being actively used. We polled our community, and weren’t able to surface any active users of Stencil + Deno. Additionally, when we tried to understand the current state of the functionality, we realized that it had broken some time ago, and hadn’t been noticed.

The new team behind Stencil is relatively small, and is still getting ramped up on all of its inner workings. While we’d like to support as much as possible, we realized we have to be judicious about the functionality that we support. Due to the lack of usage, we felt that refurbishing Deno support was not going to serve the needs of our community.

That makes perfect sense and I completely understand this situation.

With all of that being said, if there is community desire to bring Deno support back, we’re absolutely up for it. That sys abstraction makes adding runtimes rather easy, Also, if you’re interested to hear more/talk further, I’m happy to do so!

That sounds great; in parallel we're ramping out efforts to make codebases supporting Node and Deno at the same time easier to maintain and hopefully in the coming weeks we'll be able to provide the solution that would lower the maintenance burden.

rwaskiewicz added a commit that referenced this pull request Feb 16, 2023
this commit removes an unnecessary generation of a `dependencies.json`
file that would be created at build/release time in the root of the
stencil repository. this file was originally used when stencil supported
deno; however, support for that runtime was deprecated in
#3067. as such, this file and
its suppporting infrastructure is no longer needed.

there are complimentary functions in the Node sys impl. however, those
are no-ops, and need not be called in the cli. we do not remove them at
this time for fear of introducing a breaking change.

in this commit, we take the one utility function that is used in the
build process today and relocated it to be spatially closer to its one
caller
rwaskiewicz added a commit that referenced this pull request Feb 16, 2023
this commit removes an unnecessary generation of a `dependencies.json`
file that would be created at build/release time in the root of the
stencil repository. this file was originally used when stencil supported
deno; however, support for that runtime was deprecated in
#3067. as such, this file and
its suppporting infrastructure is no longer needed.

there are complimentary functions in the Node sys impl. however, those
are no-ops, and need not be called in the cli. we do not remove them at
this time for fear of introducing a breaking change.

in this commit, we take the one utility function that is used in the
build process today and relocated it to be spatially closer to its one
caller
rwaskiewicz added a commit that referenced this pull request Feb 17, 2023
this commit removes an unnecessary generation of a `dependencies.json`
file that would be created at build/release time in the root of the
stencil repository. this file was originally used when stencil supported
deno; however, support for that runtime was deprecated in
#3067. as such, this file and
its suppporting infrastructure is no longer needed.

there are complimentary functions in the Node sys impl. however, those
are no-ops, and need not be called in the cli. we do not remove them at
this time for fear of introducing a breaking change.

in this commit, we take the one utility function that is used in the
build process today and relocated it to be spatially closer to its one
caller
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.

3 participants